QImage -> Autotrace

Dein Thema passt einfach in kein Forum? Dann probiers mal hier.
Antworten
oracle
Beiträge: 20
Registriert: 6. März 2009 18:59

QImage -> Autotrace

Beitrag von oracle »

Hallo,

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);
Wie gesagt klappt das so. Wenn ich aber nun Optionen setzen will, z.b. die Auskommentierte Zeile in den Code einbinde, stürzt das Programm ab (EXC_BAD_ACCESS).

Woran mag das liegen?

Das Ganze läuft mit Qt 3.3.8 auf einem Intel Mac.

Bin froh um jede Hilfe - vielen Dank!
Christian81
Beiträge: 7319
Registriert: 26. August 2004 14:11
Wohnort: Bremen
Kontaktdaten:

Beitrag von Christian81 »

Und wo ist da das Qt-Problem?
MfG Christian

'Funktioniert nicht' ist keine Fehlerbeschreibung
oracle
Beiträge: 20
Registriert: 6. März 2009 18:59

Beitrag von oracle »

ok, dann frage ich andersrum:

mache ich irgendwelche fehler bei der umwandlung inst autotrace format - aus Sicht von QImage. Darf ich QImage so verwenden? z.b. den Pointer auf die Bitmap mittels image.bits() direkt übergeben etc. ?
Antworten