Index: [thread] [date] [subject] [author]
  From: Steve Cheng <elmert@ipoline.com>
  To  : ggi-develop@eskimo.com
  Date: Wed, 15 Jul 1998 00:37:31 -0400 (EDT)

Re: ggiCrossBlit

On Tue, 14 Jul 1998, Marcus Sundberg wrote:

> In libggi-issues paragraph 2.10 we have the following:
> 
>   The full crossblit will be moved to libggi2d. 
> 
>   A version without stretching, i.e. one that copies a rectangular piece from one visual to 
>   another visual, will be included: 
> 
>   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.

Agreed.  Color conversion is hardly simple at all. (Unless you want to do
(un)map pixels one-by-one slowly and painfully, which is what the current
code does.)

(I think the original request for a similar function was to simply be able
to copy data between visuals without doing using GetBox() / PutBox(),
without color conversion, contrary to what the above section says.)

> My opinion is that this should go into an extension, probably
> into the libggi2d CrossBlit. 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 still think blitting between visuals of the same depth[*] is useful.  For
example, you could build a GT_8BIT display-memory, render something, then
crossblit over to the GT_8BIT display.

[*] Actually, in the new graphtype scheme, it would be same-access-depth
crossblit.  We should simply ignore peculiarities such as alpha channels,
i.e. no special handling, just a straight memcpy.  In some cases the
application may want to request a display-memory visual of exactly the same
type and format as the display visual and use this simple blitting function.

In other words, it should be, IMHO, a ggiCopyBox() except that it takes a
destination (different) visual.  Any color conversions would go into an
extension, not core libGGI.

I have incidentally coded a non-color-copying crossblit in display-tile
(display/tile/mode.c).  Older versions of display-tile had a naive GetBox()
and PutBox() combo which involved copying data to buffers. (It still does
use Box combo -- but perhaps would someone do some timings?)  My routines can
probably be optimized even more.

--
Steve Cheng               

email: steve@ggi-project.org   
www: <http://shell.ipoline.com/~elmert/>;

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