MyScript Interactive Ink SDK  3.0.1
Public Member Functions | Protected Attributes | List of all members
myscript::iink::graphics::Style Class Reference

#include <Style.h>

Public Member Functions

 Style ()=default
 
void clear () noexcept
 
void setStrokeColor (Color strokeColor) noexcept
 
Color getStrokeColor () const noexcept
 
void setStrokeWidth (float strokeWidth) noexcept
 
float getStrokeWidth () const noexcept
 
void setStrokeLineCap (LineCap strokeLineCap) noexcept
 
LineCap getStrokeLineCap () const noexcept
 
void setStrokeLineJoin (LineJoin strokeLineJoin) noexcept
 
LineJoin getStrokeLineJoin () const noexcept
 
void setStrokeMiterLimit (float strokeMiterLimit) noexcept
 
float getStrokeMiterLimit () const noexcept
 
void setStrokeDashArray (const std::vector< float > &strokeDashArray) noexcept
 
std::vector< float > getStrokeDashArray () const noexcept
 
void setStrokeDashOffset (float strokeDashOffset) noexcept
 
float getStrokeDashOffset () const noexcept
 
void setFillColor (Color fillColor) noexcept
 
Color getFillColor () const noexcept
 
void setFillRule (FillRule fillRule) noexcept
 
FillRule getFillRule () const noexcept
 
void setFontFamily (const String &fontFamily) noexcept
 
String getFontFamily () const noexcept
 
void setFontLineHeight (float fontLineHeight) noexcept
 
float getFontLineHeight () const noexcept
 
void setFontSize (float fontSize) noexcept
 
float getFontSize () const noexcept
 
void setFontStyle (const String &fontStyle) noexcept
 
String getFontStyle () const noexcept
 
void setFontVariant (const String &fontVariant) noexcept
 
String getFontVariant () const noexcept
 
void setFontWeight (int fontWeight) noexcept
 
int getFontWeight () const noexcept
 
void setDropShadowXOffset (float dropShadowXOffset) noexcept
 
float getDropShadowXOffset () const noexcept
 
void setDropShadowYOffset (float dropShadowYOffset) noexcept
 
float getDropShadowYOffset () const noexcept
 
void setDropShadowRadius (float dropShadowRadius) noexcept
 
float getDropShadowRadius () const noexcept
 
void setDropShadowColor (Color dropShadowColor) noexcept
 
Color getDropShadowColor () const noexcept
 
std::underlying_type< StyleFlag >::type getChangeFlags () noexcept
 
void setChangeFlags (std::underlying_type< StyleFlag >::type flags) noexcept
 
void clearChangeFlags () noexcept
 
void applyTo (ICanvas &canvas) noexcept
 
bool operator== (const Style &other) const noexcept
 
bool operator!= (const Style &other) const noexcept
 

Protected Attributes

Color strokeColor = Color::NONE
 
float strokeWidth = 1.f
 
LineCap strokeLineCap = LineCap::BUTT
 
LineJoin strokeLineJoin = LineJoin::MITER
 
float strokeMiterLimit = 0.5f
 
std::vector< float > strokeDashArray {}
 
float strokeDashOffset = 0.f
 
Color fillColor = Color::BLACK
 
FillRule fillRule = FillRule::NONZERO
 
String fontFamily = "sans-serif"
 
float fontLineHeight = 1.2f
 
float fontSize = 10.0f
 
String fontStyle = "normal"
 
String fontVariant = "normal"
 
int fontWeight = 400
 
float dropShadowXOffset = 0.5f
 
float dropShadowYOffset = 0.5f
 
float dropShadowRadius = 2.f
 
Color dropShadowColor = Color::NONE
 
std::underlying_type< StyleFlag >::type changeFlags = StyleFlag::StyleFlag_NONE
 

Detailed Description

Style information for the rendering of strokes and text.

Constructor & Destructor Documentation

◆ Style()

myscript::iink::graphics::Style::Style ( )
default

Default constructor.

Member Function Documentation

◆ clear()

void myscript::iink::graphics::Style::clear ( )
noexcept

Resets the style properties to their default value.

◆ setStrokeColor()

void myscript::iink::graphics::Style::setStrokeColor ( Color  strokeColor)
noexcept

Sets the stroke color.

Parameters
strokeColorthe stroke color.

◆ getStrokeColor()

Color myscript::iink::graphics::Style::getStrokeColor ( ) const
noexcept

Retrieves the stroke color.

Returns
the stroke color.

◆ setStrokeWidth()

void myscript::iink::graphics::Style::setStrokeWidth ( float  strokeWidth)
noexcept

Sets the stroke width.

Parameters
strokeWidththe stroke width.

◆ getStrokeWidth()

float myscript::iink::graphics::Style::getStrokeWidth ( ) const
noexcept

Retrieves the stroke width.

Returns
the stroke width.

◆ setStrokeLineCap()

void myscript::iink::graphics::Style::setStrokeLineCap ( LineCap  strokeLineCap)
noexcept

Sets the stroke line cap.

Parameters
strokeLineCapthe stroke line cap.

◆ getStrokeLineCap()

