Changes between Version 3 and Version 4 of UnifyingTheRenderingInterfaces


Ignore:
Timestamp:
Nov 9, 2007, 4:42:50 AM (16 years ago)
Author:
tbonfort
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UnifyingTheRenderingInterfaces

    v3 v4  
    11= Unifying The Rendering Interfaces =
    22page to keep track of ideas and notes concerning "pluggable" renderers, and their interface with the main mapserver program
     3
     4== Context ==
     5Adding new renderers, and maintaining the current ones is getting quite complex due to functional code duplication inside each renderer.
     6=== Current way of doing things ===
     7{{{
     8int msDrawXXX(image, shape, symbol, scalefactor ...) {
     9  if renderGD
     10    return msDrawXXXGD(image, shape, symbol, scalefactor ...);
     11  else if renderAGG
     12    return msDrawXXXAGG(image, shape, symbol, scalefactor ...);
     13  else if renderPDF
     14    return msDrawXXXPDF(image, shape, symbol, scalefactor ...);
     15....etc....
     16}
     17}}}
     18and then each msDrawXXXYYY function is
     19{{{
     20int msDrawXXXYYY(image, shape, symbol, scalefactor ...) {
     21 ...
     22 do some size, width, etc adjustments with respect to minsize, maxsize, scalefactor, etc
     23 ...
     24 treat or dispatch off to other functions depending on the symbol type:
     25  msDrawXXXpixmapYYY
     26  msDrawXXXvectorYYY /*further adjustments in here: vector scaling and rotation*/
     27  msDrawXXXtruetypeYYY /*further adjustments in here: font lookup*/
     28  msDrawXXXellipseYYY /*further adjustments in here: scaling and rotation*/
     29  msDrawXXXhatchYYY
     30}
     31}}}
     32
     33=== Proposed way ===
     34all (or as much as possible) cartographic treatment is done once, and the renderers only deal with... tada! rendering
     35{{{
     36int msDrawXXX(image, shape, symbol, scalefactor ...) {
     37...
     38 do some size, width, etc adjustments with respect to minsize, maxsize, scalefactor, etc
     39 ...
     40then depending on the symbol type, switch off to a render specific function (possibly pointed at by a vtable structure):
     41  if vector symbol
     42    return msDrawXXXVector(image, shape, vector points, color, angle ...);
     43  else if truetype symbol
     44    return msDrawXXXTruetype(image, shape, font file, character, color, angle ...);
     45  else
     46....etc....
     47}
     48}}}
    349
    450== Desired Functionality ==