[Gnome-print] RGBA & DPI



Hello gnome-printers!

Just checked, but gnome_print_rgbaimage (...) is still missing from API.
It SHOULD be there, even if printing only RGB.

If nobody has better idea, I can implement it temporarily as:

int
gnome_print_rgbaimage (GnomePrintContext * pc, const char * data, int
width, int height, int rowstride)
{
	G_RETURN_IF_FAIL...

	if (PRINT_CLASS (pc)->rgbaimage) {
		PRINT_CLASS (pc)->rgbaimage (pc, data, width, height, 
			rowstride);
	} else {
		buf = g_new (width * height * 3);
		g_return_if_fail...
		/* do some copying */
		PRINT_CLASS (pc)->rgbimage (pc, buf, width, height,
			rowstride);
		g_free (buf);
	}
}

I've basically done RGBA printing for both bitmaps and shapes in sodipodi
and similar technique shouldn't be very difficult to do in gnome-print. We
can simply push previous renders into metafile, and if RGBA printing is
required, replay until (including) that object to RGB buffer. Then we can
clip this into real print context.

2. Applications need to know preferred DPI values for printers to
implement special (gradient, fractal) fill with optimal resolution. The
RGBA rendering for PostScript should also use it.

Lauris







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]