This is a laundry-list patch I would like to apply to the
LibGGI header.  Explanations are interspersed below.  If noone
has any objections or suggestions for improvement today, I'll apply it
Sunday morning (my time).


Index: ggi.h
===================================================================
RCS file: /cvsroot/ggi/ggi-core/libggi/include/ggi/ggi.h,v
retrieving revision 1.2
diff -U2 -r1.2 ggi.h
--- ggi.h       2001/06/21 19:09:27     1.2
+++ ggi.h       2001/09/29 05:26:08
@@ -9,4 +9,5 @@
    Copyright (C) 1998 Andreas Beck             [[EMAIL PROTECTED]]
    Copyright (C) 1998-2000 Marcus Sundberg     [[EMAIL PROTECTED]]
+   Copyright (C) 2001 Brian S. Julin           [[EMAIL PROTECTED]]
 
    Permission is hereby granted, free of charge, to any person obtaining a
@@ -128,4 +129,20 @@
 #define                GGI_BM_SUB_U            0x2100
 #define                GGI_BM_SUB_V            0x2200

bitmeaning definitions for funky YUV formats which contain data
for many dots in the same pixel:

+#define                GGI_BM_SUB_Y0           0x2000
+#define                GGI_BM_SUB_Y1           0x2300
+#define                GGI_BM_SUB_Y2           0x2400
+#define                GGI_BM_SUB_Y3           0x2500
+#define                GGI_BM_SUB_Y4           0x2600
+#define                GGI_BM_SUB_Y5           0x2700
+#define                GGI_BM_SUB_Y6           0x2800
+#define                GGI_BM_SUB_Y7           0x2900
+#define                GGI_BM_SUB_U0           0x2100
+#define                GGI_BM_SUB_U1           0x2a00
+#define                GGI_BM_SUB_U2           0x2b00
+#define                GGI_BM_SUB_U3           0x2c00
+#define                GGI_BM_SUB_V0           0x2200
+#define                GGI_BM_SUB_V1           0x2d00
+#define                GGI_BM_SUB_V2           0x2e00
+#define                GGI_BM_SUB_V3           0x2f00
 
 #define                GGI_BM_SUB_CLUT         0xf000  /* This bit Color or attrib ? 
*/
@@ -148,7 +165,7 @@
 
 #define                GGI_BM_SUB_TEXNUM               0x3000

Comment changes for 80 columns:
-#define                GGI_BM_SUB_FONTSEL              0x3100  /*select different 
font banks*/
-#define                GGI_BM_SUB_PALSEL               0x3200  /* select different 
palettes */
-#define                GGI_BM_SUB_MODESEL              0x3300  /* select different 
palettes */
+#define                GGI_BM_SUB_FONTSEL              0x3100  /* select font banks*/
+#define                GGI_BM_SUB_PALSEL               0x3200  /* select palettes */
+#define                GGI_BM_SUB_MODESEL              0x3300  /* select palettes */
 
 /*
@@ -160,6 +177,6 @@
 #define                GGI_BM_SUB_WRITEPROT            0x1000
 #define                GGI_BM_SUB_WINDOWID             0x2000
+#define                GGI_BM_SUB_DELTA                0x3000 /* stencil for video */
 
-       
 /* Pixelformat for ggiGet/Put* buffers and pixellinearbuffers */
 typedef struct {
@@ -218,6 +235,4 @@
        uint32          bitmeaning[sizeof(ggi_pixel)*8];

Yes, we should keep these, I use them in LibBuf to generate suggest strings,
and they are needed for the YUV stuff.
-       /* Shall we keep those ?
-        */
        uint32          flags;          /* Pixelformat flags */
 
@@ -248,4 +263,6 @@
        blPixelPlanarBuffer,
        blExtended,
Two new pixelformats for YUV support:
+       blSampleLinearBuffer,
+       blSamplePlanarBuffer,
 
        blLastBufferLayout
@@ -263,4 +280,16 @@
 } ggi_pixelplanarbuffer;

samplelinearbuffer is similar to a pixellinearbuffer, but has 
up to four (128-bit total) pixelformats, which are applied to the
pixels modulo their index.  Yes, there is one Quicktime/FOURCC 
uncompressed format with a 128-bit slice.
+typedef struct {
+       int             num_pixels;     /* how many pixelformats        */
+       int             stride;         /* bytes per row                */
+       ggi_pixelformat *pixelformat[4];/* format of the pixels         */
+} ggi_samplelinearbuffer;
+

Sampleplanar buffer is not bitwise planar, but component-wise.  Odiously,  
each component may have a different resolution (usually the Y component
has the highest resolution and the two other components are subsampled at
half that resolution pixel-doubled, or 1/4th resolution pixel+scan-doubled.)
+typedef struct {
+       int             next_line[3];   /* bytes until next line        */
+       int             next_plane[3];  /* bytes until next plane       */
+       ggi_coord       subsample_ratio[3]; /* add one to index */
+       ggi_pixelformat *pixelformat[4];/* format of the pixels         */
+} ggi_sampleplanarbuffer;
+
 /* Buffer types */
 #define GGI_DB_NORMAL          0x0001  /* "frame" is valid when set */
@@ -307,5 +336,6 @@
                ggi_pixellinearbuffer plb;
                ggi_pixelplanarbuffer plan;
-
+               ggi_samplelinearbuffer slb;
+               ggi_sampleplanarbuffer splan;
                void *extended;
        } buffer;
@@ -376,4 +406,5 @@
 int ggiGetAPI(ggi_visual_t vis, int num, char *apiname, char *arguments);
 #define GGI_CHG_APILIST 0x00000001

This would be used to tell extensions to reload/unload accell-friendly 
direct access primitives:
+#define GGI_CHG_ACCELSYNC 0x00000002
 int ggiIndicateChange(ggi_visual_t vis, int whatchanged);
 
Index: types.h
===================================================================
RCS file: /cvsroot/ggi/ggi-core/libggi/include/ggi/types.h,v
retrieving revision 1.3
diff -U2 -r1.3 types.h
--- types.h     2001/09/01 18:17:51     1.3
+++ types.h     2001/09/29 05:26:09
@@ -7,5 +7,6 @@
    Copyright (C) 1995-1996     Steffen Seeger  [[EMAIL PROTECTED]]
    Copyright (C) 1998          Marcus Sundberg [[EMAIL PROTECTED]]
-  
+   Copyright (C) 2001          Brian S. Julin  [[EMAIL PROTECTED]]
+
    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
@@ -103,4 +104,8 @@
 #define GT_PALETTE             ((0x04) << GT_SCHEME_SHIFT)
 #define GT_STATIC_PALETTE      ((0x05) << GT_SCHEME_SHIFT)
YUV color schemes: plain YUV, YCrBr which has a formula to scale
the Cr,Cr to U,V and a variant where the Cr,Br are two's compliment
signed numbers and use a different formula.
+#define GT_SUBSAMPLE_YUV       ((0x06) << GT_SCHEME_SHIFT)
+#define GT_SUBSAMPLE_U_YCRBR   ((0x07) << GT_SCHEME_SHIFT)
+#define GT_SUBSAMPLE_S_YCRBR   ((0x08) << GT_SCHEME_SHIFT)
This is used when you want to set a video mode, but not have any
main framebuffer, that is, you just want to use overlays.
+#define GT_NIL                 ((0xff) << GT_SCHEME_SHIFT)
 
 /* Subschemes */
@@ -139,4 +144,103 @@
        ggi_coord       dpp;            /* dots per pixel                   */
 } ggi_mode;

