nanogui: Pixmaps


Previous by date: 20 May 1999 19:14:01 -0000 Re: Bitblt proposal (was: Re: bogl routines), Alex Holden
Next by date: 20 May 1999 19:14:01 -0000 Re: nano-X driver stability discussion, Greg Haerr
Previous in thread: 20 May 1999 19:14:01 -0000 Re: Pixmaps, Ben Pfaff
Next in thread: 20 May 1999 19:14:01 -0000 Re: Pixmaps, Greg Haerr

Subject: RE: Pixmaps
From: Alex Holden ####@####.####
Date: 20 May 1999 19:14:01 -0000
Message-Id: <Pine.LNX.4.04.9905201954180.382-100000@hyperspace>

On Thu, 20 May 1999, Greg Haerr wrote:
> I suggest the following structure:
> 
> 	typedef struct {
> 		COORD	 width;
> 		COORD height;
> 		int planes;
> 		int bitsperpixel;
> 		IMAGEBITS bits[];
> 		// image data here, optionally followed by color data
> 	} BITMAP;
> 
> 	In addition, a tag along for palette data:
> 		int ncolors;
> 		COLORVAL palette[];

Out of interest, here is the allegro structure. As you can see, it's quite
a bit more advanced, including information about whether to clip it, where
to clip it (relevant to its origin), allows it to be used for the hardware
itself, provides for sub-bitmaps, etc. At least some of these features are
probably useful.

typedef struct BITMAP            /* a bitmap structure */
{
   int w, h;                     /* width and height in pixels */
   int clip;                     /* flag if clipping is turned on */
   int cl, cr, ct, cb;           /* clip left, right, top and bottom
values */
   GFX_VTABLE *vtable;           /* drawing functions */
   void (*write_bank)(void);     /* write bank selector, see bank.s */
   void (*read_bank)(void);      /* read bank selector, see bank.s */
   void *dat;                    /* the memory we allocated for the bitmap
*/
   int bitmap_id;                /* for identifying sub-bitmaps */
   void *extra;                  /* points to a structure with more info
*/
   int x_ofs;                    /* horizontal offset (for sub-bitmaps) */
   int y_ofs;                    /* vertical offset (for sub-bitmaps) */
   int seg;                      /* bitmap segment */
   unsigned char *line[0];       /* pointers to the start of each line */
} BITMAP;

> 	Since nano-X doesn't have to be completely X-dependent, I don't see
> anything wrong with adding some stuff that's quite a bit more fancy than what
> X supports today.  We do have to be worried about breaking too many X api
> calls, though.  But, so far, noone has tried to port any X program to nano-X anyway.

I agree.

--------------- Linux- the choice of a GNU generation. --------------
: Alex Holden (M1CJD)- Caver, Programmer, Land Rover nut, Radio Ham :
-------------------- http://www.linuxhacker.org/ --------------------



Previous by date: 20 May 1999 19:14:01 -0000 Re: Bitblt proposal (was: Re: bogl routines), Alex Holden
Next by date: 20 May 1999 19:14:01 -0000 Re: nano-X driver stability discussion, Greg Haerr
Previous in thread: 20 May 1999 19:14:01 -0000 Re: Pixmaps, Ben Pfaff
Next in thread: 20 May 1999 19:14:01 -0000 Re: Pixmaps, Greg Haerr


Powered by ezmlm-browse 0.20.