nanogui: Bitblt proposal (was: Re: bogl routines)


Previous by date: 15 May 1999 18:36:50 -0000 Re: Support for on-screen keyboard, Warner Losh
Next by date: 15 May 1999 18:36:50 -0000 Re: Support for on-screen keyboard, Vidar Hokstad
Previous in thread:
Next in thread: 15 May 1999 18:36:50 -0000 Re: Bitblt proposal (was: Re: bogl routines), Ben Pfaff

Subject: Bitblt proposal (was: Re: bogl routines)
From: Ben Pfaff ####@####.####
Date: 15 May 1999 18:36:50 -0000
Message-Id: <873e0yxjs5.fsf@pfaffben.user.msu.edu>

Greg Haerr ####@####.#### writes:
   [...some good points...]

enum
  {
     BOGL_ROP_NOP,
     BOGL_ROP_AND,
     BOGL_ROP_OR,
     BOGL_ROP_XOR,
  };

/* Copy a block of pixels from (SX,SY)-(SX+W,SY+H) in SRC to
   (DX,DY)+(DX+W,DY+H) in DEST, applying raster operation ROP.  DST
   and SRC may be bitmaps created with bogl_create_bitmap(), or they
   may be null pointers, representing the screen image.  */
void bogl_bitblt (struct bogl_bitmap *dst, int dx, int dy,
                  struct bogl_bitmap *src, int sx, int sy,
                  int w, int h, int rop);

/* Dynamically allocate a bitmap of size (W,H).  Initialize all the
   pixels in the bitmap to background color BG; if BG == -1, leave
   them undefined.  Returns a pointer to the created bitmap if
   successful; otherwise, returns a null pointer. */
struct bogl_bitmap *bogl_create_bitmap (int w, int h, int bg);

Okay, this still leaves masking.  We could add a mask parameter, I
suppose:

/* Copy a block of pixels from (SX,SY)-(SX+W,SY+H) in SRC to
   (DX,DY)+(DX+W,DY+H) in DEST, applying raster operation ROP.  DST
   and SRC may be bitmaps created with bogl_create_bitmap(), or they
   may be null pointers, representing the screen image.  If MASK is
   non-null, then it must be a 1-bit-depth mask of size (W,H)
   specifying which pixels in SRC should be copied.  Each row in MASK
   must be padded on the right to a 32-bit multiple in size. */
void bogl_bitblt (struct bogl_bitmap *dst, int dx, int dy,
                  struct bogl_bitmap *src, int sx, int sy,
                  int w, int h, int rop, void *mask);

Already I'm saying ``Ugh'' to myself when I think about actually
implementing this.  Do we need even more than that?
----------------------------------------------------------------------
An evil thought just occurred to me, actually.  With most visuals (not
vga16) we can easily add a `struct bogl_bitmap *' parameter to all the
bogl_*() functions, which could be a bitmap or NULL to represent the
screen.  Then we'd be able to support drawing on off-screen bitmaps
just as easily as with the screen.

Comments?

-- 
"Let others praise ancient times; I am glad I was born in these."
--Ovid (43 BC-18 AD)

Previous by date: 15 May 1999 18:36:50 -0000 Re: Support for on-screen keyboard, Warner Losh
Next by date: 15 May 1999 18:36:50 -0000 Re: Support for on-screen keyboard, Vidar Hokstad
Previous in thread:
Next in thread: 15 May 1999 18:36:50 -0000 Re: Bitblt proposal (was: Re: bogl routines), Ben Pfaff


Powered by ezmlm-browse 0.20.