gnash-dev
[Top][All Lists]
Advanced

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

Re[2]: [Gnash-dev] class gnash::path


From: Udo Giacomozzi
Subject: Re[2]: [Gnash-dev] class gnash::path
Date: Mon, 19 Feb 2007 18:17:44 +0100

Hello strk,

Sunday, February 18, 2007, 1:51:37 PM, you wrote:
s> Some more tought on this thing.
s> So far, the renderer extracts styles by accessing
s> element index-0 in a vector extracted from the shape_character_def.
s> IFF index == 0, I assume the renderer will use a "default"
s> style itself.

No, there is no default style. Only previously defined styles are used
(index >= 0) or nothing is drawn there (index==-1). Index 0 is just a
normal style like index 1 or 8.

s> This "default" style must match between all renderers,
s> so wouldn't it be nice to get a "core"-defined "default" instead ?
s> This might be a forced *first* element of the styles vector
s> (so that style index gets back to 0-based semantic).


Apparently you still did not understand how the renderer works. I'm
not surprised as it took me very long to understand this concept
(which is nowhere clearly described).

I add this to my previous explanations:

A particular path of a character can also be used to define a "hole"
inside a character. It uses style index -1 to describe where a
character should *not* be filled.

And:

Most rasterizers work calculating scanlines (= a horizontal line of
pixels) independently.

Pseudo code:

  - compute the X coordinates of all edges crossing line Y, remember
    styles of that edge
    
  - sort coordinates accoring to X coordinate
  
  - for x starting at first (smallest) X coordinate iterating to last
     (largest) X coordinate:

     - see if a edge crossed the line at this position. If so, update
       current fill style
       
     - if fill style >= 0, set the pixel at x/y to the appropriate
       value

Of course the actual rasterizer is much more complex but it basically
works like this. You see, most of the time an index is used instead of
a pointer. Yes, it could be made using a pointer but it's not a common
design and after all the rasterizer itself does not access the
original fill style instances at this point.

Also, before running through the above code, the edges have been
already transformed and lines have been converted to shapes.

Hope this makes it clearer once again :)

Udo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]