Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

nr-matrix.h File Reference

Detailed Description

Definition of NRMatrix and NR::Matrix types.

Operator functions (e.g. Matrix * Matrix etc.) are mostly in libnr/nr-matrix-ops.h. See end of file for discussion.
Main authors: Lauris Kaplinski <lauris@kaplinski.com>: Original NRMatrix definition and related macros.

Nathan Hurst <njh@mail.csse.monash.edu.au>: NR::Matrix class version of the above.

This code is in public domain.

Definition in file nr-matrix.h.

#include <glib/gmessages.h>
#include <libnr/nr-macros.h>
#include <libnr/nr-rotate.h>
#include <libnr/nr-scale.h>
#include <libnr/nr-translate.h>

Go to the source code of this file.


namespace  NR


class  NR::Matrix
struct  NRMatrix


#define NR_MATRIX_DF_EXPANSION2(m)   (fabs((*(m))[0] * (*(m))[3] - (*(m))[1] * (*(m))[2]))
#define NR_MATRIX_DF_TRANSFORM_X(m, x, y)   ((*(m))[0] * (x) + (*(m))[2] * (y) + (*(m))[4])
#define NR_MATRIX_DF_TRANSFORM_Y(m, x, y)   ((*(m))[1] * (x) + (*(m))[3] * (y) + (*(m))[5])
#define nr_matrix_set_identity(m)   (*(m) = NR_MATRIX_IDENTITY)
#define nr_matrix_test_equal(m0, m1, e)   ((!(m0) && !(m1)) || ((m0) && (m1) && NR_MATRIX_DF_TEST_CLOSE(m0, m1, e)))
#define nr_matrix_test_identity(m, e)   (!(m) || NR_MATRIX_DF_TEST_CLOSE(m, &NR_MATRIX_IDENTITY, e))
#define nr_matrix_test_transform_equal(m0, m1, e)   ((!(m0) && !(m1)) || ((m0) && (m1) && NR_MATRIX_DF_TEST_TRANSFORM_CLOSE(m0, m1, e)))
#define nr_matrix_test_translate_equal(m0, m1, e)   ((!(m0) && !(m1)) || ((m0) && (m1) && NR_MATRIX_DF_TEST_TRANSLATE_CLOSE(m0, m1, e)))


void NR::assert_close (Matrix const &a, Matrix const &b)
NRMatrixnr_matrix_invert (NRMatrix *d, NRMatrix const *m)
NRMatrixnr_matrix_multiply (NRMatrix *d, NRMatrix const *m0, NRMatrix const *m1)
NRMatrixnr_matrix_set_rotate (NRMatrix *m, NR::Coord const theta)
NRMatrixnr_matrix_set_scale (NRMatrix *m, NR::Coord const sx, NR::Coord const sy)
NRMatrixnr_matrix_set_translate (NRMatrix *m, NR::Coord const x, NR::Coord const y)

Generated by  Doxygen 1.6.0   Back to index