Index: [thread] [date] [subject] [author]
  From: Stephane Chauveau <Stephane.Chauveau@irisa.fr>
  To  : ggi-develop@eskimo.com
  Date: Thu, 02 Jul 1998 18:05:20 +0200

Re: libggi open issues

The pixel format described in the previous mails seems to be 
very complex. Moreover, it will be very difficult to add 
informations into a bit-field (drivers for example).

I propose the following :

1) Each format is referenced by an index from 0 to ...

   typedef int ggi_pix_idx ; 

   this index is associated to the display

2) A data structure (hidden for the user) is associated 
   to each ggi_pix_idx. 

 - a pixel type (text,linear1,linear2,linear4,...) 
 - fields common to all pixel types (drivers,...). 
 - fields specific to the pixel type (a structure in a union ?)
   (depth, masks for RED/GREEN/BLUE/ALPHA bits,
           big/little endian, ...)

  typedef struct {
    // common fields 
    enum ggi_pix_type type ; 
    ...
    // the fields associated to the pixel type.
    union {
       ggi_pix_desc_text text ;  /* infos for text */
       ggi_pix_desc_indexed8 indexed8 ;  /* infos for .. */
       ggi_pix_desc_linear16 linear16 ;
       ... 
      } info ; 
  } ggi_pix_desc ;

3) The most used formats are predefined and a constant 
   is associated to their ggi_pix_idx.

  #define PF_TEXT       0  
  #define PF_INDEXED_8  1  
  #define PF_LINEAR1    2
  #define PF_LINEAR8_232 3
  #define PF_LINEAR16_R5G6B5 4
  #define PF_LINEAR16_R5G5B6 5


4) Functions are provided to find or to create a ggi_pix_idx
   (and the corresponding ggi_pix_desc) according to the 
   caracteristics needed by the display or by the user.  

6) Functions and macros are provided to acces to the  
   data structure fields according to a ggi_pix_idx. 

6) the ggi_pix_idx can be used as an index in 1D/2D tables
   to find the copy/convert drivers . 

PS:Sorry if my mail is not correctly inserted in this thread.
 I am new in this mailing list and I can not reply to a previous
 mail




-- 
Stephane CHAUVEAU.       
email : schauvea@irisa.fr  
Les opinions exprimees dans ce message 
n'engagent en aucune facon mon employeur.

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