Ich habe eine Frage bezüglich der Umwandlung von QImage Bildern zum Format von Autotrace ( http://autotrace.sourceforge.net/ ). Die ganze Umwandlung an sich klappt eigentlich schon und wird korrekt ausgegeben als Vektorgraphik.
Das Ganze funktioniert folgendermassen:
Code: Alles auswählen
QImage image = (_is->getImage(_frame)).swapRGB(); // RGBA <-> BGRA
FILE * svgout = fopen("out.pdf", "w+");
at_fitting_opts_type * fitting_opts = at_fitting_opts_new();
at_bitmap_type * pixelImage;
at_splines_type * splines;
at_output_write_func wfunc = at_output_get_handler_by_suffix("pdf");
//set options
// fitting_opts->color_count = (unsigned int) 5;
int bitsPerPixel = image.depth();
int planes = bitsPerPixel / 8; // on each plane is one byte
pixelImage = at_bitmap_new(image.width(),image.height(),planes);
pixelImage->bitmap = image.bits();
splines = at_splines_new(pixelImage, fitting_opts, NULL,NULL);
at_splines_write(wfunc, svgout, "",NULL, splines, NULL, NULL);
fclose(svgout);
Woran mag das liegen?
Das Ganze läuft mit Qt 3.3.8 auf einem Intel Mac.
Bin froh um jede Hilfe - vielen Dank!