Index: [thread] [date] [subject] [author]
  From: Hartmut Niemann <niemann@cip.e-technik.uni-erlangen.de>
  To  : ggi-develop@eskimo.com
  Date: Tue, 14 Jul 1998 16:28:28 +0200 (MESZ)

Re: New ggi_graphtype

> In the true spirit of DTJC I have implemented a new ggi_graphtype
> scheme after looking through the libggi-issues document:
> 
> #define        GGI_AUTO     (0)

As Andrew pointed out: please leave GGI_AUTO (which is an Int, BTW) untouched and
use GT_AUTO which fits the name space better. Define GT_AUTO whatever value
you see fit.

> 
> typedef uint32 ggi_graphtype;
> 
> #define GT_DEPTH_MASK		0x000000ff
> ...
> #define GT_SCHEME_SHIFT		(24)
> 
> /* Macros to extract info from a ggi_graphtype. */
> #define GT_DEPTH(x)		(((x) & GT_DEPTH_MASK) >> GT_DEPTH_SHIFT)
> #define GT_ACCESS(x)		(((x) & GT_ACCESS_MASK) >> GT_ACCESS_SHIFT)
> #define GT_SUBSCHEME(x)		((x) & GT_SUBSCHEME_MASK)
> #define GT_SCHEME(x)		((x) & GT_SCHEME_MASK)
> 
At least the GT_DEPTH should be made public, IMHO, and be guaranteed to work in the future (:-)

> /* Enumerated schemes */
> #define GT_TEXT			((0x01) << GT_SCHEME_SHIFT)
> #define GT_RGB			((0x02) << GT_SCHEME_SHIFT)
> #define GT_GREYSCALE		((0x03) << GT_SCHEME_SHIFT)
> /* Scheme flags */
> #define GT_INDEXED		((1<<7) << GT_SCHEME_SHIFT)
> 
> /* Subschemes */
> #define GT_SUB_LSB_NORMAL	((0x01) << GT_SUBSCHEME_SHIFT)
> #define GT_SUB_MSB_NORMAL	((0x02) << GT_SUBSCHEME_SHIFT)
> #define GT_SUB_LSB_REVERSE	((0x03) << GT_SUBSCHEME_SHIFT)
> #define GT_SUB_MSB_REVERSE	((0x04) << GT_SUBSCHEME_SHIFT)
> 
I don't know whether this is better than simply enumerating all supported sub-schemes
for each scheme. I think anything will work if one subscheme value means: I don't know
or don't care.

> /* Macro that constructs a graphtype */
> #define GT_CONSTRUCT(depth,scheme,access) \
> ( (depth) | \
>   (scheme) | \
>   ((access) << GT_ACCESS_SHIFT) )
> 
> 
> /* Common graphtypes */
> ...
> 
> #ifdef NEED_GRAPHTYPE_SYMS
> #define GRAPHTYPE(X) ("THIS CODE NEEDS FIXING FOR THE NEW GT_* SCHEME!")
> #endif
Forget this GRAPHTYPE macro, I was probably the only user anyway ...
I vote for: delete it entirely.

> 
> 
> My comments:
> * Changing GGI_AUTO to 0 is genarally a Good Thing as it will simplify lots
>   of things and doesn't break any source-compability.
No. Use GT_AUTO at your will, but please not GGI_AUTO. Or is there a reason
for using GGI_AUTO that I don't know?

> * Having GT_INDEXED as a flag instead of a searate scheme is also the right
>   thing to do as you can have both indexed and non-indexed RGB, greyscale,
>   YUV or whatever modes.
Yes. 
> 
> Unless anyone finds any important flaw in this scheme that can't be
> fixed without breaking anything I'll commit this tomorrow so we can
> start updating targets and drivers.
> 
Fine with me.
Hartmut.
--  
Hartmut Niemann   --   niemann(a)cip.e-technik.uni-erlangen.de
http://cip2.e-technik.uni-erlangen.de:8080/hyplan/niemann/index_en.html [/ggi]

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