1 #ifndef RENDER_RENDER_H
    2 #define RENDER_RENDER_H
    3 
    4 /*
    5 **    $VER: render.h v40 (19.12.2002)
    6 **    render.library definitions
    7 */
    8 
    9 #ifndef UTILITY_TAGITEM_H
   10 #include <utility/tagitem.h>
   11 #endif
   12 
   13 
   14 #define RND_TAGBASE             (TAG_USER+0x1000)
   15 
   16 /************************************************************************
   17 
   18 	memhandler
   19 
   20 ************************************************************************/
   21 
   22 #define RND_MemType             (RND_TAGBASE+1)         /* type of memhandler, see below */
   23 #define RND_MemBlock            (RND_TAGBASE+2)         /* ptr to block of memory */
   24 #define RND_MemSize             (RND_TAGBASE+3)         /* size of memblock [bytes] */
   25 #define RND_MemFlags            (RND_TAGBASE+18)        /* memflags (exec/memory.h) */
   26 #define RND_RMHandler           (RND_TAGBASE+12)        /* to pass a memhandler as an argument */
   27 
   28 /*
   29  *	memhandler types
   30  */
   31 
   32 #define RMHTYPE_POOL            1                       /* v39 exec dynamic pool */
   33 #define RMHTYPE_PRIVATE         2                       /* private memory pool */
   34 #define RMHTYPE_PUBLIC          3                       /* common public memory */
   35 
   36 
   37 /************************************************************************
   38 
   39 	palette
   40 
   41 ************************************************************************/
   42 
   43 #define RND_PaletteFormat       (RND_TAGBASE+19)        /* palette import/export format */
   44 #define RND_EHBPalette          (RND_TAGBASE+22)        /* tag to indicate a palette is EHB */
   45 #define RND_FirstColor          (RND_TAGBASE+23)        /* first palette entry */
   46 #define RND_NewPalette          (RND_TAGBASE+24)        /* dispose the old palette and load a new one */
   47 #define RND_RGBWeight           (RND_TAGBASE+11)        /* quantization factors */
   48 
   49 /*
   50  *	palette format types
   51  */
   52 
   53 #define PALFMT_RGB32            1                       /* ULONG red,green,blue */
   54 #define PALFMT_RGB8             2                       /* ULONG 0x00rrggbb */
   55 #define PALFMT_RGB4             3                       /* UWORD 0xrgb */
   56 #define PALFMT_PALETTE          4                       /* render.library palette */
   57 
   58 /*
   59  *	palette sort mode types
   60  *	for the use with SortPalette()
   61  */
   62 
   63 	/* no particular order */
   64 #define PALMODE_NONE            0x0000
   65 
   66 	/* sort palette entries by brightness */
   67 #define PALMODE_BRIGHTNESS      0x0001
   68 
   69 	/* sort palette entries by the number of pixels that they represent.
   70 	   You must supply the RND_Histogram taglist argument. */
   71 #define PALMODE_POPULARITY      0x0002
   72 
   73 	/* sort palette entries by the number of histogram entries that they
   74 	   represent. You must supply the RND_Histogram taglist argument. */
   75 #define PALMODE_REPRESENTATION  0x0003
   76 
   77 	/* sort palette entries by their optical significance for the human
   78 	   eye. Implementation is unknown to you and may change.
   79 	   You must supply the RND_Histogram taglist argument. */
   80 #define PALMODE_SIGNIFICANCE    0x0004
   81 
   82 	/* sort palette entries by color intensity */
   83 #define PALMODE_SATURATION      0x0005
   84 
   85 	/* By default, sort direction is descending, i.e. the precedence is
   86 	   more-to-less. Combine with this flag to invert the sort direction. */
   87 #define PALMODE_ASCENDING       0x0008
   88 
   89 
   90 /************************************************************************
   91 
   92 	histogram related
   93 
   94 ************************************************************************/
   95 
   96 #define RND_HSType              (RND_TAGBASE+4)         /* histogram type, see below */
   97 #define RND_Histogram           (RND_TAGBASE+9)         /* a histogram as an argument */
   98 
   99 /*
  100  *	Histogram / Palette types
  101  *	to be specified with RND_HSType
  102  */
  103 
  104 #define HSTYPE_12BIT            4                       /* 12bit dynamic histogram */
  105 #define HSTYPE_15BIT            5                       /* 15bit dynamic histogram */
  106 #define HSTYPE_18BIT            6                       /* 18bit dynamic histogram */
  107 #define HSTYPE_21BIT            7                       /* 21bit dynamic histogram */
  108 #define HSTYPE_24BIT            8                       /* 24bit dynamic histogram */
  109 #define HSTYPE_12BIT_TURBO      20                      /* 12bit tabular histogram */
  110 #define HSTYPE_15BIT_TURBO      21                      /* 15bit tabular histogram */
  111 #define HSTYPE_18BIT_TURBO      22                      /* 18bit tabular histogram */
  112 
  113 /*
  114  *	tags that can be queried via QueryHistogram()
  115  */
  116 
  117 #define RND_NumPixels           (RND_TAGBASE+5)         /* # pixels in a histogram */
  118 #define RND_NumColors           (RND_TAGBASE+6)         /* # colors in a histogram */
  119 
  120 
  121 /************************************************************************
  122 
  123 	rendering and conversions
  124 
  125 ************************************************************************/
  126 
  127 #define RND_ColorMode           (RND_TAGBASE+7)         /* color mode, see below */
  128 #define RND_DitherMode          (RND_TAGBASE+8)         /* dither mode, see below */
  129 #define RND_DitherAmount        (RND_TAGBASE+26)        /* dither amount */
  130 #define RND_OffsetColorZero     (RND_TAGBASE+10)        /* first color index to be output */
  131 
  132 /*
  133  *	color mode types
  134  *	to be specified with RND_ColorMode
  135  */
  136 
  137 #define COLORMODE_CLUT          0x0000                  /* normal palette lookup */
  138 #define COLORMODE_HAM8          0x0001                  /* HAM8 mode */
  139 #define COLORMODE_HAM6          0x0002                  /* HAM6 mode */
  140 #define COLORMODE_MASK          0x0003                  /* mask to determine COLORMODE */
  141 
  142 
  143 /*
  144  *	dither mode types
  145  *	to be specified with RND_DitherMode
  146  */
  147 
  148 #define DITHERMODE_NONE         0x0000                  /* no dither */
  149 #define DITHERMODE_FS           0x0001                  /* Floyd-Steinberg dither */
  150 #define DITHERMODE_RANDOM       0x0002                  /* random dither. amount required. */
  151 #define DITHERMODE_EDD          0x0003                  /* EDD dither */
  152 
  153 
  154 /************************************************************************
  155 
  156 	miscellaneous
  157 
  158 ************************************************************************/
  159 
  160 #define RND_ProgressHook        (RND_TAGBASE+13)        /* progress callback hook */
  161 #define RND_SourceWidth         (RND_TAGBASE+14)        /* total input width [pixels] */
  162 #define RND_DestWidth           (RND_TAGBASE+15)        /* total output width [pixels] */
  163 #define RND_PenTable            (RND_TAGBASE+16)        /* ptr to a chunky conversion table */
  164 #define RND_LeftEdge            (RND_TAGBASE+17)        /* chunky data left edge [pixels] */
  165 #define RND_LineHook            (RND_TAGBASE+20)        /* line callback hook */
  166 #define RND_MapEngine           (RND_TAGBASE+27)        /* Mapping-Engine */
  167 #define RND_Interleave          (RND_TAGBASE+28)        /* Interleave */
  168 #define RND_Palette             (RND_TAGBASE+29)        /* Palette */
  169 #define RND_Weight              (RND_TAGBASE+30)        /* Weight factor */
  170 #define RND_ScaleEngine         (RND_TAGBASE+31)        /* ScaleEngine */
  171 #define RND_DestCoordinates     (RND_TAGBASE+42)        /* Texture coordinates */
  172 #define RND_BGColor             (RND_TAGBASE+43)        /* backcolor for filling */
  173 #define RND_BGPen               (RND_TAGBASE+44)        /* backpen for filling */
  174 
  175 
  176 /************************************************************************
  177 
  178 	alpha-channel and masking
  179 
  180 ************************************************************************/
  181 
  182 #define RND_AlphaChannel        (RND_TAGBASE+32)        /* custom alpha-channel */
  183 #define RND_AlphaModulo         (RND_TAGBASE+33)        /* bytes between alpha-channel pixels */
  184 #define RND_AlphaWidth          (RND_TAGBASE+34)        /* width of alpha-channel array */
  185 #define RND_MaskRGB             (RND_TAGBASE+35)        /* masking RGB for CreateAlphaArray */
  186 #define RND_MaskFalse           (RND_TAGBASE+36)        /* mask value for outside color range */
  187 #define RND_MaskTrue            (RND_TAGBASE+37)        /* mask value for inside color range */
  188 
  189 #define RND_SourceWidth2        (RND_TAGBASE+38)        /* total source width for 3channel operations */
  190 #define RND_AlphaChannel2       (RND_TAGBASE+39)        /* second custom alpha-channel */
  191 #define RND_AlphaModulo2        (RND_TAGBASE+40)        /* pixel modulo for a second alpha-channel */
  192 #define RND_AlphaWidth2         (RND_TAGBASE+41)        /* width of a second alpha-channel array */
  193 
  194 
  195 /************************************************************************
  196 
  197 	PixelFormat
  198 
  199 ************************************************************************/
  200 
  201 #define RND_PixelFormat         (RND_TAGBASE+25)        /* pixel format, see below */
  202 
  203 #define PIXFMTB_CHUNKY          3
  204 #define PIXFMTB_BITMAP          4
  205 #define PIXFMTB_RGB             5
  206 
  207 #define PIXFMT_CHUNKY_CLUT      ((1L << PIXFMTB_CHUNKY) + COLORMODE_CLUT)
  208 #define PIXFMT_0RGB_32          ((1L << PIXFMTB_RGB) + 0)
  209 
  210 /*
  211  *	these types are currently not used by render.library, but
  212  *	some of them are applicable for guigfx.library functions:
  213  */
  214 
  215 #define PIXFMT_CHUNKY_HAM8      ((1L << PIXFMTB_CHUNKY) + COLORMODE_HAM8)
  216 #define PIXFMT_CHUNKY_HAM6      ((1L << PIXFMTB_CHUNKY) + COLORMODE_HAM6)
  217 #define PIXFMT_BITMAP_CLUT      ((1L << PIXFMTB_BITMAP) + COLORMODE_CLUT)
  218 #define PIXFMT_BITMAP_HAM8      ((1L << PIXFMTB_BITMAP) + COLORMODE_HAM8)
  219 #define PIXFMT_BITMAP_HAM6      ((1L << PIXFMTB_BITMAP) + COLORMODE_HAM6)
  220 
  221 #define PIXFMT_RGB_24           ((1L << PIXFMTB_RGB) + 1)
  222 
  223 /*
  224  *	strictly internal:
  225  */
  226 
  227 #define PIXFMT_BITMAP_RGB       ((1L << PIXFMTB_BITMAP) + (1L << PIXFMTB_RGB))
  228 
  229 
  230 /************************************************************************
  231 
  232 	ExtractPalette return codes
  233 
  234 	You must at least check for EXTP_SUCCESS.
  235 	EXTP_NO_DATA indicates that there were no colors
  236 	in the histogram.
  237 
  238 ************************************************************************/
  239 
  240 #define EXTP_SUCCESS            0
  241 #define EXTP_NOT_ENOUGH_MEMORY  1
  242 #define EXTP_CALLBACK_ABORTED   2
  243 #define EXTP_NO_DATA            3
  244 
  245 
  246 /************************************************************************
  247 
  248 	AddRGB, AddRGBImage and AddChunkyImage return codes
  249 
  250 	You must at least check for ADDH_SUCCESS.
  251 	If not delivered, the histogram might be
  252 	inaccurate.
  253 
  254 ************************************************************************/
  255 
  256 #define ADDH_SUCCESS            0
  257 #define ADDH_NOT_ENOUGH_MEMORY  1
  258 #define ADDH_CALLBACK_ABORTED   2
  259 #define ADDH_NO_DATA            3
  260 
  261 
  262 /************************************************************************
  263 
  264 	Render return codes
  265 
  266 	You must at least check for REND_SUCCESS.
  267 	If not delivered, the image has not been
  268 	rendered completely.
  269 
  270 ************************************************************************/
  271 
  272 #define REND_SUCCESS            0
  273 #define REND_NOT_ENOUGH_MEMORY  1
  274 #define REND_CALLBACK_ABORTED   2
  275 #define REND_NO_VALID_PALETTE   3
  276 #define REND_NO_DATA            3
  277 
  278 
  279 /************************************************************************
  280 
  281 	SortPalette return codes
  282 
  283 	You must at least check for SORTP_SUCCESS.
  284 	SORTP_NO_DATA indicates that there were data missing,
  285 	e.g. you specified no histogram or the histogram was empty.
  286 
  287 ************************************************************************/
  288 
  289 #define SORTP_SUCCESS           0
  290 #define SORTP_NO_DATA           1
  291 #define SORTP_NOT_ENOUGH_MEMORY 2
  292 #define SORTP_NOT_IMPLEMENTED   3
  293 
  294 
  295 /************************************************************************
  296 
  297 	conversion return codes
  298 
  299 	These return codes apply to conversion functions
  300 	such as Chunky2RGB and ConvertChunky.
  301 
  302 ************************************************************************/
  303 
  304 #define CONV_SUCCESS            0
  305 #define CONV_CALLBACK_ABORTED   1
  306 #define CONV_NOT_ENOUGH_MEMORY  2
  307 #define CONV_NO_DATA            3
  308 
  309 
  310 /***********************************************************************/
  311 
  312 #endif /* RENDER_RENDER_H */