LineCap myscript::iink::graphics::Style::getStrokeLineCap ( ) const
noexcept

Retrieves the stroke line cap.

Returns
the stroke line cap.

◆ setStrokeLineJoin()

void myscript::iink::graphics::Style::setStrokeLineJoin ( LineJoin  strokeLineJoin)
noexcept

Sets the stroke line join.

Parameters
strokeLineJointhe stroke line join.

◆ getStrokeLineJoin()

LineJoin myscript::iink::graphics::Style::getStrokeLineJoin ( ) const
noexcept

Retrieves the stroke line join.

Returns
the stroke line join.

◆ setStrokeMiterLimit()

void myscript::iink::graphics::Style::setStrokeMiterLimit ( float  strokeMiterLimit)
noexcept

Sets the stroke miter limit.

Parameters
strokeMiterLimitthe stroke miter limit.

◆ getStrokeMiterLimit()

float myscript::iink::graphics::Style::getStrokeMiterLimit ( ) const
noexcept

Retrieves the stroke miter limit.

Returns
the stroke miter limit.

◆ setStrokeDashArray()

void myscript::iink::graphics::Style::setStrokeDashArray ( const std::vector< float > &  strokeDashArray)
noexcept

Sets the pattern of dashes and gaps used to stroke paths.

Parameters
strokeDashArraythe vector describing the dashes pattern.

◆ getStrokeDashArray()

std::vector<float> myscript::iink::graphics::Style::getStrokeDashArray ( ) const
noexcept

Retrieves the stroke dash pattern.

Returns
the stroke dash pattern.

◆ setStrokeDashOffset()

void myscript::iink::graphics::Style::setStrokeDashOffset ( float  strokeDashOffset)
noexcept

Sets the distance into the dash pattern to start the dash.

Parameters
strokeDashOffsetthe dash offset.

◆ getStrokeDashOffset()

float myscript::iink::graphics::Style::getStrokeDashOffset ( ) const
noexcept

Retrieves the stroke dash offset.

Returns
the stroke dash offset.

◆ setFillColor()

void myscript::iink::graphics::Style::setFillColor ( Color  fillColor)
noexcept

Sets the fill color.

Parameters
fillColorthe fill color.

◆ getFillColor()

Color myscript::iink::graphics::Style::getFillColor ( ) const
noexcept

Retrieves the stroke fill color.

Returns
the stroke fill color.

◆ setFillRule()

void myscript::iink::graphics::Style::setFillRule ( FillRule  fillRule)
noexcept

Sets the fill rule.

Parameters
fillRulethe fill rule.

◆ getFillRule()

FillRule myscript::iink::graphics::Style::getFillRule ( ) const
noexcept

Retrieves the stroke fill rule.

Returns
the stroke fill rule.

◆ setFontFamily()

void myscript::iink::graphics::Style::setFontFamily ( const String &  fontFamily)
noexcept

Sets the font family.

Parameters
fontFamilythe font family.

◆ getFontFamily()

String myscript::iink::graphics::Style::getFontFamily ( ) const
noexcept

Retrieves the font family.

Returns
the font family.

◆ setFontLineHeight()

void myscript::iink::graphics::Style::setFontLineHeight ( float  fontLineHeight)
noexcept

Sets the font line height.

Parameters
fontLineHeightthe font line height.

◆ getFontLineHeight()

float myscript::iink::graphics::Style::getFontLineHeight ( ) const
noexcept

Retrieves the font line height.

Returns
the font line height.

◆ setFontSize()

void myscript::iink::graphics::Style::setFontSize ( float  fontSize)
noexcept

Sets the font size.

Parameters
fontSizethe font size.

◆ getFontSize()

float myscript::iink::graphics::Style::getFontSize ( ) const
noexcept

Retrieves the font size.

Returns
the font size.

◆ setFontStyle()

void myscript::iink::graphics::Style::setFontStyle ( const String &  fontStyle)
noexcept

Sets the font style.

Parameters
fontStylethe font style.

◆ getFontStyle()

String myscript::iink::graphics::Style::getFontStyle ( ) const
noexcept

Retrieves the font style.

Returns
the font style.

◆ setFontVariant()

void myscript::iink::graphics::Style::setFontVariant ( const String &  fontVariant)
noexcept

Sets the font variant.

Parameters
fontVariantthe font variant.

◆ getFontVariant()

String myscript::iink::graphics::Style::getFontVariant ( ) const
noexcept

Retrieves the font variant.

Returns
the font variant.

◆ setFontWeight()

void myscript::iink::graphics::Style::setFontWeight ( int  fontWeight)
noexcept

Sets the font weight.

Parameters
fontWeightthe font weight.

◆ getFontWeight()

int myscript::iink::graphics::Style::getFontWeight ( ) const
noexcept

Retrieves the font weight.

Returns
the font weight.

◆ setDropShadowXOffset()

void myscript::iink::graphics::Style::setDropShadowXOffset ( float  dropShadowXOffset)
noexcept

Sets the drop shadow horizontal offset.

Parameters
dropShadowXOffsetthe drop shadow horizontal offset.

◆ getDropShadowXOffset()

