summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 141a052)
raw | patch | inline | side by side (parent: 141a052)
author | theadib <theadib@users.sourceforge.net> | |
Mon, 14 Jan 2008 23:55:57 +0000 (23:55 +0000) | ||
committer | theadib <theadib@users.sourceforge.net> | |
Mon, 14 Jan 2008 23:55:57 +0000 (23:55 +0000) |
src/extension/internal/cairo-pdf-out.cpp | patch | blob | history | |
src/extension/internal/cairo-ps-out.cpp | patch | blob | history | |
src/extension/internal/cairo-renderer.cpp | patch | blob | history |
index f6d5918e96aca3207ab522d549f01d2f42f8f754..c17618bc589cdc9420ad9c22e4126a50c992b028 100644 (file)
"</param>\n"
"<param name=\"textToPath\" gui-text=\"" N_("Convert texts to paths") "\" type=\"boolean\">false</param>\n"
"<param name=\"blurToBitmap\" gui-text=\"" N_("Convert blur effects to bitmaps") "\" type=\"boolean\">false</param>\n"
- "<output>\n"
+ "<param name=\"resolution\" gui-text=\"" N_("Preferred resolution (DPI) of bitmaps") "\" type=\"int\" min=\"72\" max=\"2400\">90</param>\n"
+ "<output>\n"
"<extension>.pdf</extension>\n"
"<mimetype>application/pdf</mimetype>\n"
"<filetypename>PDF via Cairo (*.pdf)</filetypename>\n"
index 032592bf5b796ad71c51c53ebb35e923b4d7eeb1..b3cf1fa26e0b9d8db4f5617b775e1cebdb833754 100644 (file)
"</param>\n"
"<param name=\"textToPath\" gui-text=\"" N_("Convert texts to paths") "\" type=\"boolean\">false</param>\n"
"<param name=\"blurToBitmap\" gui-text=\"" N_("Convert blur effects to bitmaps") "\" type=\"boolean\">false</param>\n"
+ "<param name=\"resolution\" gui-text=\"" N_("Preferred resolution (DPI) of bitmaps") "\" type=\"int\" min=\"72\" max=\"2400\">90</param>\n"
"<output>\n"
"<extension>.ps</extension>\n"
"<mimetype>application/ps</mimetype>\n"
index 002098bd2e4c5a184872d8fe3ffd09751a2ef6cb..228154f049197697c377cc9f3274d389d8bb6716 100644 (file)
GSList *items = NULL; //g_slist_copy ((GSList *) selection->itemList());
items = g_slist_append(items, item);
- // Generate a random value from the current time (you may create bitmap from the same object(s)
- // multiple times, and this is done so that they don't clash)
- GTimeVal cu;
- g_get_current_time (&cu);
- guint current = (int) (cu.tv_sec * 1000000 + cu.tv_usec) % 1024;
-
- // Create the filename
- gchar *filename = g_strdup_printf ("%s-%s-%u.png", document->name, SP_OBJECT_REPR(items->data)->attribute("id"), current);
- // Imagemagick is known not to handle spaces in filenames, so we replace anything but letters,
- // digits, and a few other chars, with "_"
- filename = g_strcanon (filename, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.=+~$#@^&!?", '_');
- // Build the complete path by adding document->base if set
- gchar *filepath = g_build_filename (document->base?document->base:"", filename, NULL);
-
- //g_print ("%s\n", filepath);
-
// Remember parent and z-order of the topmost one
gint pos = SP_OBJECT_REPR(g_slist_last(items)->data)->position();
SPObject *parent_object = SP_OBJECT_PARENT(g_slist_last(items)->data);
shift_x = round (shift_x);
shift_y = -round (-shift_y); // this gets correct rounding despite coordinate inversion, remove the negations when the inversion is gone
}
- t = (NR::Matrix)(NR::scale(1, -1) * (NR::Matrix)(NR::translate (shift_x, shift_y) * eek.inverse()));
+ t = (NR::Matrix)(NR::scale(1, -1) * (NR::Matrix)(NR::translate (shift_x, shift_y)* eek.inverse()));
+
+ //t = t * ((NR::Matrix)ctx->getCurrentState()->transform).inverse();
// Do the export
- GdkPixbuf *pb = sp_generate_internal_bitmap(document, filepath,
+ GdkPixbuf *pb = sp_generate_internal_bitmap(document, NULL,
bbox.x0, bbox.y0, bbox.x1, bbox.y1, width, height, res, res, (guint32) 0xffffff00, items );
- /*sp_export_png_file(document, filepath,
- bbox.x0, bbox.y0, bbox.x1, bbox.y1,
- width, height, res, res,
- (guint32) 0xffffff00,
- NULL, NULL,
- true, //bool force_overwrite,
- items);
- */
// Run filter, if any
/*
if (run) {
system (run);
}
*/
- // Import the image back
- //GdkPixbuf *pb = gdk_pixbuf_new_from_file (filepath, NULL);
if (pb) {
unsigned char *px = gdk_pixbuf_get_pixels (pb);
unsigned int w = gdk_pixbuf_get_width(pb);
unsigned int h = gdk_pixbuf_get_height(pb);
unsigned int rs = gdk_pixbuf_get_rowstride(pb);
- NRMatrix matrix = t;
+ NRMatrix matrix;
+ matrix = t;
+ //matrix = ((NR::Matrix)ctx->getCurrentState()->transform).inverse();
//nr_matrix_set_identity(&matrix);
ctx->renderImage (px, w, h, rs, &matrix, SP_OBJECT_STYLE (item));
// move to the saved position
repr->setPosition(pos > 0 ? pos + 1 : 1);
-
- // Clean up
- Inkscape::GC::release(repr);
*/
gdk_pixbuf_unref (pb);
-
- // Complete undoable transaction
- // sp_document_done (document, SP_VERB_SELECTION_CREATE_BITMAP, _("Create bitmap"));
}
g_slist_free (items);
-
- g_free (filename);
- g_free (filepath);
}
static void sp_item_invoke_render(SPItem *item, CairoRenderContext *ctx)
{
- /*
- if(ctx->_state->has_filtereffect)
- printf("\nhas filtereffects");
- */
+ SPStyle* style = SP_OBJECT_STYLE (item);
+ if(style->filter.set != 0) {
+ return sp_asbitmap_render(item, ctx);
+ }
if (SP_IS_ROOT(item)) {
TRACE(("root\n"));