From: <ai...@us...> - 2008-10-01 06:18:05
|
Revision: 8845 http://plplot.svn.sourceforge.net/plplot/?rev=8845&view=rev Author: airwin Date: 2008-10-01 06:17:49 +0000 (Wed, 01 Oct 2008) Log Message: ----------- Document what the surface dimension units are in each device case. Sometimes they are pixels, sometimes they are points (1/72th of an inch), and sometimes (memcairo) the maximum surface dimension is defined by the size of the buffer so the unit would be buffer pixels (as opposed to screen resolution pixels). This documentation is the first step in understanding the sizes of the cairo results for the various cairo devices. Modified Paths: -------------- trunk/drivers/cairo.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2008-10-01 06:07:51 UTC (rev 8844) +++ trunk/drivers/cairo.c 2008-10-01 06:17:49 UTC (rev 8845) @@ -890,6 +890,7 @@ /* Create an cairo surface & context that are associated with the X window. */ defaultVisual = DefaultVisual(aStream->XDisplay, 0); + /* Dimension units are pixels from cairo documentation. */ aStream->cairoSurface = cairo_xlib_surface_create(aStream->XDisplay, aStream->XWindow, defaultVisual, pls->xlength, pls->ylength); aStream->cairoContext = cairo_create(aStream->cairoSurface); @@ -1213,6 +1214,7 @@ plOpenFile(pls); /* Create an cairo surface & context for PDF file. */ + /* Dimension units are pts = 1/72 inches from cairo documentation. */ aStream->cairoSurface = cairo_pdf_surface_create_for_stream((cairo_write_func_t)write_to_stream, pls->OutFile, (double)pls->xlength, (double)pls->ylength); aStream->cairoContext = cairo_create(aStream->cairoSurface); @@ -1284,6 +1286,7 @@ plOpenFile(pls); /* Create an cairo surface & context for PS file. */ + /* Dimension units are pts = 1/72 inches from cairo documentation. */ aStream->cairoSurface = cairo_ps_surface_create_for_stream((cairo_write_func_t)write_to_stream, pls->OutFile, (double)pls->ylength, (double)pls->xlength); aStream->cairoContext = cairo_create(aStream->cairoSurface); @@ -1378,6 +1381,7 @@ pls->dev = aStream; /* Create an cairo surface & context for SVG file. */ + /* Dimension units are pts = 1/72 inches from cairo documentation. */ aStream->cairoSurface = cairo_svg_surface_create_for_stream((cairo_write_func_t)write_to_stream, pls->OutFile, (double)pls->xlength, (double)pls->ylength); aStream->cairoContext = cairo_create(aStream->cairoSurface); @@ -1468,6 +1472,7 @@ pls->dev = aStream; /* Create a new cairo surface & context for PNG file. */ + /* Dimension units are pixels from cairo documentation. */ aStream->cairoSurface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, (double)pls->xlength, (double)pls->ylength); aStream->cairoContext = cairo_create(aStream->cairoSurface); @@ -1623,6 +1628,8 @@ /* Create a Cairo drawing surface from the input data */ aStream->cairoSurface = + /* Dimension units are width, height of buffer image from cairo + documentation. */ cairo_image_surface_create_for_data (aStream->cairo_format_memory, CAIRO_FORMAT_RGB24, pls->xlength, pls->ylength, stride); aStream->cairoContext = cairo_create(aStream->cairoSurface); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |