iPlug 2: IPattern Struct Reference

Used to store pattern information for gradients. More...

#include <IGraphicsStructs.h>

Public Member Functions

 IPattern (EPatternType type)
 Create an IPattern. More...
 
 IPattern (const IColor &color)
 Create an IPattern with a solid color fill. More...
 
int NStops () const
 
const IColorStopGetStop (int idx) const
 Get the IColorStop at a particular index (will crash if out of bounds) More...
 
void AddStop (IColor color, float offset)
 Add an IColorStop to the IPattern. More...
 
void SetTransform (float xx, float yx, float xy, float yy, float tx, float ty)
 Set the affine transform for the IPattern with values. More...
 
void SetTransform (const IMatrix &transform)
 Set the affine transform for the IPattern with an IMatrix. More...
 

Static Public Member Functions

static IPattern CreateLinearGradient (float x1, float y1, float x2, float y2, const std::initializer_list< IColorStop > &stops={})
 Create a linear gradient IPattern. More...
 
static IPattern CreateLinearGradient (const IRECT &bounds, EDirection direction, const std::initializer_list< IColorStop > &stops={})
 Create a linear gradient IPattern across a rectangular area. More...
 
static IPattern CreateRadialGradient (float x1, float y1, float r, const std::initializer_list< IColorStop > &stops={})
 Create a radial gradient IPattern. More...
 
static IPattern CreateSweepGradient (float x1, float y1, const std::initializer_list< IColorStop > &stops={}, float angleStart=0.f, float angleEnd=360.f)
 Create a sweep gradient IPattern (SKIA only) More...
 

Public Attributes

EPatternType mType
 
EPatternExtend mExtend
 
IColorStop mStops [16]
 
int mNStops
 
IMatrix mTransform
 

Used to store pattern information for gradients.

Definition at line 2147 of file IGraphicsStructs.h.

IPattern::IPattern ( EPatternType  type)
inline

◆ IPattern() [2/2]

IPattern::IPattern ( const IColor color)
inline

◆ AddStop()

void IPattern::AddStop ( IColor  color,
float  offset 
)
inline

◆ CreateLinearGradient() [1/2]

static IPattern IPattern::CreateLinearGradient ( const IRECT bounds,
EDirection  direction,
const std::initializer_list< IColorStop > &  stops = {} 
)
inlinestatic

Create a linear gradient IPattern across a rectangular area.

Parameters
boundsThe rectangular area
directionIf the gradient should be horizontal or vertical
stopsAn initializer list of IColorStops for the stops
Returns
IPattern The new IPattern

Definition at line 2209 of file IGraphicsStructs.h.

◆ CreateLinearGradient() [2/2]

static IPattern IPattern::CreateLinearGradient ( float  x1,
float  y1,
float  x2,
float  y2,
const std::initializer_list< IColorStop > &  stops = {} 
)
inlinestatic

◆ CreateRadialGradient()

static IPattern IPattern::CreateRadialGradient ( float  x1,
float  y1,
float  r,
const std::initializer_list< IColorStop > &  stops = {} 
)
inlinestatic

◆ CreateSweepGradient()

static IPattern IPattern::CreateSweepGradient ( float  x1,
float  y1,
const std::initializer_list< IColorStop > &  stops = {},
float  angleStart = 0.f,
float  angleEnd = 360.f 
)
inlinestatic

Create a sweep gradient IPattern (SKIA only)

Parameters
x1The x position of the centre
y1The y position of the centre
stopsAn initializer list of IColorStops for the stops
angleStartthe start angle of the sweep at in degrees clockwise where 0 is up
angleEndthe end angle of the sweep at in degrees clockwise where 0 is up
Returns
IPattern The new IPattern

Definition at line 2256 of file IGraphicsStructs.h.

◆ GetStop()

const IColorStop & IPattern::GetStop ( int  idx) const
inline

◆ NStops()

int IPattern::NStops ( ) const
inline

◆ SetTransform() [1/2]

void IPattern::SetTransform ( const IMatrix transform)
inline

◆ SetTransform() [2/2]

void IPattern::SetTransform ( float  xx,
float  yx,
float  xy,
float  yy,
float  tx,
float  ty 
)
inline

Set the affine transform for the IPattern with values.

Parameters
xxxx component of the affine transformation
yxyx component of the affine transformation
xyxy component of the affine transformation
yyyy component of the affine transformation
txX translation component of the affine transformation
tyY translation component of the affine transformation

Definition at line 2311 of file IGraphicsStructs.h.

◆ mExtend

EPatternExtend IPattern::mExtend

◆ mNStops

◆ mStops

◆ mTransform

◆ mType

EPatternType IPattern::mType


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