FastUIDraw
Public Types | List of all members
fastuidraw::PainterBrushEnums Class Reference

Class to contain various enumerations needed for describing a brush. More...

#include <painter_enums.hpp>

Inheritance diagram for fastuidraw::PainterBrushEnums:
Inheritance graph
[legend]

Public Types

enum  filter_t { filter_nearest = 1, filter_linear = 2, filter_cubic = 3 }
 Enumeration specifying what filter to apply to an image. More...
 
enum  gradient_type_t {
  gradient_non = 0, gradient_linear, gradient_radial, gradient_sweep,
  number_gradient_types
}
 
enum  mipmap_t { apply_mipmapping, dont_apply_mipmapping }
 
enum  spread_type_t {
  spread_clamp, spread_mirror, spread_repeat, spread_mirror_repeat,
  number_spread_types
}
 

Detailed Description

Class to contain various enumerations needed for describing a brush.

Definition at line 36 of file painter_enums.hpp.

Member Enumeration Documentation

◆ filter_t

Enumeration specifying what filter to apply to an image.

Enumerator
filter_nearest 

Indicates to use nearest filtering (i.e choose closest pixel).

filter_linear 

Indicates to use bilinear filtering.

filter_cubic 

Indicates to use bicubic filtering.

Definition at line 83 of file painter_enums.hpp.

◆ gradient_type_t

enumeration to describe a gradient type.

Enumerator
gradient_non 

indicates the lack of a gradient.

gradient_linear 

Indicates a linear gradient; a linear gradient is defined by two points p0 and p1 where the interpolate at a point p is the value of dot(p - p0, p1 - p0) / dot(p0 - p1, p0 - p1).

gradient_radial 

Indicates a radial gradient; a radial gradient is defined by two circles C0 = Circle(p0, r0), C1 = Circle(p1, r1) where the interpolate at a point p is the time t when p is on the circle C(t) where C(t) = Circle(p(t), r(t)), p(t) = p0 + (p1 - p0) * t and r(t) = r0 + (r1 - r0) * t.

gradient_sweep 

Indicates a sweep gradient; a sweep gradient is defined by a single point C, an angle theta (in radians), a sign S and a factor F. The angle theta represents at what angle the gradient starts, the point C is the center point of the sweep, the sign of S represents the angle orientation and the factor F reprsents how many times the gradient is to be repated. Precisely, the interpolate at a point p is defined as t_interpolate where

vec2 d = p - C;
float theta, v;
theta = S * atan(d.y, d.x);
if (theta < alpha )
{
theta += 2 * PI;
}
theta -= alpha;
v = (theta - angle) / (2 * PI);
t_interpolate = (S < 0.0) ? F * (1.0 - v) : F * v;

Definition at line 121 of file painter_enums.hpp.

◆ mipmap_t

enumeration to specify mipmapping on an image

Enumerator
apply_mipmapping 

Indicates to apply mipmap filtering

dont_apply_mipmapping 

Indicates to not apply mipmap filtering

Definition at line 105 of file painter_enums.hpp.

◆ spread_type_t

Enumeration to specify how a value is interpreted outside of its natural range. For gradients the range is [0, 1] acting on its interpolate.

Enumerator
spread_clamp 

Clamp the value to its range, i.e. for a value t on a range [A, B] the value is clamp(r, A, B).

spread_mirror 

Mirror the value across the start of its range, i.e. for a value t on a range [A, B] the value is clamp(A + abs(t - A), A, B)

spread_repeat 

Repeat the value to its range, i.e. for a value t on a range [A, B] the value is A + mod(t - A, B - A)

spread_mirror_repeat 

Mirror repeat the value across the start of its range, i.e. for a value t on a range [A, B] the value is B - abs(mod(t - A, 2 * (B - A)) - (B - A))

Definition at line 44 of file painter_enums.hpp.


The documentation for this class was generated from the following file: