home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / libs / renderlib / include / render / render.h next >
Encoding:
C/C++ Source or Header  |  1999-02-03  |  10.0 KB  |  314 lines

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