Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
gfxMatrix Class Reference

#include <gfxMatrix.h>

Collaboration diagram for gfxMatrix:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 gfxMatrix ()
 gfxMatrix (const gfxMatrix &m)
 gfxMatrix (gfxFloat a, gfxFloat b, gfxFloat c, gfxFloat d, gfxFloat tx, gfxFloat ty)
 gfxMatrix (const cairo_matrix_t &m)
gfxMatrixoperator= (const cairo_matrix_t &m)
const gfxMatrixoperator*= (const gfxMatrix &m)
gfxMatrix operator* (const gfxMatrix &m)
cairo_matrix_t ToCairoMatrix () const
void ToValues (gfxFloat *xx, gfxFloat *yx, gfxFloat *xy, gfxFloat *yy, gfxFloat *x0, gfxFloat *y0) const
const gfxMatrixReset ()
const gfxMatrixInvert ()
const gfxMatrixScale (gfxFloat x, gfxFloat y)
const gfxMatrixTranslate (const gfxPoint &pt)
const gfxMatrixRotate (gfxFloat radians)
const gfxMatrixMultiply (const gfxMatrix &m)
void TransformDistance (gfxFloat *dx, gfxFloat *dy) const
void TransformPoint (gfxFloat *x, gfxFloat *y) const
gfxSize GetScaling () const
gfxPoint GetTranslation () const
bool HasShear () const

Protected Attributes

cairo_matrix_t mat

Detailed Description

Definition at line 51 of file gfxMatrix.h.


Constructor & Destructor Documentation

gfxMatrix::gfxMatrix ( ) [inline]

Definition at line 56 of file gfxMatrix.h.

{ Reset(); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 57 of file gfxMatrix.h.

: mat(m.mat) {}
gfxMatrix::gfxMatrix ( gfxFloat  a,
gfxFloat  b,
gfxFloat  c,
gfxFloat  d,
gfxFloat  tx,
gfxFloat  ty 
) [inline]

Definition at line 58 of file gfxMatrix.h.

                                                                                        {
        mat.xx = a; mat.yx = b; mat.xy = c; mat.yy = d; mat.x0 = tx; mat.y0 = ty;
    }

Definition at line 62 of file gfxMatrix.h.

                                       {
        mat = m;
    }

Member Function Documentation

gfxSize gfxMatrix::GetScaling ( ) const [inline]

Definition at line 139 of file gfxMatrix.h.

                               {
        return gfxSize(mat.xx, mat.yy);
    }
gfxPoint gfxMatrix::GetTranslation ( ) const [inline]

Definition at line 143 of file gfxMatrix.h.

                                    {
        return gfxPoint(mat.x0, mat.y0);
    }
bool gfxMatrix::HasShear ( ) const [inline]

Definition at line 147 of file gfxMatrix.h.

                          {
        return ((mat.xy != 0.0) || (mat.yx != 0.0));
    }

Definition at line 102 of file gfxMatrix.h.

                              {
        cairo_matrix_invert(&mat);
        return *this;
    }

Definition at line 126 of file gfxMatrix.h.

                                                  {
        cairo_matrix_multiply(&mat, &mat, &m.mat);
        return *this;
    }

Here is the caller graph for this function:

gfxMatrix gfxMatrix::operator* ( const gfxMatrix m) [inline]

Definition at line 75 of file gfxMatrix.h.

                                              {
        return gfxMatrix(*this).Multiply(m);
    }

Here is the call graph for this function:

const gfxMatrix& gfxMatrix::operator*= ( const gfxMatrix m) [inline]

Definition at line 71 of file gfxMatrix.h.

                                                      {
        return Multiply(m);
    }

Here is the call graph for this function:

gfxMatrix& gfxMatrix::operator= ( const cairo_matrix_t m) [inline]

Definition at line 66 of file gfxMatrix.h.

                                                  {
        mat = m;
        return *this;
    }

Definition at line 97 of file gfxMatrix.h.

                             {
        cairo_matrix_init_identity(&mat);
        return *this;
    }

Here is the caller graph for this function:

const gfxMatrix& gfxMatrix::Rotate ( gfxFloat  radians) [inline]

Definition at line 117 of file gfxMatrix.h.

                                              {
        gfxFloat s = sin(radians);
        gfxFloat c = cos(radians);
        gfxMatrix t( c, s,
                    -s, c,
                     0, 0);
        return *this = t.Multiply(*this);
    }

Here is the call graph for this function:

const gfxMatrix& gfxMatrix::Scale ( gfxFloat  x,
gfxFloat  y 
) [inline]

Definition at line 107 of file gfxMatrix.h.

                                                   {
        cairo_matrix_scale(&mat, x, y);
        return *this;
    }

Definition at line 80 of file gfxMatrix.h.

                                         {
        return mat;
    }

Here is the caller graph for this function:

void gfxMatrix::ToValues ( gfxFloat xx,
gfxFloat yx,
gfxFloat xy,
gfxFloat yy,
gfxFloat x0,
gfxFloat y0 
) const [inline]

Definition at line 84 of file gfxMatrix.h.

    {
        *xx = mat.xx;
        *yx = mat.yx;
        *xy = mat.xy;
        *yy = mat.yy;
        *x0 = mat.x0;
        *y0 = mat.y0;
    }
void gfxMatrix::TransformDistance ( gfxFloat dx,
gfxFloat dy 
) const [inline]

Definition at line 131 of file gfxMatrix.h.

void gfxMatrix::TransformPoint ( gfxFloat x,
gfxFloat y 
) const [inline]

Definition at line 135 of file gfxMatrix.h.

Definition at line 112 of file gfxMatrix.h.

                                                   {
        cairo_matrix_translate(&mat, pt.x, pt.y);
        return *this;
    }

Member Data Documentation

Definition at line 53 of file gfxMatrix.h.


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