Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Geom::Scale Class Reference

Scaling from the origin. More...

#include <transforms.h>

Inheritance diagram for Geom::Scale:
Geom::TransformOperations< Scale >

Public Member Functions

 Scale ()=default
 Create a scaling that doesn't do anything.
 
 Scale (Point const &p)
 Create a scaling from two scaling factors given as coordinates of a point.
 
 Scale (Coord x, Coord y)
 Create a scaling from two scaling factors.
 
 Scale (Coord s)
 Create an uniform scaling from a single scaling factor.
 
 operator Affine () const
 
Coord operator[] (Dim2 d) const
 
Coord operator[] (unsigned d) const
 
Coordoperator[] (Dim2 d)
 
Coordoperator[] (unsigned d)
 
Scaleoperator*= (Scale const &b)
 
bool operator== (Scale const &o) const
 
Point vector () const
 
Scale inverse () const
 
- Public Member Functions inherited from Geom::TransformOperations< Scale >
Affine operator* (T2 const &t) const
 

Static Public Member Functions

static Scale identity ()
 

Private Attributes

Point vec = { 1, 1 }
 

Friends

class Point
 

Related Symbols

(Note that these are not member symbols.)

template<>
Scale pow (Scale const &s, int n)
 Specialization of exponentiation for Scale.
 

Detailed Description

Scaling from the origin.

During scaling, the point (0,0) will not move. To obtain a scale with a different invariant point, combine with translation to the origin and back.

Definition at line 148 of file transforms.h.

Constructor & Destructor Documentation

◆ Scale() [1/4]

Geom::Scale::Scale ( )
default

Create a scaling that doesn't do anything.

Referenced by inverse().

◆ Scale() [2/4]

Geom::Scale::Scale ( Point const &  p)
inlineexplicit

Create a scaling from two scaling factors given as coordinates of a point.

Definition at line 156 of file transforms.h.

◆ Scale() [3/4]

Geom::Scale::Scale ( Coord  x,
Coord  y 
)
inline

Create a scaling from two scaling factors.

Definition at line 158 of file transforms.h.

◆ Scale() [4/4]

Geom::Scale::Scale ( Coord  s)
inlineexplicit

Create an uniform scaling from a single scaling factor.

Definition at line 160 of file transforms.h.

Member Function Documentation

◆ identity()

static Scale Geom::Scale::identity ( )
inlinestatic

◆ inverse()

◆ operator Affine()

Geom::Scale::operator Affine ( ) const
inline

Definition at line 161 of file transforms.h.

References vec, Geom::X, and Geom::Y.

◆ operator*=()

Scale & Geom::Scale::operator*= ( Scale const &  b)
inline

Definition at line 168 of file transforms.h.

References vec, Geom::X, and Geom::Y.

◆ operator==()

bool Geom::Scale::operator== ( Scale const &  o) const
inline

Definition at line 169 of file transforms.h.

References vec.

◆ operator[]() [1/4]

Coord & Geom::Scale::operator[] ( Dim2  d)
inline

Definition at line 166 of file transforms.h.

References vec.

◆ operator[]() [2/4]

Coord Geom::Scale::operator[] ( Dim2  d) const
inline

Definition at line 163 of file transforms.h.

References vec.

◆ operator[]() [3/4]

Coord & Geom::Scale::operator[] ( unsigned  d)
inline

Definition at line 167 of file transforms.h.

References vec.

◆ operator[]() [4/4]

Coord Geom::Scale::operator[] ( unsigned  d) const
inline

Definition at line 164 of file transforms.h.

References vec.

◆ vector()

Friends And Related Symbol Documentation

◆ Point

friend class Point
friend

Definition at line 175 of file transforms.h.

◆ pow()

Scale pow ( Scale const &  s,
int  n 
)
related

Specialization of exponentiation for Scale.

Definition at line 336 of file transforms.h.

References Geom::X, and Geom::Y.

Member Data Documentation

◆ vec

Point Geom::Scale::vec = { 1, 1 }
private

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