summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ad7f24)
raw | patch | inline | side by side (parent: 4ad7f24)
author | miklosh <miklosh@users.sourceforge.net> | |
Sun, 19 Aug 2007 20:48:55 +0000 (20:48 +0000) | ||
committer | miklosh <miklosh@users.sourceforge.net> | |
Sun, 19 Aug 2007 20:48:55 +0000 (20:48 +0000) |
src/extension/internal/pdfinput/svg-builder.cpp | patch | blob | history |
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
index 6e5620236c16220d42e795b6dfa58f6752c8b148..ff206174eeb3d2846d504657095c20536e0baf43 100644 (file)
#include "unit-constants.h"
#include "io/stringstream.h"
#include "io/base64stream.h"
+#include "display/nr-filter-utils.h"
#include "libnr/nr-matrix-ops.h"
#include "libnr/nr-macros.h"
#include "libnrtype/font-instance.h"
static gchar tmp[1023] = {0};
snprintf(tmp, 1023,
"#%02x%02x%02x",
- CLAMP(SP_COLOR_F_TO_U(r), 0, 255),
- CLAMP(SP_COLOR_F_TO_U(g), 0, 255),
- CLAMP(SP_COLOR_F_TO_U(b), 0, 255));
+ NR::clamp(SP_COLOR_F_TO_U(r)),
+ NR::clamp(SP_COLOR_F_TO_U(g)),
+ NR::clamp(SP_COLOR_F_TO_U(b)));
return (gchar *)&tmp;
}
}
static void svgSetTransform(Inkscape::XML::Node *node, double c0, double c1,
- double c2, double c3, double c4, double c5) {
+ double c2, double c3, double c4, double c5) {
NR::Matrix matrix(c0, c1, c2, c3, c4, c5);
gchar *transform_text = sp_svg_transform_write(matrix);
node->setAttribute("transform", transform_text);
g_free(transform_text);
}
-static void svgSetTransform(Inkscape::XML::Node *node, double *transform) {
- svgSetTransform(node, transform[0], transform[1], transform[2], transform[3],
- transform[4], transform[5]);
-}
-
/**
* \brief Generates a SVG path string from poppler's data structure
*/
Glib::ustring x_coords;
Glib::ustring y_coords;
Glib::ustring text_buffer;
- bool is_vertical = !strcmp(sp_repr_css_property(_font_style, "writing-mode", "lr"), "tb"); // FIXME
// Output all buffered glyphs
while (1) {
@@ -1362,8 +1357,8 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *str, int width, int height
// Set read/write functions
Inkscape::IO::StringOutputStream base64_string;
Inkscape::IO::Base64OutputStream base64_stream(base64_string);
- FILE *fp;
- gchar *file_name;
+ FILE *fp = NULL;
+ gchar *file_name = NULL;
if (embed_image) {
base64_stream.setColumnWidth(0); // Disable line breaks
png_set_write_fn(png_ptr, &base64_stream, png_write_base64stream, png_flush_base64stream);
} else { // Work around for renderer bug when mask isn't defined in pattern
static int mask_count = 0;
Inkscape::XML::Node *defs = _root->firstChild();
- Inkscape::XML::Node *result = NULL;
if ( !( defs && !strcmp(defs->name(), "svg:defs") ) ) {
// Create <defs> node
defs = _xml_doc->createElement("svg:defs");