Index: [thread] [date] [subject] [author]
  From: Andrew Apted <ajapted@netspace.net.au>
  To  : ggi-develop@eskimo.com
  Date: Wed, 15 Jul 1998 14:36:49 +1000

Re: ggiCrossBlit

Marcus writes:

>    int ggiSimpleCrossBlit(ggi_visual_t src,int sx,int sy,int sw,int sh, ggi_visual_t
>    dst,int dx,int dy); 
>  
>    This will do colour conversion as necessary.
>  
>  Color conversion?
>
>  I don't remember who decided this, but he obviously didn't think
>  very much about it. When we just had GT_1BIT through GT_32BIT
>  this _might_ have been a consideration, but definitely not now.
>
>  Supporting color-conversion for the new scheme would a highly
>  complex matter, and ggiSimpleCrossBlit would probably be at
>  least an order of magnitude bigger than any current function
>  in libggi - and it would have to go into every target.
  
It's not as bad as all that.  We already have the stubs version, which
does this :

    for (each pixel) {

        pix    = ggiGetPixel(src);
        color  = ggiUnmapPixel(src, pix);

        newpix = ggiMapColor(dest, color);
        ggiPutPixel(dest, newpix);
    }

That will always work (so long as LibGGI remains RGB-only), it is just
dog slow whenever there is not an optimized version in the linear-XXX or
whatever sub-library.

>  My opinion is that this should go into an extension, probably
>  into the libggi2d CrossBlit. 

IMO it should *definitely* stay in LibGGI.  When a program doesn't
understand the pixel-format, it needs some fallback method and apart
from using ggiPutPixel(ggiMapColor()) which is always dog slow, there is
only one other thing: ggiCrossBlit().  Sometimes it will also be dog
slow, but for the optimized cases it will be *MUCH MUCH* faster.

>  And if anyone thinks otherwise he's very welcome to implement it
>  before the next codefreeze.  I'd be very happy if someone proved me
>  wrong and did a small and efficient implementation of this...

I'd better pull my finger out then... :-)

Any objections to keeping the name "ggiCrossBlit" ?  I'm not too keen on
the name "ggiSimpleCrossBlit"...

Cheers,
_____________________________________________  ____
                                               \  /
  Andrew Apted   <andrew@ggi-project.org>       \/
  

Index: [thread] [date] [subject] [author]