summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2011-02-02 21:24:36 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2011-02-02 21:24:36 +0000
commit53933f5fea9d07d1ba6304b88439fba257ee8c34 (patch)
tree21f94cd05346fc1236751bb1db3e0850e5aece54 /src/extension
parentTranslations. French translation minor update. (diff)
downloadinkscape-53933f5fea9d07d1ba6304b88439fba257ee8c34.tar.gz
inkscape-53933f5fea9d07d1ba6304b88439fba257ee8c34.zip
update to latest 2geom !
(bzr r10025)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/implementation/implementation.cpp8
-rw-r--r--src/extension/implementation/implementation.h8
-rw-r--r--src/extension/internal/cairo-render-context.cpp28
-rw-r--r--src/extension/internal/cairo-render-context.h20
-rw-r--r--src/extension/internal/cairo-renderer-pdf-out.cpp2
-rw-r--r--src/extension/internal/cairo-renderer.cpp46
-rw-r--r--src/extension/internal/emf-win32-print.cpp22
-rw-r--r--src/extension/internal/emf-win32-print.h16
-rw-r--r--src/extension/internal/javafx-out.cpp4
-rw-r--r--src/extension/internal/latex-pstricks.cpp18
-rw-r--r--src/extension/internal/latex-pstricks.h10
-rw-r--r--src/extension/internal/latex-text-renderer.cpp16
-rw-r--r--src/extension/internal/latex-text-renderer.h8
-rw-r--r--src/extension/internal/odf.cpp38
-rw-r--r--src/extension/internal/odf.h2
-rw-r--r--src/extension/internal/pdfinput/svg-builder.cpp16
-rw-r--r--src/extension/internal/pdfinput/svg-builder.h4
-rw-r--r--src/extension/internal/pov-out.cpp2
-rw-r--r--src/extension/internal/win32.cpp2
-rw-r--r--src/extension/internal/win32.h4
-rw-r--r--src/extension/print.cpp8
-rw-r--r--src/extension/print.h8
22 files changed, 145 insertions, 145 deletions
diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp
index a8533a427..b1b671026 100644
--- a/src/extension/implementation/implementation.cpp
+++ b/src/extension/implementation/implementation.cpp
@@ -148,7 +148,7 @@ Implementation::finish(Inkscape::Extension::Print */*module*/)
/* Rendering methods */
unsigned int
-Implementation::bind(Inkscape::Extension::Print */*module*/, Geom::Matrix const */*transform*/, float /*opacity*/)
+Implementation::bind(Inkscape::Extension::Print */*module*/, Geom::Affine const */*transform*/, float /*opacity*/)
{
return 0;
}
@@ -166,14 +166,14 @@ Implementation::comment(Inkscape::Extension::Print */*module*/, char const */*co
}
unsigned int
-Implementation::fill(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, Geom::Matrix const */*ctm*/, SPStyle const */*style*/,
+Implementation::fill(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, Geom::Affine const */*ctm*/, SPStyle const */*style*/,
NRRect const */*pbox*/, NRRect const */*dbox*/, NRRect const */*bbox*/)
{
return 0;
}
unsigned int
-Implementation::stroke(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, Geom::Matrix const */*transform*/, SPStyle const */*style*/,
+Implementation::stroke(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, Geom::Affine const */*transform*/, SPStyle const */*style*/,
NRRect const */*pbox*/, NRRect const */*dbox*/, NRRect const */*bbox*/)
{
return 0;
@@ -181,7 +181,7 @@ Implementation::stroke(Inkscape::Extension::Print */*module*/, Geom::PathVector
unsigned int
Implementation::image(Inkscape::Extension::Print */*module*/, unsigned char */*px*/, unsigned int /*w*/, unsigned int /*h*/, unsigned int /*rs*/,
- Geom::Matrix const */*transform*/, SPStyle const */*style*/)
+ Geom::Affine const */*transform*/, SPStyle const */*style*/)
{
return 0;
}
diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h
index 9de70dce7..bf584b401 100644
--- a/src/extension/implementation/implementation.h
+++ b/src/extension/implementation/implementation.h
@@ -100,20 +100,20 @@ public:
/* ----- Rendering methods ----- */
virtual unsigned bind(Inkscape::Extension::Print *module,
- Geom::Matrix const *transform,
+ Geom::Affine const *transform,
float opacity);
virtual unsigned release(Inkscape::Extension::Print *module);
virtual unsigned comment(Inkscape::Extension::Print *module, const char * comment);
virtual unsigned fill(Inkscape::Extension::Print *module,
Geom::PathVector const &pathv,
- Geom::Matrix const *ctm,
+ Geom::Affine const *ctm,
SPStyle const *style,
NRRect const *pbox,
NRRect const *dbox,
NRRect const *bbox);
virtual unsigned stroke(Inkscape::Extension::Print *module,
Geom::PathVector const &pathv,
- Geom::Matrix const *transform,
+ Geom::Affine const *transform,
SPStyle const *style,
NRRect const *pbox,
NRRect const *dbox,
@@ -123,7 +123,7 @@ public:
unsigned int w,
unsigned int h,
unsigned int rs,
- Geom::Matrix const *transform,
+ Geom::Affine const *transform,
SPStyle const *style);
virtual unsigned text(Inkscape::Extension::Print *module,
char const *text,
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index b68105b30..cfbceab05 100644
--- a/src/extension/internal/cairo-render-context.cpp
+++ b/src/extension/internal/cairo-render-context.cpp
@@ -626,7 +626,7 @@ CairoRenderContext::popLayer(void)
// copy over the correct CTM
// It must be stored in item_transform of current state after pushState.
- Geom::Matrix item_transform;
+ Geom::Affine item_transform;
if (_state->parent_has_userspace)
item_transform = getParentState()->transform * _state->item_transform;
else
@@ -908,7 +908,7 @@ CairoRenderContext::finish(void)
}
void
-CairoRenderContext::transform(Geom::Matrix const *transform)
+CairoRenderContext::transform(Geom::Affine const *transform)
{
g_assert( _is_valid );
@@ -921,7 +921,7 @@ CairoRenderContext::transform(Geom::Matrix const *transform)
}
void
-CairoRenderContext::setTransform(Geom::Matrix const *transform)
+CairoRenderContext::setTransform(Geom::Affine const *transform)
{
g_assert( _is_valid );
@@ -932,7 +932,7 @@ CairoRenderContext::setTransform(Geom::Matrix const *transform)
}
void
-CairoRenderContext::getTransform(Geom::Matrix *copy) const
+CairoRenderContext::getTransform(Geom::Affine *copy) const
{
g_assert( _is_valid );
@@ -947,12 +947,12 @@ CairoRenderContext::getTransform(Geom::Matrix *copy) const
}
void
-CairoRenderContext::getParentTransform(Geom::Matrix *copy) const
+CairoRenderContext::getParentTransform(Geom::Affine *copy) const
{
g_assert( _is_valid );
CairoRenderState *parent_state = getParentState();
- memcpy(copy, &parent_state->transform, sizeof(Geom::Matrix));
+ memcpy(copy, &parent_state->transform, sizeof(Geom::Affine));
}
void
@@ -1001,7 +1001,7 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
SPPattern *pat = SP_PATTERN (paintserver);
- Geom::Matrix ps2user, pcs2dev;
+ Geom::Affine ps2user, pcs2dev;
ps2user = Geom::identity();
pcs2dev = Geom::identity();
@@ -1015,7 +1015,7 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
TRACE(("%f x %f pattern\n", width, height));
if (pbox && pattern_patternUnits(pat) == SP_PATTERN_UNITS_OBJECTBOUNDINGBOX) {
- //Geom::Matrix bbox2user (pbox->x1 - pbox->x0, 0.0, 0.0, pbox->y1 - pbox->y0, pbox->x0, pbox->y0);
+ //Geom::Affine bbox2user (pbox->x1 - pbox->x0, 0.0, 0.0, pbox->y1 - pbox->y0, pbox->x0, pbox->y0);
bbox_width_scaler = pbox->x1 - pbox->x0;
bbox_height_scaler = pbox->y1 - pbox->y0;
ps2user[4] = x * bbox_width_scaler + pbox->x0;
@@ -1028,7 +1028,7 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
}
// apply pattern transformation
- Geom::Matrix pattern_transform(pattern_patternTransform(pat));
+ Geom::Affine pattern_transform(pattern_patternTransform(pat));
ps2user *= pattern_transform;
Geom::Point ori (ps2user[4], ps2user[5]);
@@ -1150,7 +1150,7 @@ CairoRenderContext::_createPatternForPaintServer(SPPaintServer const *const pain
Geom::Point p2 (lg->x2.computed, lg->y2.computed);
if (pbox && SP_GRADIENT(lg)->getUnits() == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX) {
// convert to userspace
- Geom::Matrix bbox2user(pbox->x1 - pbox->x0, 0, 0, pbox->y1 - pbox->y0, pbox->x0, pbox->y0);
+ Geom::Affine bbox2user(pbox->x1 - pbox->x0, 0, 0, pbox->y1 - pbox->y0, pbox->x0, pbox->y0);
p1 *= bbox2user;
p2 *= bbox2user;
}
@@ -1413,7 +1413,7 @@ CairoRenderContext::renderPathVector(Geom::PathVector const & pathv, SPStyle con
bool
CairoRenderContext::renderImage(guchar *px, unsigned int w, unsigned int h, unsigned int rs,
- Geom::Matrix const *image_transform, SPStyle const *style)
+ Geom::Affine const *image_transform, SPStyle const *style)
{
g_assert( _is_valid );
@@ -1550,7 +1550,7 @@ CairoRenderContext::_showGlyphs(cairo_t *cr, PangoFont *font, std::vector<CairoG
}
bool
-CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Matrix const *font_matrix,
+CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Affine const *font_matrix,
std::vector<CairoGlyphInfo> const &glyphtext, SPStyle const *style)
{
// create a cairo_font_face from PangoFont
@@ -1668,7 +1668,7 @@ CairoRenderContext::_concatTransform(cairo_t *cr, double xx, double yx, double x
}
void
-CairoRenderContext::_initCairoMatrix(cairo_matrix_t *matrix, Geom::Matrix const *transform)
+CairoRenderContext::_initCairoMatrix(cairo_matrix_t *matrix, Geom::Affine const *transform)
{
matrix->xx = (*transform)[0];
matrix->yx = (*transform)[1];
@@ -1679,7 +1679,7 @@ CairoRenderContext::_initCairoMatrix(cairo_matrix_t *matrix, Geom::Matrix const
}
void
-CairoRenderContext::_concatTransform(cairo_t *cr, Geom::Matrix const *transform)
+CairoRenderContext::_concatTransform(cairo_t *cr, Geom::Affine const *transform)
{
_concatTransform(cr, (*transform)[0], (*transform)[1],
(*transform)[2], (*transform)[3],
diff --git a/src/extension/internal/cairo-render-context.h b/src/extension/internal/cairo-render-context.h
index 73ee585ce..d663a82fd 100644
--- a/src/extension/internal/cairo-render-context.h
+++ b/src/extension/internal/cairo-render-context.h
@@ -53,12 +53,12 @@ struct CairoRenderState {
unsigned int parent_has_userspace : 1; // whether the parent's ctm should be applied
float opacity;
bool has_filtereffect;
- Geom::Matrix item_transform; // this item's item->transform, for correct clipping
+ Geom::Affine item_transform; // this item's item->transform, for correct clipping
SPClipPath *clip_path;
SPMask* mask;
- Geom::Matrix transform; // the CTM
+ Geom::Affine transform; // the CTM
};
class CairoRenderContext {
@@ -127,10 +127,10 @@ public:
CairoRenderState *getParentState(void) const;
void setStateForStyle(SPStyle const *style);
- void transform(Geom::Matrix const *transform);
- void setTransform(Geom::Matrix const *transform);
- void getTransform(Geom::Matrix *copy) const;
- void getParentTransform(Geom::Matrix *copy) const;
+ void transform(Geom::Affine const *transform);
+ void setTransform(Geom::Affine const *transform);
+ void getTransform(Geom::Affine *copy) const;
+ void getParentTransform(Geom::Affine *copy) const;
/* Clipping methods */
void addClipPath(Geom::PathVector const &pv, SPIEnum const *fill_rule);
@@ -139,8 +139,8 @@ public:
/* Rendering methods */
bool renderPathVector(Geom::PathVector const & pathv, SPStyle const *style, NRRect const *pbox);
bool renderImage(unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
- Geom::Matrix const *image_transform, SPStyle const *style);
- bool renderGlyphtext(PangoFont *font, Geom::Matrix const *font_matrix,
+ Geom::Affine const *image_transform, SPStyle const *style);
+ bool renderGlyphtext(PangoFont *font, Geom::Affine const *font_matrix,
std::vector<CairoGlyphInfo> const &glyphtext, SPStyle const *style);
/* More general rendering methods will have to be added (like fill, stroke) */
@@ -191,9 +191,9 @@ protected:
void _setFillStyle(SPStyle const *style, NRRect const *pbox);
void _setStrokeStyle(SPStyle const *style, NRRect const *pbox);
- void _initCairoMatrix(cairo_matrix_t *matrix, Geom::Matrix const *transform);
+ void _initCairoMatrix(cairo_matrix_t *matrix, Geom::Affine const *transform);
void _concatTransform(cairo_t *cr, double xx, double yx, double xy, double yy, double x0, double y0);
- void _concatTransform(cairo_t *cr, Geom::Matrix const *transform);
+ void _concatTransform(cairo_t *cr, Geom::Affine const *transform);
GHashTable *font_table;
static void font_data_free(gpointer data);
diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp
index 8406e2a3b..6527a646b 100644
--- a/src/extension/internal/cairo-renderer-pdf-out.cpp
+++ b/src/extension/internal/cairo-renderer-pdf-out.cpp
@@ -37,7 +37,7 @@
#include "sp-item.h"
#include "sp-root.h"
-#include <2geom/matrix.h>
+#include <2geom/affine.h>
namespace Inkscape {
namespace Extension {
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index bc3c6c484..015b3b2cb 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -157,7 +157,7 @@ static void sp_image_render(SPItem *item, CairoRenderContext *ctx);
static void sp_symbol_render(SPItem *item, CairoRenderContext *ctx);
static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx);
-static void sp_shape_render_invoke_marker_rendering(SPMarker* marker, Geom::Matrix tr, SPStyle* style, CairoRenderContext *ctx)
+static void sp_shape_render_invoke_marker_rendering(SPMarker* marker, Geom::Affine tr, SPStyle* style, CairoRenderContext *ctx)
{
bool render = true;
if (marker->markerUnits == SP_MARKER_UNITS_STROKEWIDTH) {
@@ -170,8 +170,8 @@ static void sp_shape_render_invoke_marker_rendering(SPMarker* marker, Geom::Matr
if (render) {
SPItem* marker_item = sp_item_first_item_child (SP_OBJECT (marker));
- tr = (Geom::Matrix)marker_item->transform * (Geom::Matrix)marker->c2p * tr;
- Geom::Matrix old_tr = marker_item->transform;
+ tr = (Geom::Affine)marker_item->transform * (Geom::Affine)marker->c2p * tr;
+ Geom::Affine old_tr = marker_item->transform;
marker_item->transform = tr;
ctx->getRenderer()->renderItem (ctx, marker_item);
marker_item->transform = old_tr;
@@ -199,7 +199,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
for (int i = 0; i < 2; i++) { // SP_MARKER_LOC and SP_MARKER_LOC_START
if ( shape->marker[i] ) {
SPMarker* marker = SP_MARKER (shape->marker[i]);
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform_at_start(pathv.begin()->front());
} else {
@@ -217,7 +217,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
if ( path_it != pathv.begin()
&& ! ((path_it == (pathv.end()-1)) && (path_it->size_default() == 0)) ) // if this is the last path and it is a moveto-only, there is no mid marker there
{
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform_at_start(path_it->front());
} else {
@@ -234,7 +234,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
/* Put marker between curve_it1 and curve_it2.
* Loop to end_default (so including closing segment), because when a path is closed,
* there should be a midpoint marker between last segment and closing straight line segment */
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform(*curve_it1, *curve_it2);
} else {
@@ -250,7 +250,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
// END position
if ( path_it != (pathv.end()-1) && !path_it->empty()) {
Geom::Curve const &lastcurve = path_it->back_default();
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
@@ -274,7 +274,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
}
Geom::Curve const &lastcurve = path_last[index];
- Geom::Matrix tr;
+ Geom::Affine tr;
if (marker->orient_auto) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
@@ -309,7 +309,7 @@ static void sp_use_render(SPItem *item, CairoRenderContext *ctx)
CairoRenderer *renderer = ctx->getRenderer();
if ((use->x._set && use->x.computed != 0) || (use->y._set && use->y.computed != 0)) {
- Geom::Matrix tp(Geom::Translate(use->x.computed, use->y.computed));
+ Geom::Affine tp(Geom::Translate(use->x.computed, use->y.computed));
ctx->pushState();
ctx->transform(&tp);
translated = true;
@@ -368,7 +368,7 @@ static void sp_image_render(SPItem *item, CairoRenderContext *ctx)
Geom::Translate tp(x, y);
Geom::Scale s(width / (double)w, height / (double)h);
- Geom::Matrix t(s * tp);
+ Geom::Affine t(s * tp);
ctx->renderImage (px, w, h, rs, &t, SP_OBJECT_STYLE (item));
}
@@ -385,7 +385,7 @@ static void sp_symbol_render(SPItem *item, CairoRenderContext *ctx)
// apply viewbox if set
if (0 /*symbol->viewBox_set*/) {
- Geom::Matrix vb2user;
+ Geom::Affine vb2user;
double x, y, width, height;
double view_width, view_height;
x = 0.0;
@@ -423,7 +423,7 @@ static void sp_root_render(SPItem *item, CairoRenderContext *ctx)
ctx->pushState();
renderer->setStateForItem(ctx, item);
- Geom::Matrix tempmat (root->c2p);
+ Geom::Affine tempmat (root->c2p);
ctx->transform(&tempmat);
sp_group_render(item, ctx);
ctx->popState();
@@ -492,12 +492,12 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
// Calculate the matrix that will be applied to the image so that it exactly overlaps the source objects
// Matix to put bitmap in correct place on document
- Geom::Matrix t_on_document = (Geom::Matrix)(Geom::Scale (scale_x, -scale_y)) *
- (Geom::Matrix)(Geom::Translate (shift_x, shift_y));
+ Geom::Affine t_on_document = (Geom::Affine)(Geom::Scale (scale_x, -scale_y)) *
+ (Geom::Affine)(Geom::Translate (shift_x, shift_y));
// ctx matrix already includes item transformation. We must substract.
- Geom::Matrix t_item = item->i2d_affine ();
- Geom::Matrix t = t_on_document * t_item.inverse();
+ Geom::Affine t_item = item->i2d_affine ();
+ Geom::Affine t = t_on_document * t_item.inverse();
// Do the export
SPDocument *document = SP_OBJECT(item)->document;
@@ -570,7 +570,7 @@ CairoRenderer::setStateForItem(CairoRenderContext *ctx, SPItem const *item)
CairoRenderState *state = ctx->getCurrentState();
state->clip_path = item->clip_ref->getObject();
state->mask = item->mask_ref->getObject();
- state->item_transform = Geom::Matrix (item->transform);
+ state->item_transform = Geom::Affine (item->transform);
// If parent_has_userspace is true the parent state's transform
// has to be used for the mask's/clippath's context.
@@ -601,7 +601,7 @@ CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item)
state->merge_opacity = FALSE;
ctx->pushLayer();
}
- Geom::Matrix tempmat (item->transform);
+ Geom::Affine tempmat (item->transform);
ctx->transform(&tempmat);
sp_item_invoke_render(item, ctx);
@@ -652,7 +652,7 @@ CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool page
if (ctx->_vector_based_target)
high *= PT_PER_PX;
- Geom::Matrix tp(Geom::Translate(-d.x0 * (ctx->_vector_based_target ? PX_PER_PT : 1.0),
+ Geom::Affine tp(Geom::Translate(-d.x0 * (ctx->_vector_based_target ? PX_PER_PT : 1.0),
(d.y1 - high) * (ctx->_vector_based_target ? PX_PER_PT : 1.0)));
ctx->transform(&tp);
}
@@ -674,11 +674,11 @@ CairoRenderer::applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp)
CairoRenderContext::CairoRenderMode saved_mode = ctx->getRenderMode();
ctx->setRenderMode(CairoRenderContext::RENDER_MODE_CLIP);
- Geom::Matrix saved_ctm;
+ Geom::Affine saved_ctm;
if (cp->clipPathUnits == SP_CONTENT_UNITS_OBJECTBOUNDINGBOX) {
//SP_PRINT_DRECT("clipd", cp->display->bbox);
NRRect clip_bbox(cp->display->bbox);
- Geom::Matrix t(Geom::Scale(clip_bbox.x1 - clip_bbox.x0, clip_bbox.y1 - clip_bbox.y0));
+ Geom::Affine t(Geom::Scale(clip_bbox.x1 - clip_bbox.x0, clip_bbox.y1 - clip_bbox.y0));
t[4] = clip_bbox.x0;
t[5] = clip_bbox.y0;
t *= ctx->getCurrentState()->transform;
@@ -693,7 +693,7 @@ CairoRenderer::applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp)
SPItem *item = SP_ITEM(child);
// combine transform of the item in clippath and the item using clippath:
- Geom::Matrix tempmat (item->transform);
+ Geom::Affine tempmat (item->transform);
tempmat = tempmat * (ctx->getCurrentState()->item_transform);
// render this item in clippath
@@ -730,7 +730,7 @@ CairoRenderer::applyMask(CairoRenderContext *ctx, SPMask const *mask)
NRRect mask_bbox(mask->display->bbox);
// TODO: should the bbox be transformed if maskUnits != userSpaceOnUse ?
if (mask->maskContentUnits == SP_CONTENT_UNITS_OBJECTBOUNDINGBOX) {
- Geom::Matrix t(Geom::Scale(mask_bbox.x1 - mask_bbox.x0, mask_bbox.y1 - mask_bbox.y0));
+ Geom::Affine t(Geom::Scale(mask_bbox.x1 - mask_bbox.x0, mask_bbox.y1 - mask_bbox.y0));
t[4] = mask_bbox.x0;
t[5] = mask_bbox.y0;
t *= ctx->getCurrentState()->transform;
diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp
index e1ef77ae5..503a13d09 100644
--- a/src/extension/internal/emf-win32-print.cpp
+++ b/src/extension/internal/emf-win32-print.cpp
@@ -310,7 +310,7 @@ PrintEmfWin32::destroy_brush()
void
-PrintEmfWin32::create_pen(SPStyle const *style, const Geom::Matrix &transform)
+PrintEmfWin32::create_pen(SPStyle const *style, const Geom::Affine &transform)
{
if (style) {
float rgb[3];
@@ -459,12 +459,12 @@ PrintEmfWin32::flush_fill()
}
unsigned int
-PrintEmfWin32::bind(Inkscape::Extension::Print * /*mod*/, Geom::Matrix const *transform, float /*opacity*/)
+PrintEmfWin32::bind(Inkscape::Extension::Print * /*mod*/, Geom::Affine const *transform, float /*opacity*/)
{
- Geom::Matrix tr = *transform;
+ Geom::Affine tr = *transform;
if (m_tr_stack.size()) {
- Geom::Matrix tr_top = m_tr_stack.top();
+ Geom::Affine tr_top = m_tr_stack.top();
m_tr_stack.push(tr * tr_top);
} else {
m_tr_stack.push(tr);
@@ -482,12 +482,12 @@ PrintEmfWin32::release(Inkscape::Extension::Print * /*mod*/)
unsigned int
PrintEmfWin32::fill(Inkscape::Extension::Print * /*mod*/,
- Geom::PathVector const &pathv, Geom::Matrix const * /*transform*/, SPStyle const *style,
+ Geom::PathVector const &pathv, Geom::Affine const * /*transform*/, SPStyle const *style,
NRRect const * /*pbox*/, NRRect const * /*dbox*/, NRRect const * /*bbox*/)
{
if (!hdc) return 0;
- Geom::Matrix tf = m_tr_stack.top();
+ Geom::Affine tf = m_tr_stack.top();
flush_fill(); // flush any pending fills
@@ -511,12 +511,12 @@ PrintEmfWin32::fill(Inkscape::Extension::Print * /*mod*/,
unsigned int
PrintEmfWin32::stroke (Inkscape::Extension::Print * /*mod*/,
- Geom::PathVector const &pathv, const Geom::Matrix * /*transform*/, const SPStyle *style,
+ Geom::PathVector const &pathv, const Geom::Affine * /*transform*/, const SPStyle *style,
const NRRect * /*pbox*/, const NRRect * /*dbox*/, const NRRect * /*bbox*/)
{
if (!hdc) return 0;
- Geom::Matrix tf = m_tr_stack.top();
+ Geom::Affine tf = m_tr_stack.top();
stroke_and_fill = ( pathv == fill_pathv );
@@ -550,7 +550,7 @@ PrintEmfWin32::stroke (Inkscape::Extension::Print * /*mod*/,
bool
-PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom::Matrix &transform)
+PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom::Affine &transform)
{
Geom::PathVector pv = pathv_to_linear_and_cubic_beziers( pathv * transform );
@@ -746,7 +746,7 @@ PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom::Mat
}
unsigned int
-PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geom::Matrix &transform)
+PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geom::Affine &transform)
{
simple_shape = print_simple_shape(pathv, transform);
@@ -863,7 +863,7 @@ PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char const *text, Geom
if (!hdc) return 0;
HFONT hfont = NULL;
- Geom::Matrix tf = m_tr_stack.top();
+ Geom::Affine tf = m_tr_stack.top();
double rot = 1800.0*std::atan2(tf[1], tf[0])/M_PI; // 0.1 degree rotation
#ifdef USE_PANGO_WIN32
diff --git a/src/extension/internal/emf-win32-print.h b/src/extension/internal/emf-win32-print.h
index a0f26abb5..a9f639bcd 100644
--- a/src/extension/internal/emf-win32-print.h
+++ b/src/extension/internal/emf-win32-print.h
@@ -38,15 +38,15 @@ class PrintEmfWin32 : public Inkscape::Extension::Implementation::Implementation
HBRUSH hbrush, hbrushOld;
HPEN hpen, hpenOld;
- std::stack<Geom::Matrix> m_tr_stack;
+ std::stack<Geom::Affine> m_tr_stack;
Geom::PathVector fill_pathv;
- Geom::Matrix fill_transform;
+ Geom::Affine fill_transform;
bool stroke_and_fill;
bool fill_only;
bool simple_shape;
- unsigned int print_pathv (Geom::PathVector const &pathv, const Geom::Matrix &transform);
- bool print_simple_shape (Geom::PathVector const &pathv, const Geom::Matrix &transform);
+ unsigned int print_pathv (Geom::PathVector const &pathv, const Geom::Affine &transform);
+ bool print_simple_shape (Geom::PathVector const &pathv, const Geom::Affine &transform);
public:
PrintEmfWin32 (void);
@@ -59,13 +59,13 @@ public:
virtual unsigned int finish (Inkscape::Extension::Print * module);
/* Rendering methods */
- virtual unsigned int bind(Inkscape::Extension::Print *module, Geom::Matrix const *transform, float opacity);
+ virtual unsigned int bind(Inkscape::Extension::Print *module, Geom::Affine const *transform, float opacity);
virtual unsigned int release(Inkscape::Extension::Print *module);
virtual unsigned int fill (Inkscape::Extension::Print * module,
- Geom::PathVector const &pathv, const Geom::Matrix *ctm, const SPStyle *style,
+ Geom::PathVector const &pathv, const Geom::Affine *ctm, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);
virtual unsigned int stroke (Inkscape::Extension::Print * module,
- Geom::PathVector const &pathv, const Geom::Matrix *transform, const SPStyle *style,
+ Geom::PathVector const &pathv, const Geom::Affine *transform, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);
virtual unsigned int comment(Inkscape::Extension::Print *module, const char * comment);
virtual unsigned int text(Inkscape::Extension::Print *module, char const *text,
@@ -79,7 +79,7 @@ protected:
void destroy_brush();
- void create_pen(SPStyle const *style, const Geom::Matrix &transform);
+ void create_pen(SPStyle const *style, const Geom::Affine &transform);
void destroy_pen();
diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp
index 7098027c7..5902c3ad0 100644
--- a/src/extension/internal/javafx-out.cpp
+++ b/src/extension/internal/javafx-out.cpp
@@ -494,7 +494,7 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id)
// convert the path to only lineto's and cubic curveto's:
Geom::Scale yflip(1.0, -1.0);
- Geom::Matrix tf = item->i2d_affine() * yflip;
+ Geom::Affine tf = item->i2d_affine() * yflip;
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf );
//Count the NR_CURVETOs/LINETOs (including closing line segment)
@@ -636,7 +636,7 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id)
// convert the path to only lineto's and cubic curveto's:
Geom::Scale yflip(1.0, -1.0);
- Geom::Matrix tf = item->i2d_affine() * yflip;
+ Geom::Affine tf = item->i2d_affine() * yflip;
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf );
//Count the NR_CURVETOs/LINETOs (including closing line segment)
diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp
index 44b64c5f8..e09e7c024 100644
--- a/src/extension/internal/latex-pstricks.cpp
+++ b/src/extension/internal/latex-pstricks.cpp
@@ -164,12 +164,12 @@ PrintLatex::finish (Inkscape::Extension::Print *mod)
}
unsigned int
-PrintLatex::bind(Inkscape::Extension::Print *mod, Geom::Matrix const *transform, float opacity)
+PrintLatex::bind(Inkscape::Extension::Print *mod, Geom::Affine const *transform, float opacity)
{
- Geom::Matrix tr = *transform;
+ Geom::Affine tr = *transform;
if(m_tr_stack.size()){
- Geom::Matrix tr_top = m_tr_stack.top();
+ Geom::Affine tr_top = m_tr_stack.top();
m_tr_stack.push(tr * tr_top);
}else
m_tr_stack.push(tr);
@@ -194,7 +194,7 @@ unsigned int PrintLatex::comment (Inkscape::Extension::Print * module,
unsigned int
PrintLatex::fill(Inkscape::Extension::Print *mod,
- Geom::PathVector const &pathv, Geom::Matrix const *transform, SPStyle const *style,
+ Geom::PathVector const &pathv, Geom::Affine const *transform, SPStyle const *style,
NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
{
if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned.
@@ -227,7 +227,7 @@ PrintLatex::fill(Inkscape::Extension::Print *mod,
}
unsigned int
-PrintLatex::stroke (Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, const Geom::Matrix *transform, const SPStyle *style,
+PrintLatex::stroke (Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, const Geom::Affine *transform, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox)
{
if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned.
@@ -236,7 +236,7 @@ PrintLatex::stroke (Inkscape::Extension::Print *mod, Geom::PathVector const &pat
Inkscape::SVGOStringStream os;
float rgb[3];
float stroke_opacity;
- Geom::Matrix tr_stack = m_tr_stack.top();
+ Geom::Affine tr_stack = m_tr_stack.top();
double const scale = tr_stack.descrim();
os.setf(std::ios::fixed);
@@ -277,13 +277,13 @@ PrintLatex::stroke (Inkscape::Extension::Print *mod, Geom::PathVector const &pat
// FIXME: why is 'transform' argument not used?
void
-PrintLatex::print_pathvector(SVGOStringStream &os, Geom::PathVector const &pathv_in, const Geom::Matrix * /*transform*/)
+PrintLatex::print_pathvector(SVGOStringStream &os, Geom::PathVector const &pathv_in, const Geom::Affine * /*transform*/)
{
if (pathv_in.empty())
return;
-// Geom::Matrix tf=*transform; // why was this here?
- Geom::Matrix tf_stack=m_tr_stack.top(); // and why is transform argument not used?
+// Geom::Affine tf=*transform; // why was this here?
+ Geom::Affine tf_stack=m_tr_stack.top(); // and why is transform argument not used?
Geom::PathVector pathv = pathv_in * tf_stack; // generates new path, which is a bit slow, but this doesn't have to be performance optimized
os << "\\newpath\n";
diff --git a/src/extension/internal/latex-pstricks.h b/src/extension/internal/latex-pstricks.h
index a33e169e8..64b0de474 100644
--- a/src/extension/internal/latex-pstricks.h
+++ b/src/extension/internal/latex-pstricks.h
@@ -31,9 +31,9 @@ class PrintLatex : public Inkscape::Extension::Implementation::Implementation {
float _height;
FILE * _stream;
- std::stack<Geom::Matrix> m_tr_stack;
+ std::stack<Geom::Affine> m_tr_stack;
- void print_pathvector(SVGOStringStream &os, Geom::PathVector const &pathv_in, const Geom::Matrix * /*transform*/);
+ void print_pathvector(SVGOStringStream &os, Geom::PathVector const &pathv_in, const Geom::Affine * /*transform*/);
void print_2geomcurve(SVGOStringStream &os, Geom::Curve const & c );
public:
@@ -47,12 +47,12 @@ public:
virtual unsigned int finish (Inkscape::Extension::Print * module);
/* Rendering methods */
- virtual unsigned int bind(Inkscape::Extension::Print *module, Geom::Matrix const *transform, float opacity);
+ virtual unsigned int bind(Inkscape::Extension::Print *module, Geom::Affine const *transform, float opacity);
virtual unsigned int release(Inkscape::Extension::Print *module);
- virtual unsigned int fill (Inkscape::Extension::Print * module, Geom::PathVector const &pathv, const Geom::Matrix *ctm, const SPStyle *style,
+ virtual unsigned int fill (Inkscape::Extension::Print * module, Geom::PathVector const &pathv, const Geom::Affine *ctm, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);
- virtual unsigned int stroke (Inkscape::Extension::Print * module, Geom::PathVector const &pathv, const Geom::Matrix *transform, const SPStyle *style,
+ virtual unsigned int stroke (Inkscape::Extension::Print * module, Geom::PathVector const &pathv, const Geom::Affine *transform, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox);
virtual unsigned int comment(Inkscape::Extension::Print *module, const char * comment);
bool textToPath (Inkscape::Extension::Print * ext);
diff --git a/src/extension/internal/latex-text-renderer.cpp b/src/extension/internal/latex-text-renderer.cpp
index fd99afe31..3c4bb5c92 100644
--- a/src/extension/internal/latex-text-renderer.cpp
+++ b/src/extension/internal/latex-text-renderer.cpp
@@ -246,7 +246,7 @@ LaTeXTextRenderer::sp_use_render(SPItem *item)
SPUse *use = SP_USE(item);
if ((use->x._set && use->x.computed != 0) || (use->y._set && use->y.computed != 0)) {
- Geom::Matrix tp(Geom::Translate(use->x.computed, use->y.computed));
+ Geom::Affine tp(Geom::Translate(use->x.computed, use->y.computed));
push_transform(tp);
translated = true;
}
@@ -311,8 +311,8 @@ LaTeXTextRenderer::sp_text_render(SPItem *item)
}
// get rotation
- Geom::Matrix i2doc = item->i2doc_affine();
- Geom::Matrix wotransl = i2doc.without_translation();
+ Geom::Affine i2doc = item->i2doc_affine();
+ Geom::Affine wotransl = i2doc.withoutTranslation();
double degrees = -180/M_PI * Geom::atan2(wotransl.xAxis());
bool has_rotation = !Geom::are_near(degrees,0.);
@@ -412,8 +412,8 @@ Flowing in rectangle is possible, not in arb shape.
}
// get rotation
- Geom::Matrix i2doc = item->i2doc_affine();
- Geom::Matrix wotransl = i2doc.without_translation();
+ Geom::Affine i2doc = item->i2doc_affine();
+ Geom::Affine wotransl = i2doc.withoutTranslation();
double degrees = -180/M_PI * Geom::atan2(wotransl.xAxis());
bool has_rotation = !Geom::are_near(degrees,0.);
@@ -543,17 +543,17 @@ LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *
return true;
}
-Geom::Matrix const &
+Geom::Affine const &
LaTeXTextRenderer::transform()
{
return _transform_stack.top();
}
void
-LaTeXTextRenderer::push_transform(Geom::Matrix const &tr)
+LaTeXTextRenderer::push_transform(Geom::Affine const &tr)
{
if(_transform_stack.size()){
- Geom::Matrix tr_top = _transform_stack.top();
+ Geom::Affine tr_top = _transform_stack.top();
_transform_stack.push(tr * tr_top);
} else {
_transform_stack.push(tr);
diff --git a/src/extension/internal/latex-text-renderer.h b/src/extension/internal/latex-text-renderer.h
index e4bbd94ed..2259427d6 100644
--- a/src/extension/internal/latex-text-renderer.h
+++ b/src/extension/internal/latex-text-renderer.h
@@ -18,7 +18,7 @@
#endif
#include "extension/extension.h"
-#include <2geom/matrix.h>
+#include <2geom/affine.h>
#include <stack>
class SPItem;
@@ -51,10 +51,10 @@ protected:
bool _pdflatex; /** true if ouputting for pdfLaTeX*/
- void push_transform(Geom::Matrix const &transform);
- Geom::Matrix const & transform();
+ void push_transform(Geom::Affine const &transform);
+ Geom::Affine const & transform();
void pop_transform();
- std::stack<Geom::Matrix> _transform_stack;
+ std::stack<Geom::Affine> _transform_stack;
void writePreamble();
void writePostamble();
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index b5c842a40..6a350ab48 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -259,7 +259,7 @@ private:
* NOTE:
* This class is ported almost verbatim from the public domain
* JAMA Matrix package. It is modified to handle only 3x3 matrices
- * and our Geom::Matrix affine transform class. We give full
+ * and our Geom::Affine affine transform class. We give full
* attribution to them, along with many thanks. JAMA can be found at:
* http://math.nist.gov/javanumerics/jama
*
@@ -921,7 +921,7 @@ static Glib::ustring getExtension(const Glib::ustring &fname)
}
-static Glib::ustring formatTransform(Geom::Matrix &tf)
+static Glib::ustring formatTransform(Geom::Affine &tf)
{
Glib::ustring str;
if (!tf.isIdentity())
@@ -943,16 +943,16 @@ static Glib::ustring formatTransform(Geom::Matrix &tf)
* Get the general transform from SVG pixels to
* ODF cm
*/
-static Geom::Matrix getODFTransform(const SPItem *item)
+static Geom::Affine getODFTransform(const SPItem *item)
{
//### Get SVG-to-ODF transform
- Geom::Matrix tf (item->i2d_affine());
+ Geom::Affine tf (item->i2d_affine());
//Flip Y into document coordinates
double doc_height = SP_ACTIVE_DOCUMENT->getHeight();
- Geom::Matrix doc2dt_tf = Geom::Matrix(Geom::Scale(1.0, -1.0));
- doc2dt_tf = doc2dt_tf * Geom::Matrix(Geom::Translate(0, doc_height));
+ Geom::Affine doc2dt_tf = Geom::Affine(Geom::Scale(1.0, -1.0));
+ doc2dt_tf = doc2dt_tf * Geom::Affine(Geom::Translate(0, doc_height));
tf = tf * doc2dt_tf;
- tf = tf * Geom::Matrix(Geom::Scale(pxToCm));
+ tf = tf * Geom::Affine(Geom::Scale(pxToCm));
return tf;
}
@@ -970,10 +970,10 @@ static Geom::OptRect getODFBoundingBox(const SPItem *item)
if (bbox_temp) {
bbox = *bbox_temp;
double doc_height = SP_ACTIVE_DOCUMENT->getHeight();
- Geom::Matrix doc2dt_tf = Geom::Matrix(Geom::Scale(1.0, -1.0));
- doc2dt_tf = doc2dt_tf * Geom::Matrix(Geom::Translate(0, doc_height));
+ Geom::Affine doc2dt_tf = Geom::Affine(Geom::Scale(1.0, -1.0));
+ doc2dt_tf = doc2dt_tf * Geom::Affine(Geom::Translate(0, doc_height));
bbox = *bbox * doc2dt_tf;
- bbox = *bbox * Geom::Matrix(Geom::Scale(pxToCm));
+ bbox = *bbox * Geom::Affine(Geom::Scale(pxToCm));
}
return bbox;
}
@@ -984,10 +984,10 @@ static Geom::OptRect getODFBoundingBox(const SPItem *item)
* Get the transform for an item, correcting for
* handedness reversal
*/
-static Geom::Matrix getODFItemTransform(const SPItem *item)
+static Geom::Affine getODFItemTransform(const SPItem *item)
{
- Geom::Matrix itemTransform (Geom::Scale(1, -1));
- itemTransform = itemTransform * (Geom::Matrix)item->transform;
+ Geom::Affine itemTransform (Geom::Scale(1, -1));
+ itemTransform = itemTransform * (Geom::Affine)item->transform;
itemTransform = itemTransform * Geom::Scale(1, -1);
return itemTransform;
}
@@ -997,7 +997,7 @@ static Geom::Matrix getODFItemTransform(const SPItem *item)
/**
* Get some fun facts from the transform
*/
-static void analyzeTransform(Geom::Matrix &tf,
+static void analyzeTransform(Geom::Affine &tf,
double &rotate, double &/*xskew*/, double &/*yskew*/,
double &xscale, double &yscale)
{
@@ -1087,7 +1087,7 @@ OdfOutput::preprocess(ZipFile &zf, Inkscape::XML::Node *node)
}
SPItem *item = SP_ITEM(reprobj);
//### Get SVG-to-ODF transform
- Geom::Matrix tf = getODFTransform(item);
+ Geom::Affine tf = getODFTransform(item);
if (nodeName == "image" || nodeName == "svg:image")
{
@@ -1487,7 +1487,7 @@ bool OdfOutput::writeStyle(ZipFile &zf)
*/
static int
writePath(Writer &outs, Geom::PathVector const &pathv,
- Geom::Matrix const &tf, double xoff, double yoff)
+ Geom::Affine const &tf, double xoff, double yoff)
{
using Geom::X;
using Geom::Y;
@@ -1638,7 +1638,7 @@ bool OdfOutput::processStyle(Writer &outs, SPItem *item,
bool OdfOutput::processGradient(Writer &outs, SPItem *item,
- const Glib::ustring &id, Geom::Matrix &/*tf*/)
+ const Glib::ustring &id, Geom::Affine &/*tf*/)
{
if (!item)
return false;
@@ -1864,7 +1864,7 @@ bool OdfOutput::writeTree(Writer &couts, Writer &souts,
Glib::ustring id = getAttribute(node, "id");
//### Get SVG-to-ODF transform
- Geom::Matrix tf = getODFTransform(item);
+ Geom::Affine tf = getODFTransform(item);
//### Get ODF bounding box params for item
Geom::OptRect bbox = getODFBoundingBox(item);
@@ -1960,7 +1960,7 @@ bool OdfOutput::writeTree(Writer &couts, Writer &souts,
iwidth = xscale * iwidth;
iheight = yscale * iheight;
- Geom::Matrix itemTransform = getODFItemTransform(item);
+ Geom::Affine itemTransform = getODFItemTransform(item);
Glib::ustring itemTransformString = formatTransform(itemTransform);
diff --git a/src/extension/internal/odf.h b/src/extension/internal/odf.h
index 9ad261098..2a6f7799f 100644
--- a/src/extension/internal/odf.h
+++ b/src/extension/internal/odf.h
@@ -317,7 +317,7 @@ private:
bool processStyle(Writer &outs, SPItem *item, const Glib::ustring &id);
bool processGradient(Writer &outs, SPItem *item,
- const Glib::ustring &id, Geom::Matrix &tf);
+ const Glib::ustring &id, Geom::Affine &tf);
bool writeStyleHeader(Writer &outs);
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
index 8b414239a..8d7c95560 100644
--- a/src/extension/internal/pdfinput/svg-builder.cpp
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
@@ -247,7 +247,7 @@ static gchar *svgConvertGfxRGB(GfxRGB *color) {
static void svgSetTransform(Inkscape::XML::Node *node, double c0, double c1,
double c2, double c3, double c4, double c5) {
- Geom::Matrix matrix(c0, c1, c2, c3, c4, c5);
+ Geom::Affine matrix(c0, c1, c2, c3, c4, c5);
gchar *transform_text = sp_svg_transform_write(matrix);
node->setAttribute("transform", transform_text);
g_free(transform_text);
@@ -544,7 +544,7 @@ void SvgBuilder::setClipPath(GfxState *state, bool even_odd) {
* \return true on success; false on invalid transformation
*/
bool SvgBuilder::getTransform(double *transform) {
- Geom::Matrix svd;
+ Geom::Affine svd;
gchar const *tr = _container->attribute("transform");
bool valid = sp_svg_transform_read(tr, &svd);
if (valid) {
@@ -634,7 +634,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPattern *tiling_pattern,
Inkscape::XML::Node *pattern_node = _xml_doc->createElement("svg:pattern");
// Set pattern transform matrix
double *p2u = tiling_pattern->getMatrix();
- Geom::Matrix pat_matrix(p2u[0], p2u[1], p2u[2], p2u[3], p2u[4], p2u[5]);
+ Geom::Affine pat_matrix(p2u[0], p2u[1], p2u[2], p2u[3], p2u[4], p2u[5]);
gchar *transform_text = sp_svg_transform_write(pat_matrix);
pattern_node->setAttribute("patternTransform", transform_text);
g_free(transform_text);
@@ -732,10 +732,10 @@ gchar *SvgBuilder::_createGradient(GfxShading *shading, double *matrix, bool for
gradient->setAttribute("gradientUnits", "userSpaceOnUse");
// If needed, flip the gradient transform around the y axis
if (matrix) {
- Geom::Matrix pat_matrix(matrix[0], matrix[1], matrix[2], matrix[3],
+ Geom::Affine pat_matrix(matrix[0], matrix[1], matrix[2], matrix[3],
matrix[4], matrix[5]);
if ( !for_shading && _is_top_level ) {
- Geom::Matrix flip(1.0, 0.0, 0.0, -1.0, 0.0, _height * PT_PER_PX);
+ Geom::Affine flip(1.0, 0.0, 0.0, -1.0, 0.0, _height * PT_PER_PX);
pat_matrix *= flip;
}
gchar *transform_text = sp_svg_transform_write(pat_matrix);
@@ -1149,7 +1149,7 @@ void SvgBuilder::updateTextMatrix(GfxState *state) {
max_scale = h_scale;
}
// Calculate new text matrix
- Geom::Matrix new_text_matrix(text_matrix[0] * state->getHorizScaling(),
+ Geom::Affine new_text_matrix(text_matrix[0] * state->getHorizScaling(),
text_matrix[1] * state->getHorizScaling(),
-text_matrix[2], -text_matrix[3],
0.0, 0.0);
@@ -1184,7 +1184,7 @@ void SvgBuilder::_flushText() {
Inkscape::XML::Node *text_node = _xml_doc->createElement("svg:text");
// Set text matrix
- Geom::Matrix text_transform(_text_matrix);
+ Geom::Affine text_transform(_text_matrix);
text_transform[4] = first_glyph.position[0];
text_transform[5] = first_glyph.position[1];
gchar *transform = sp_svg_transform_write(text_transform);
@@ -1719,7 +1719,7 @@ void SvgBuilder::addMaskedImage(GfxState *state, Stream *str, int width, int hei
mask_image_node->setAttribute("transform", NULL);
mask_node->appendChild(mask_image_node);
// Scale the mask to the size of the image
- Geom::Matrix mask_transform((double)width, 0.0, 0.0, (double)height, 0.0, 0.0);
+ Geom::Affine mask_transform((double)width, 0.0, 0.0, (double)height, 0.0, 0.0);
gchar *transform_text = sp_svg_transform_write(mask_transform);
mask_node->setAttribute("maskTransform", transform_text);
g_free(transform_text);
diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
index f0062bbe6..47e5d7735 100644
--- a/src/extension/internal/pdfinput/svg-builder.h
+++ b/src/extension/internal/pdfinput/svg-builder.h
@@ -27,7 +27,7 @@ namespace Inkscape {
}
#include <2geom/point.h>
-#include <2geom/matrix.h>
+#include <2geom/affine.h>
#include <glibmm/ustring.h>
#include "CharTypes.h"
@@ -212,7 +212,7 @@ private:
char *_font_specification;
double _font_scaling;
bool _need_font_update;
- Geom::Matrix _text_matrix;
+ Geom::Affine _text_matrix;
Geom::Point _text_position;
std::vector<SvgGlyph> _glyphs; // Added characters
bool _in_text_object; // Whether we are inside a text object
diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp
index a130b6923..b5389bad3 100644
--- a/src/extension/internal/pov-out.cpp
+++ b/src/extension/internal/pov-out.cpp
@@ -301,7 +301,7 @@ bool PovOutput::doCurve(SPItem *item, const String &id)
povShapes.push_back(shapeInfo); //passed all tests. save the info
// convert the path to only lineto's and cubic curveto's:
- Geom::Matrix tf = item->i2d_affine();
+ Geom::Affine tf = item->i2d_affine();
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf );
/*
diff --git a/src/extension/internal/win32.cpp b/src/extension/internal/win32.cpp
index 8b4ff13c8..537c91a2c 100644
--- a/src/extension/internal/win32.cpp
+++ b/src/extension/internal/win32.cpp
@@ -293,7 +293,7 @@ PrintWin32::finish (Inkscape::Extension::Print *mod)
scaley = dpiY / 72.0;
// We simply map document 0,0 to physical page 0,0
- Geom::Matrix affine = Geom::Scale(scalex / 1.25, scaley / 1.25);
+ Geom::Affine affine = Geom::Scale(scalex / 1.25, scaley / 1.25);
nr_arena_item_set_transform (mod->root, affine);
diff --git a/src/extension/internal/win32.h b/src/extension/internal/win32.h
index 02790a231..4a913bb05 100644
--- a/src/extension/internal/win32.h
+++ b/src/extension/internal/win32.h
@@ -70,11 +70,11 @@ public:
/* Rendering methods */
/*
- virtual unsigned int bind (Inkscape::Extension::Print * module, const Geom::Matrix *transform, float opacity);
+ virtual unsigned int bind (Inkscape::Extension::Print * module, const Geom::Affine *transform, float opacity);
virtual unsigned int release (Inkscape::Extension::Print * module);
virtual unsigned int comment (Inkscape::Extension::Print * module, const char * comment);
virtual unsigned int image (Inkscape::Extension::Print * module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
- const Geom::Matrix *transform, const SPStyle *style);
+ const Geom::Affine *transform, const SPStyle *style);
*/
};
diff --git a/src/extension/print.cpp b/src/extension/print.cpp
index 2d4177d60..ad8c4c38d 100644
--- a/src/extension/print.cpp
+++ b/src/extension/print.cpp
@@ -61,7 +61,7 @@ Print::finish (void)
}
unsigned int
-Print::bind (const Geom::Matrix *transform, float opacity)
+Print::bind (const Geom::Affine *transform, float opacity)
{
return imp->bind (this, transform, opacity);
}
@@ -79,14 +79,14 @@ Print::comment (const char * comment)
}
unsigned int
-Print::fill (Geom::PathVector const &pathv, const Geom::Matrix *ctm, const SPStyle *style,
+Print::fill (Geom::PathVector const &pathv, const Geom::Affine *ctm, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox)
{
return imp->fill (this, pathv, ctm, style, pbox, dbox, bbox);
}
unsigned int
-Print::stroke (Geom::PathVector const &pathv, const Geom::Matrix *transform, const SPStyle *style,
+Print::stroke (Geom::PathVector const &pathv, const Geom::Affine *transform, const SPStyle *style,
const NRRect *pbox, const NRRect *dbox, const NRRect *bbox)
{
return imp->stroke (this, pathv, transform, style, pbox, dbox, bbox);
@@ -94,7 +94,7 @@ Print::stroke (Geom::PathVector const &pathv, const Geom::Matrix *transform, con
unsigned int
Print::image (unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
- const Geom::Matrix *transform, const SPStyle *style)
+ const Geom::Affine *transform, const SPStyle *style)
{
return imp->image (this, px, w, h, rs, transform, style);
}
diff --git a/src/extension/print.h b/src/extension/print.h
index 0f0435c0f..d5218aed8 100644
--- a/src/extension/print.h
+++ b/src/extension/print.h
@@ -41,18 +41,18 @@ public:
unsigned int finish (void);
/* Rendering methods */
- unsigned int bind (Geom::Matrix const *transform,
+ unsigned int bind (Geom::Affine const *transform,
float opacity);
unsigned int release (void);
unsigned int comment (const char * comment);
unsigned int fill (Geom::PathVector const &pathv,
- Geom::Matrix const *ctm,
+ Geom::Affine const *ctm,
SPStyle const *style,
NRRect const *pbox,
NRRect const *dbox,
NRRect const *bbox);
unsigned int stroke (Geom::PathVector const &pathv,
- Geom::Matrix const *transform,
+ Geom::Affine const *transform,
SPStyle const *style,
NRRect const *pbox,
NRRect const *dbox,
@@ -61,7 +61,7 @@ public:
unsigned int w,
unsigned int h,
unsigned int rs,
- Geom::Matrix const *transform,
+ Geom::Affine const *transform,
SPStyle const *style);
unsigned int text (char const *text,
Geom::Point p,