Inkscape
Vector Graphics Editor
|
Combination of a translation and uniform scale. More...
#include <transforms.h>
Public Member Functions | |
Zoom ()=default | |
Zoom (Coord s) | |
Construct a zoom from a scaling factor. | |
Zoom (Point const &t) | |
Construct a zoom from a translation. | |
Zoom (Translate const &t) | |
Zoom (Coord s, Point const &t) | |
Construct a zoom from a scaling factor and a translation. | |
Zoom (Coord s, Translate const &t) | |
operator Affine () const | |
Zoom & | operator*= (Zoom const &z) |
bool | operator== (Zoom const &z) const |
Coord | scale () const |
void | setScale (Coord s) |
Point | translation () const |
void | setTranslation (Point const &p) |
Zoom | inverse () const |
![]() | |
Affine | operator* (T2 const &t) const |
Static Public Member Functions | |
static Zoom | identity () |
static Zoom | map_rect (Rect const &old_r, Rect const &new_r) |
Zoom between rectangles. | |
Private Attributes | |
Coord | _scale = 1 |
Point | _trans |
Friends | |
class | Point |
class | Affine |
Combination of a translation and uniform scale.
The translation part is applied first, then the result is scaled from the new origin. This way when the class is used to accumulate a zoom transform, trans always points to the new origin in original coordinates.
Definition at line 290 of file transforms.h.
|
default |
Referenced by inverse().
|
inlineexplicit |
Construct a zoom from a scaling factor.
Definition at line 298 of file transforms.h.
|
inlineexplicit |
Construct a zoom from a translation.
Definition at line 300 of file transforms.h.
|
inlineexplicit |
Definition at line 301 of file transforms.h.
Construct a zoom from a scaling factor and a translation.
Definition at line 303 of file transforms.h.
Definition at line 304 of file transforms.h.
|
inlinestatic |
Definition at line 321 of file transforms.h.
Referenced by Geom::check_transforms().
|
inline |
Definition at line 320 of file transforms.h.
Zoom between rectangles.
Given two rectangles, compute a zoom that maps one to the other. Rectangles are assumed to have the same aspect ratio.
Definition at line 46 of file transforms.cpp.
References _scale, _trans, Geom::GenericRect< C >::min(), and Geom::GenericRect< C >::width().
|
inline |
Definition at line 309 of file transforms.h.
|
inline |
Definition at line 314 of file transforms.h.
|
inline |
Definition at line 316 of file transforms.h.
References _scale.
Referenced by Geom::are_near(), Geom::Circle::operator*=(), and Geom::Ellipse::operator*=().
|
inline |
Definition at line 317 of file transforms.h.
References _scale.
|
inline |
Definition at line 319 of file transforms.h.
References _trans.
|
inline |
|
friend |
Definition at line 325 of file transforms.h.
Referenced by operator Affine().
|
friend |
Definition at line 324 of file transforms.h.
|
private |
Definition at line 293 of file transforms.h.
Referenced by inverse(), map_rect(), operator Affine(), Geom::Affine::operator*=(), Geom::Point::operator*=(), operator*=(), operator==(), scale(), and setScale().
|
private |
Definition at line 294 of file transforms.h.
Referenced by inverse(), map_rect(), operator Affine(), Geom::Affine::operator*=(), Geom::Point::operator*=(), operator*=(), operator==(), setTranslation(), and translation().