home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / powerd / modules.lha / modules / render / render.m < prev    next >
Encoding:
Text File  |  2000-09-26  |  8.4 KB  |  199 lines

  1. /*
  2. **    $VER: render.h 29.1 (3.2.99)
  3. **
  4. **    render.library definitions
  5. */
  6. MODULE    'utility/tagitem'
  7. #define RND_TAGBASE     (TAG_USER+$1000)
  8. /************************************************************************
  9.  
  10.     memhandler
  11.  
  12. ************************************************************************/
  13. #define RND_MemType         (RND_TAGBASE+1)    /* type of memhandler, see below */
  14. #define RND_MemBlock     (RND_TAGBASE+2)    /* ptr to block of memory */
  15. #define RND_MemSize         (RND_TAGBASE+3)    /* size of memblock [bytes] */
  16. #define RND_MemFlags     (RND_TAGBASE+18)    /* memflags (exec/memory.h) */
  17. #define RND_RMHandler     (RND_TAGBASE+12)    /* to pass a memhandler as an argument */
  18. /*
  19.  *    memhandler types
  20.  */
  21. #define RMHTYPE_POOL         1                /* v39 exec dynamic pool */
  22. #define RMHTYPE_PRIVATE     2                /* private memory pool */
  23. #define RMHTYPE_PUBLIC         3                /* common public memory */
  24. /************************************************************************
  25.  
  26.     palette
  27.  
  28. ************************************************************************/
  29. #define RND_PaletteFormat     (RND_TAGBASE+19)    /* palette import/export format */
  30. #define RND_EHBPalette         (RND_TAGBASE+22)    /* tag to indicate a palette is EHB */
  31. #define RND_FirstColor         (RND_TAGBASE+23)    /* first palette entry */
  32. #define RND_NewPalette         (RND_TAGBASE+24)    /* dispose the old palette and load a new one */
  33. #define RND_RGBWeight         (RND_TAGBASE+11)    /* quantization factors */
  34. /*
  35.  *    palette format types
  36.  */
  37. #define PALFMT_RGB32         1                    /* ULONG red,green,blue */
  38. #define PALFMT_RGB8             2                    /* ULONG 0x00rrggbb */
  39. #define PALFMT_RGB4             3                    /* UWORD 0xrgb */
  40. #define PALFMT_PALETTE         4                    /* render.library palette */
  41. /*
  42.  *    palette sort mode types
  43.  *    for the use with SortPalette()
  44.  */
  45. /* no particular order */
  46. CONST    PALMODE_NONE=0
  47. /* sort palette entries by brightness */
  48. CONST    PALMODE_BRIGHTNESS=1
  49. /* sort palette entries by the number of pixels that they represent.
  50.    You must supply the RND_Histogram taglist argument. */
  51. CONST    PALMODE_POPULARITY=2
  52. /* sort palette entries by the number of histogram entries that they
  53.    represent. You must supply the RND_Histogram taglist argument. */
  54. CONST    PALMODE_REPRESENTATION=3
  55. /* sort palette entries by their optical significance for the human
  56.    eye. Implementation is unknown to you and may change.
  57.    You must supply the RND_Histogram taglist argument. */
  58. CONST    PALMODE_SIGNIFICANCE=4
  59. /* sort palette entries by color intensity */
  60. CONST    PALMODE_SATURATION=5
  61. /* By default, sort direction is descending, i.e. the precedence is
  62.    more-to-less. Combine with this flag to invert the sort direction. */
  63. CONST    PALMODE_ASCENDING=8
  64. /************************************************************************
  65.  
  66.     histogram related
  67.  
  68. ************************************************************************/
  69. #define RND_HSType             (RND_TAGBASE+4)        /* histogram type, see below */
  70. #define RND_Histogram         (RND_TAGBASE+9)        /* a histogram as an argument */
  71. /*
  72.  *    Histogram / Palette types
  73.  *    to be specified with RND_HSType
  74.  */
  75. #define HSTYPE_12BIT         4                    /* 12bit dynamic histogram */
  76. #define HSTYPE_15BIT         5                    /* 15bit dynamic histogram */
  77. #define HSTYPE_18BIT         6                    /* 18bit dynamic histogram */
  78. #define HSTYPE_21BIT         7                    /* 21bit dynamic histogram */
  79. #define HSTYPE_24BIT         8                    /* 24bit dynamic histogram */
  80. #define HSTYPE_12BIT_TURBO 20                    /* 12bit tabular histogram */
  81. #define HSTYPE_15BIT_TURBO 21                    /* 15bit tabular histogram */
  82. #define HSTYPE_18BIT_TURBO 22                    /* 18bit tabular histogram */
  83. /*
  84.  *    tags that can be queried via QueryHistogram()
  85.  */
  86. #define RND_NumPixels         (RND_TAGBASE+5)        /* # pixels in a histogram */
  87. #define RND_NumColors         (RND_TAGBASE+6)        /* # colors in a histogram */
  88. /************************************************************************
  89.  
  90.     rendering and conversions
  91.  
  92. ************************************************************************/
  93. #define RND_ColorMode         (RND_TAGBASE+7)        /* color mode, see below */
  94. #define RND_DitherMode         (RND_TAGBASE+8)        /* dither mode, see below */
  95. #define RND_DitherAmount     (RND_TAGBASE+26)    /* dither amount */
  96. #define RND_OffsetColorZero     (RND_TAGBASE+10)    /* first color index to be output */
  97. /*
  98.  *    color mode types
  99.  *    to be specified with RND_ColorMode
  100.  */
  101. #define COLORMODE_CLUT         $0000                    /* normal palette lookup */
  102. #define COLORMODE_HAM8         $0001                    /* HAM8 mode */
  103. #define COLORMODE_HAM6         $0002                    /* HAM6 mode */
  104. #define COLORMODE_MASK         $0003                    /* mask to determine COLORMODE */
  105. /*
  106.  *    dither mode types
  107.  *    to be specified with RND_DitherMode
  108.  */
  109. #define DITHERMODE_NONE     $0000                    /* no dither */
  110. #define DITHERMODE_FS         $0001                    /* Floyd-Steinberg dither */
  111. #define DITHERMODE_RANDOM     $0002                    /* random dither. amount required. */
  112. #define DITHERMODE_EDD         $0003                    /* EDD dither */
  113. /************************************************************************
  114.  
  115.     miscellaneous
  116.  
  117. ************************************************************************/
  118. #define RND_ProgressHook     (RND_TAGBASE+13)    /* progress callback hook */
  119. #define RND_SourceWidth     (RND_TAGBASE+14)    /* total input width [pixels] */
  120. #define RND_DestWidth         (RND_TAGBASE+15)    /* total output width [pixels] */
  121. #define RND_PenTable         (RND_TAGBASE+16)    /* ptr to a chunky conversion table */
  122. #define RND_LeftEdge         (RND_TAGBASE+17)    /* chunky data left edge [pixels] */
  123. #define RND_LineHook          (RND_TAGBASE+20)    /* line callback hook */
  124. #define RND_MapEngine         (RND_TAGBASE+27)    /* Mapping-Engine */
  125. #define RND_Interleave         (RND_TAGBASE+28)    /* Interleave */
  126. #define RND_Palette             (RND_TAGBASE+29)    /* Palette */
  127. #define RND_Weight             (RND_TAGBASE+30)    /* Weight factor */
  128. #define RND_ScaleEngine     (RND_TAGBASE+31)    /* ScaleEngine */
  129. #define RND_DestCoordinates     (RND_TAGBASE+42)    /* Texture coordinates */
  130. #define RND_BGColor             (RND_TAGBASE+43)    /* backcolor for filling */
  131. #define RND_BGPen             (RND_TAGBASE+44)    /* backpen for filling */
  132. /************************************************************************
  133.  
  134.     alpha-channel and masking
  135.  
  136. ************************************************************************/
  137. #define RND_AlphaChannel     (RND_TAGBASE+32)    /* custom alpha-channel */
  138. #define RND_AlphaModulo     (RND_TAGBASE+33)    /* bytes between alpha-channel pixels */
  139. #define RND_AlphaWidth         (RND_TAGBASE+34)    /* width of alpha-channel array */
  140. #define RND_MaskRGB             (RND_TAGBASE+35)    /* masking RGB for CreateAlphaArray */
  141. #define RND_MaskFalse         (RND_TAGBASE+36)    /* mask value for outside color range */
  142. #define RND_MaskTrue         (RND_TAGBASE+37)    /* mask value for inside color range */
  143. #define RND_SourceWidth2     (RND_TAGBASE+38)    /* total source width for 3channel operations */
  144. #define RND_AlphaChannel2     (RND_TAGBASE+39)    /* second custom alpha-channel */
  145. #define RND_AlphaModulo2     (RND_TAGBASE+40)    /* pixel modulo for a second alpha-channel */
  146. #define RND_AlphaWidth2     (RND_TAGBASE+41)    /* width of a second alpha-channel array */
  147. /************************************************************************
  148.  
  149.     PixelFormat
  150.  
  151. ************************************************************************/
  152. #define RND_PixelFormat     (RND_TAGBASE+25)        /* pixel format, see below */
  153. CONST    PIXFMTB_CHUNKY=3,
  154.         PIXFMTB_BITMAP=4,
  155.         PIXFMTB_RGB=5
  156. #define PIXFMT_0RGB_32         ((1 << PIXFMTB_RGB) + 0)
  157. /*
  158.  *    these types are currently not used by render.library, but
  159.  *    some of them are applicable for guigfx.library functions:
  160.  */
  161. #define PIXFMT_CHUNKY_HAM8 ((1 << PIXFMTB_CHUNKY) + COLORMODE_HAM8)
  162. #define PIXFMT_CHUNKY_HAM6 ((1 << PIXFMTB_CHUNKY) + COLORMODE_HAM6)
  163. #define PIXFMT_BITMAP_CLUT ((1 << PIXFMTB_BITMAP) + COLORMODE_CUT)
  164. #define PIXFMT_BITMAP_HAM8 ((1 << PIXFMTB_BITMAP) + COLORMODE_HAM8)
  165. #define PIXFMT_BITMAP_HAM6 ((1 << PIXFMTB_BITMAP) + COLORMODE_HAM6)
  166. #define PIXFMT_RGB_24         ((1 << PIXFMTB_RGB) + 1)
  167. /*
  168.  *    strictly internal:
  169.  */
  170. #define PIXFMT_BITMAP_RGB     ((1 << PIXFMTB_BITMAP) + (1 << PIXFMTB_RGB))
  171. /************************************************************************
  172.  
  173.     ExtractPalette return codes
  174.  
  175.     You must at least check for EXTP_SUCCESS.
  176.     EXTP_NO_DATA indicates that there were no colors
  177.     in the histogram.
  178.  
  179. ************************************************************************/
  180. CONST    EXTP_SUCCESS=0,
  181.         EXTP_NOT_ENOUGH_MEMORY=1,
  182.         EXTP_CALLBACK_ABORTED=2,
  183.         EXTP_NO_DATA=3
  184. CONST    ADDH_SUCCESS=0,
  185.         ADDH_NOT_ENOUGH_MEMORY=1,
  186.         ADDH_CALLBACK_ABORTED=2,
  187.         ADDH_NO_DATA=3
  188. CONST    REND_SUCCESS=0,
  189.         REND_NOT_ENOUGH_MEMORY=1,
  190.         REND_CALLBACK_ABORTED=2,
  191.         REND_NO_VALID_PALETTE=3
  192. CONST    SORTP_SUCCESS=0,
  193.         SORTP_NO_DATA=1,
  194.         SORTP_NOT_ENOUGH_MEMORY=2,
  195.         SORTP_NOT_IMPLEMENTED=3
  196. CONST    CONV_SUCCESS=0,
  197.         CONV_CALLBACK_ABORTED=1,
  198.         CONV_NOT_ENOUGH_MEMORY=2
  199.