NovaSVG 0.10.0
A header-only SVG library
Loading...
Searching...
No Matches
novasvg::Transform Class Reference

#include <canvas.h>

Collaboration diagram for novasvg::Transform:

Public Member Functions

 Transform ()
 
 Transform (const Matrix &matrix)
 
 Transform (float a, float b, float c, float d, float e, float f)
 
 Transform (const matrix_t &matrix)
 
Transform operator* (const Transform &transform) const
 
Transform & operator*= (const Transform &transform)
 
Transform & multiply (const Transform &transform)
 
Transform & translate (float tx, float ty)
 
Transform & scale (float sx, float sy)
 
Transform & rotate (float angle, float cx=0.f, float cy=0.f)
 
Transform & shear (float shx, float shy)
 
Transform & postMultiply (const Transform &transform)
 
Transform & postTranslate (float tx, float ty)
 
Transform & postScale (float sx, float sy)
 
Transform & postRotate (float angle, float cx=0.f, float cy=0.f)
 
Transform & postShear (float shx, float shy)
 
Transform inverse () const
 
Transform & invert ()
 
void reset ()
 
Point mapPoint (float x, float y) const
 
Point mapPoint (const Point &point) const
 
Rect mapRect (const Rect &rect) const
 
float xScale () const
 
float yScale () const
 
const matrix_t & matrix () const
 
matrix_t & matrix ()
 
bool parse (const char *data, size_t length)
 

Static Public Member Functions

static Transform translated (float tx, float ty)
 
static Transform scaled (float sx, float sy)
 
static Transform rotated (float angle, float cx, float cy)
 
static Transform sheared (float shx, float shy)
 

Static Public Attributes

static const Transform Identity
 

Detailed Description

Definition at line 256 of file canvas.h.

Constructor & Destructor Documentation

◆ Transform() [1/4]

NOVASVG_INLINE novasvg::Transform::Transform ( )

Definition at line 555 of file canvas.h.

References novasvg::render::matrix_init_identity().

◆ Transform() [2/4]

novasvg::Transform::Transform ( const Matrix &  matrix)
inline

Definition at line 768 of file novasvg.h.

◆ Transform() [3/4]

NOVASVG_INLINE novasvg::Transform::Transform ( float  a,
float  b,
float  c,
float  d,
float  e,
float  f 
)

Definition at line 560 of file canvas.h.

References novasvg::render::matrix_init().

◆ Transform() [4/4]

novasvg::Transform::Transform ( const matrix_t &  matrix)
inline

Definition at line 261 of file canvas.h.

Member Function Documentation

◆ inverse()

NOVASVG_INLINE Transform novasvg::Transform::inverse ( ) const

Definition at line 632 of file canvas.h.

References inverse(), and novasvg::render::matrix_invert().

Referenced by inverse(), and novasvg::Matrix::inverse().

◆ invert()

NOVASVG_INLINE Transform & novasvg::Transform::invert ( )

Definition at line 639 of file canvas.h.

References novasvg::render::matrix_invert().

◆ mapPoint() [1/2]

NOVASVG_INLINE Point novasvg::Transform::mapPoint ( const Point &  point) const

Definition at line 656 of file canvas.h.

References mapPoint(), novasvg::render::point::x, and novasvg::render::point::y.

◆ mapPoint() [2/2]

NOVASVG_INLINE Point novasvg::Transform::mapPoint ( float  x,
float  y 
) const

Definition at line 650 of file canvas.h.

References novasvg::render::matrix_map().

Referenced by mapPoint().

◆ mapRect()

◆ matrix() [1/2]

matrix_t & novasvg::Transform::matrix ( )
inline

Definition at line 291 of file canvas.h.

◆ matrix() [2/2]

const matrix_t & novasvg::Transform::matrix ( ) const
inline

Definition at line 290 of file canvas.h.

Referenced by rotated(), scaled(), sheared(), and translated().

◆ multiply()

NOVASVG_INLINE Transform & novasvg::Transform::multiply ( const Transform &  transform)

Definition at line 582 of file canvas.h.

Referenced by novasvg::SVGClipPathElement::applyClipPath(), rotate(), scale(), shear(), and translate().

◆ operator*()

NOVASVG_INLINE Transform novasvg::Transform::operator* ( const Transform &  transform) const

Definition at line 570 of file canvas.h.

References novasvg::render::matrix_multiply().

◆ operator*=()

NOVASVG_INLINE Transform & novasvg::Transform::operator*= ( const Transform &  transform)

Definition at line 577 of file canvas.h.

◆ parse()

NOVASVG_INLINE bool novasvg::Transform::parse ( const char *  data,
size_t  length 
)

Definition at line 682 of file canvas.h.

References novasvg::render::matrix_parse().

Referenced by novasvg::SVGTransform::parse().

◆ postMultiply()

NOVASVG_INLINE Transform & novasvg::Transform::postMultiply ( const Transform &  transform)

◆ postRotate()

NOVASVG_INLINE Transform & novasvg::Transform::postRotate ( float  angle,
float  cx = 0.f,
float  cy = 0.f 
)

Definition at line 622 of file canvas.h.

References postMultiply(), and rotated().

◆ postScale()

NOVASVG_INLINE Transform & novasvg::Transform::postScale ( float  sx,
float  sy 
)

Definition at line 617 of file canvas.h.

References postMultiply(), and scaled().

◆ postShear()

NOVASVG_INLINE Transform & novasvg::Transform::postShear ( float  shx,
float  shy 
)

Definition at line 627 of file canvas.h.

References postMultiply(), and sheared().

◆ postTranslate()

NOVASVG_INLINE Transform & novasvg::Transform::postTranslate ( float  tx,
float  ty 
)

Definition at line 612 of file canvas.h.

References postMultiply(), and translated().

◆ reset()

NOVASVG_INLINE void novasvg::Transform::reset ( )

Definition at line 645 of file canvas.h.

References novasvg::render::matrix_init_identity().

◆ rotate()

NOVASVG_INLINE Transform & novasvg::Transform::rotate ( float  angle,
float  cx = 0.f,
float  cy = 0.f 
)

Definition at line 597 of file canvas.h.

References multiply(), and rotated().

◆ rotated()

◆ scale()

NOVASVG_INLINE Transform & novasvg::Transform::scale ( float  sx,
float  sy 
)

Definition at line 592 of file canvas.h.

References multiply(), and scaled().

◆ scaled()

NOVASVG_INLINE Transform novasvg::Transform::scaled ( float  sx,
float  sy 
)
static

◆ shear()

NOVASVG_INLINE Transform & novasvg::Transform::shear ( float  shx,
float  shy 
)

Definition at line 602 of file canvas.h.

References multiply(), and sheared().

◆ sheared()

NOVASVG_INLINE Transform novasvg::Transform::sheared ( float  shx,
float  shy 
)
static

Definition at line 708 of file canvas.h.

References matrix(), novasvg::render::matrix_init_shear(), and NOVASVG_DEG2RAD.

Referenced by postShear(), shear(), and novasvg::Matrix::sheared().

◆ translate()

NOVASVG_INLINE Transform & novasvg::Transform::translate ( float  tx,
float  ty 
)

Definition at line 587 of file canvas.h.

References multiply(), and translated().

◆ translated()

◆ xScale()

NOVASVG_INLINE float novasvg::Transform::xScale ( ) const

◆ yScale()

NOVASVG_INLINE float novasvg::Transform::yScale ( ) const

Definition at line 677 of file canvas.h.

References novasvg::render::matrix::c, and novasvg::render::matrix::d.

Member Data Documentation

◆ Identity


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