Changes between Version 6 and Version 7 of UnifyingTheRenderingInterfaces


Ignore:
Timestamp:
Mar 8, 2009 11:12:54 AM (9 years ago)
Author:
tbonfort
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UnifyingTheRenderingInterfaces

    v6 v7  
    264264
    265265=== Raster Layers ===
    266 A possible solution to avoid function call overhead while allowing the raster functions to set single pixel values could be for the renderers to expose an inlined setPixel (and getPixel?) function, probably without any bounds checking for performance. for example
    267 {{{
    268 #!c
    269 inline void setPixelAGG(imageObj *im, int x, int y, int r, int g, int b, int a) {
    270  im->buffer[x][y]=AGGPixelMacro(r,g,b,a);
    271 }
    272 }}}
    273 and then use a vtable approach to connect that to a generic setPixel function.
    274 
    275 '''update''': this won't work out as an inline function is of no use if we're using function pointers (i.e. the vtable)
    276 
    277 
    278 
     266The raster handling code will be updated to support a 32 bit plain RGBA buffer (in addition to GD's internal buffer format)
     267
     268
     269
     270The renderers that internally use a pixel buffer will present an interface to export to this format, so the raster functions can directly write into it.
     271{{{
     272#!c
     273struct pixelbuffer {
     274 unsigned char *data;  //the actual data (eventually private)
     275 int pixelstep; //number of bytes per pixel
     276 int rowstep; //number of bytes per line
     277 unsigned char *r,*g,*b,*a; //pointers to each component of the first pixel
     278}
     279}}}
     280
     281The renderers that don't use a pixel buffer (namely pdf and svg), will present an interface to merge a newly created RGBA buffer in this format.
     282 
    279283
    280284----------------------------------------------------------------------------------------------------------
    281 
    282 
    283285
    284286
     
    286288All I/O is currently done with gd (or not: geotiff,etc)
    287289=== pixmap input ===
    288  * have gd load pixmaps, and let the renderer convert and cache on first access
    289 or
    290  * let the renderer provide a pixmap loading function
     290 * leave the GD input reading code as-is if using the GD renderer.
     291 * provide an image reading function (using libpng, jpeg, etc) that outputs to a 32bit rgba buffer
     292
    291293=== image output ===
    292  * the renderer converts its internal image representation to a gdimage and let gd do the saving
    293 or
    294  * have the renderer provide saving functions directly (i.e. call directly libpng/libjpeg/...)
     294 * keep the current gd code as is for the GD rendering
     295 * provide image saving functions (also supporting eventual formatoptions) that read their data from a 32bit RGBA buffer.