This is the registry and GGI defines for interface to the mmutils
batchops, as mailed earlier to ggi-develop:
+
+
+/*
+******************************************************************************
+ LibGGI batchop interface
+******************************************************************************
+*/
+
+/* OPcodes */
+#define GGI_OP_GET             0x10000000 /* Flag, gets data from target */
+#define GGI_OP_OWNER_MASK       0x0fff0000 /* What extension owns this */
+#define GGI_OP_OWNER_GGI        0x00000000 /* GGI primitives */
+#define GGI_OP_OWNER_USER       0x0fff0000 /* Will never be allocated */
+
+/* The rest of the extensions will define their owner codes and opcodes
+ * in their own headers.  A registry is kept here, but in comment form 
+ * so as to reduce revision requirements between LibGGI and extensions.
+ =======================================================================
+ OPCODE REGISTRY:
+
+ GGI_OP_OWNER_BUF       0x00010000      Owned/defined by LibBuf
+ GGI_OP_OWNER_MISC      0x00020000      Owned/defined by LibGGIMisc
+ GGI_OP_OWNER_OVL       0x00030000      Owned/defined by LibOvl
+ GGI_OP_OWNER_BLT       0x00040000      Owned/defined by LibBlt
+ =======================================================================
+*/
+
+/* Opcodes for GGI's operations */
+
+#define GGI_OP_DRAWPIXEL       0x00000001      /* drawops.drawpixel */
+#define GGI_OP_PUTPIXEL                0x00000002      /* drawops.putpixel  */
+#define GGI_OP_DRAWHLINE       0x00000003      /* drawops.drawhline */
+#define GGI_OP_PUTHLINE                0x00000004      /* drawops.puthline  */
+#define GGI_OP_DRAWVLINE       0x00000005      /* drawops.drawvline */
+#define GGI_OP_PUTVLINE                0x00000006      /* drawops.putvline  */
+#define GGI_OP_DRAWBOX         0x00000007      /* drawops.drawbox   */
+#define GGI_OP_PUTBOX          0x00000008      /* drawops.putbox    */
+#define GGI_OP_DRAWLINE                0x00000009      /* drawops.drawline  */
+#define GGI_OP_COPYBOX         0x0000000a      /* drawops.copybox   */
+#define GGI_OP_CROSSBLIT       0x0000000b      /* drawops.copybox   */
+
+/* Since GGI's API is entirely stable, we guarantee we will never use these
+ * bits, which makes it easier for extensions providing altered analogs to
+ * GGI drawing primitives to map between their altered primitives and ours.
+ */
+#define GGI_OP_NEVERUSED        0x0000f000
+
+/* PT == parmtype.  Operations need parameters.  Here we define parmtypes,
+ * such that mmutils can match up source and destination batchops.
+ */
+
+/* What IS the batchparm representing? */
+#define GGI_PT_IS_MASK         0xffff0000
+#define GGI_PT_IS_CHANMASK     0x003f0000
+#define GGI_PT_IS_TYPEMASK     0x0f000000
+#define GGI_PT_IS_MISCMASK     0xe0000000
+#define GGI_PT_IS_COORD                0x00000000 /* A coordinate                   */
+#define GGI_PT_IS_COLOR1       0x00010000 /* A color channel (R, Y, C)      */
+#define GGI_PT_IS_COLOR2       0x00020000 /* A color channel (B, U, Cr, M)  */
+#define GGI_PT_IS_COLOR3       0x00040000 /* A color channel (G, V, Cg, Y)  */
+#define GGI_PT_IS_COLOR4       0x00080000 /* A color channel (K)            */
+#define GGI_PT_IS_ALPHA                0x00100000 /* A translucency  (A)            */
+#define GGI_PT_IS_DEPTH                0x00200000 /* A depth         (Z, Bump)      */
+#define GGI_PT_IS_PAT          0x01000000 /* A pattern for tesslation fills */
+#define GGI_PT_IS_CLIP         0x02000000 /* A clipping region              */
+#define GGI_PT_IS_ERR          0x03000000 /* An error term                  */
+#define GGI_PT_IS_FGCOL                0x04000000 /* A foreground color             */
+#define GGI_PT_IS_BGCOL                0x05000000
+#define GGI_PT_IS_BOP          0x06000000 /* A boolean ROP                  */
+#define GGI_PT_IS_KEYCOL       0x07000000 /* A color key                    */
+#define GGI_PT_IS_KEYMASK      0x08000000 /* A color key mask               */
+#define GGI_PT_IS_PLANEMASK    0x09000000 /* A plane mask                   */
+#define GGI_PT_IS_OPCODE       0x0a000000 /* An opcode or command           */
+#define GGI_PT_IS_SRC          0x10000000 /* Pertains to source, not dest   */
+#define GGI_PT_IS_INDEXED      0x20000000 /* Uses a LUT                     */
+#define GGI_PT_IS_MODE         0x60000000 /* An operational mode (pixel size, 
+                                           * pixel format, blend, etc.)     */
+#define GGI_PT_IS_SPECIAL      0xe0000000 /* Extension/target/chipset priv  */
+
+/* IN what axis/dimensions/units the value is given/wanted */
+#define GGI_PT_IN_MASK         0x0000ff00
+#define GGI_PT_IN_AXISMASK     0x00000f00
+#define GGI_PT_IN_UNITMASK     0x0000f000
+#define GGI_PT_IN_QTY          0x00000000 /* A generic quantity             */
+#define GGI_PT_IN_X            0x00000100 /* X Axis                         */
+#define GGI_PT_IN_Y            0x00000200 /* Y Axis                         */
+#define GGI_PT_IN_ADDR         0x00000300 /* Linearized fb address          */
+#define GGI_PT_IN_MAJOR                0x00000400 /* Major Axis                     */
+#define GGI_PT_IN_MINOR                0x00000500 /* Minor Axis                     */
+#define GGI_PT_IN_PIXEL                0x00000000 /* In Pixels                      */
+#define GGI_PT_IN_BYTES                0x00001000 /* In Bytes                       */
+#define GGI_PT_IN_SLICE                0x0000f000 /* In chipset native size slice   */
+
+/* The ROLE the value plays in the operation */
+#define GGP_PT_ROLE_MASK       0x000000c0
+#define GGI_PT_ROLE_START      0x00000000 /* A starting value or coordinate */
+#define GGI_PT_ROLE_END                0x00000040 /* An ending value or coordinate  */
+#define GGI_PT_ROLE_LEN                0x00000080 /* A width or height              */
+#define GGI_PT_ROLE_INCR       0x000000c0 /* An increment, pitch, or slope  */
 
 
That's all folks.  Thanks for any comments.

--
Brian

Reply via email to