float myscript::iink::graphics::Style::getDropShadowXOffset ( ) const
noexcept

Retrieves the drop shadow horizontal offset.

Returns
the drop shadow horizontal offset.

◆ setDropShadowYOffset()

void myscript::iink::graphics::Style::setDropShadowYOffset ( float  dropShadowYOffset)
noexcept

Sets the drop shadow vertical offset.

Parameters
dropShadowYOffsetthe drop shadow vertical offset.

◆ getDropShadowYOffset()

float myscript::iink::graphics::Style::getDropShadowYOffset ( ) const
noexcept

Retrieves the drop shadow vertical offset.

Returns
the drop shadow vertical offset.

◆ setDropShadowRadius()

void myscript::iink::graphics::Style::setDropShadowRadius ( float  dropShadowRadius)
noexcept

Sets the drop shadow blur radius.

Parameters
dropShadowRadiusthe drop shadow blur radius.

◆ getDropShadowRadius()

float myscript::iink::graphics::Style::getDropShadowRadius ( ) const
noexcept

Retrieves the drop shadow blur radius.

Returns
the drop shadow blur radius.

◆ setDropShadowColor()

void myscript::iink::graphics::Style::setDropShadowColor ( Color  dropShadowColor)
noexcept

Sets the drop shadow color.

Parameters
dropShadowColorthe drop shadow color.

◆ getDropShadowColor()

Color myscript::iink::graphics::Style::getDropShadowColor ( ) const
noexcept

Retrieves the drop shadow color.

Returns
the drop shadow color.

◆ getChangeFlags()

std::underlying_type<StyleFlag>::type myscript::iink::graphics::Style::getChangeFlags ( )
noexcept

Returns the set of style attributes changed since construction or last call to clearChangeFlags().

Returns
the set of style flags.

◆ setChangeFlags()

void myscript::iink::graphics::Style::setChangeFlags ( std::underlying_type< StyleFlag >::type  flags)
noexcept

Sets the change flags.

Parameters
flagsthe set of style flags.

◆ clearChangeFlags()

void myscript::iink::graphics::Style::clearChangeFlags ( )
noexcept

Clears the change flags.

◆ applyTo()

void myscript::iink::graphics::Style::applyTo ( ICanvas &  canvas)
noexcept

Apply changed style attributes to the specified target canvas.

Parameters
canvasthe target canvas.
See also
getChangeFlags()

◆ operator==()

bool myscript::iink::graphics::Style::operator== ( const Style &  other) const
noexcept

Operator == overload.

Parameters
otherthe style to compare this with.
Returns
true if the styles are strictly equal, otherwise false.

◆ operator!=()

bool myscript::iink::graphics::Style::operator!= ( const Style &  other) const
noexcept

Operator != overload.

Parameters
otherthe style to compare this with.
Returns
true if the styles are strictly equal, otherwise false.

Member Data Documentation

◆ strokeColor

Color myscript::iink::graphics::Style::strokeColor = Color::NONE
protected

◆ strokeWidth

float myscript::iink::graphics::Style::strokeWidth = 1.f
protected

◆ strokeLineCap

LineCap myscript::iink::graphics::Style::strokeLineCap = LineCap::BUTT
protected

◆ strokeLineJoin

LineJoin myscript::iink::graphics::Style::strokeLineJoin = LineJoin::MITER
protected

◆ strokeMiterLimit

float myscript::iink::graphics::Style::strokeMiterLimit = 0.5f
protected

◆ strokeDashArray

std::vector<float> myscript::iink::graphics::Style::strokeDashArray {}
protected

◆ strokeDashOffset

float myscript::iink::graphics::Style::strokeDashOffset = 0.f
protected

◆ fillColor

Color myscript::iink::graphics::Style::fillColor = Color::BLACK
protected

◆ fillRule

FillRule myscript::iink::graphics::Style::fillRule = FillRule::NONZERO
protected

◆ fontFamily

String myscript::iink::graphics::Style::fontFamily = "sans-serif"
protected

◆ fontLineHeight

float myscript::iink::graphics::Style::fontLineHeight = 1.2f
protected

◆ fontSize

float myscript::iink::graphics::Style::fontSize = 10.0f
protected

◆ fontStyle

String myscript::iink::graphics::Style::fontStyle = "normal"
protected

◆ fontVariant

String myscript::iink::graphics::Style::fontVariant = "normal"
protected

◆ fontWeight

int myscript::iink::graphics::Style::fontWeight = 400
protected

◆ dropShadowXOffset

float myscript::iink::graphics::Style::dropShadowXOffset = 0.5f
protected

◆ dropShadowYOffset

float myscript::iink::graphics::Style::dropShadowYOffset = 0.5f
protected

◆ dropShadowRadius

float myscript::iink::graphics::Style::dropShadowRadius = 2.f
protected

◆ dropShadowColor

Color myscript::iink::graphics::Style::dropShadowColor = Color::NONE
protected

◆ changeFlags

std::underlying_type<StyleFlag>::type myscript::iink::graphics::Style::changeFlags = StyleFlag::StyleFlag_NONE
protected

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