home *** CD-ROM | disk | FTP | other *** search
/ IRIS Development Option 6.2 / IRIS_Development_Option_6.2_814-0478-001.iso / dist / dmedia_dev.idb / usr / include / dmedia / dm_color.h.z / dm_color.h
C/C++ Source or Header  |  1996-03-14  |  8KB  |  207 lines

  1. /*
  2.  * dm_color.h
  3.  *
  4.  *    Man pages for the Color Space Library can be obtained by: man dmColor
  5.  *
  6.  * Copyright 1995, Silicon Graphics, Inc.
  7.  * ALL RIGHTS RESERVED
  8.  *
  9.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  10.  * States.   Use of a copyright notice is precautionary only and does not
  11.  * imply publication or disclosure.
  12.  *
  13.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  14.  * Use, duplication or disclosure by the Government is subject to restrictions
  15.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  16.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  17.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  18.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  19.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  20.  *
  21.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  22.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  23.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  24.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  25.  * GRAPHICS, INC.
  26.  */
  27.  
  28. /*
  29.  *
  30.  * The Color Space Library supports the following tokens defined in dm_image.h:
  31.  *
  32.  * DM_IMAGE_WIDTH
  33.  * DM_IMAGE_HEIGHT
  34.  * DM_IMAGE_PACKING:     DM_IMAGE_PACKING_RGB
  35.  *                       DM_IMAGE_PACKING_BGR
  36.  *                       DM_IMAGE_PACKING_RGBX
  37.  *                       DM_IMAGE_PACKING_RGBA
  38.  *                       DM_IMAGE_PACKING_XRGB
  39.  *                       DM_IMAGE_PACKING_ARGB
  40.  *                       DM_IMAGE_PACKING_XBGR
  41.  *                       DM_IMAGE_PACKING_ABGR
  42.  *                       DM_IMAGE_PACKING_XRGB1555
  43.  *                       DM_IMAGE_PACKING_CbYCr
  44.  *                       DM_IMAGE_PACKING_CbYCrA
  45.  *                       DM_IMAGE_PACKING_CbYCrY
  46.  *                       DM_IMAGE_PACKING_CbYCrYYY
  47.  *                       DM_IMAGE_PACKING_LUMINANCE
  48.  * DM_IMAGE_DATATYPE:    DM_IMAGE_DATATYPE_BIT
  49.  *                       DM_IMAGE_DATATYPE_CHAR
  50.  *                       DM_IMAGE_DATATYPE_SHORT10L
  51.  *                       DM_IMAGE_DATATYPE_SHORT10R
  52.  *                       DM_IMAGE_DATATYPE_SHORT12L
  53.  *                       DM_IMAGE_DATATYPE_SHORT12R
  54.  * DM_IMAGE_ORDER:       DM_IMAGE_ORDER_INTERLEAVED
  55.  *                       DM_IMAGE_ORDER_SEQUENTIAL
  56.  *                       DM_IMAGE_ORDER_SEPARATE
  57.  * DM_IMAGE_ORIENTATION: DM_IMAGE_TOP_TO_BOTTOM
  58.  *                       DM_IMAGE_BOTTOM_TO_TOP
  59.  * DM_IMAGE_MIRROR:      DM_IMAGE_LEFT_TO_RIGHT
  60.  *                       DM_IMAGE_RIGHT_TO_LEFT
  61.  * DM_IMAGE_COMPONENT_1
  62.  * DM_IMAGE_COMPONENT_2
  63.  * DM_IMAGE_COMPONENT_3
  64.  * DM_IMAGE_COMPONENT_ALPHA
  65.  * DM_IMAGE_COMPONENT_ALL
  66.  * DM_IMAGE_BIAS
  67.  * DM_IMAGE_SCALE
  68.  * DM_IMAGE_MIN
  69.  * DM_IMAGE_MAX
  70.  * DM_IMAGE_GAMMA
  71.  * DM_IMAGE_GAMMA_TB
  72.  * DM_IMAGE_GAMMA_TS
  73.  * DM_IMAGE_GAMMA_A
  74.  * DM_IMAGE_GAMMA_B
  75.  * DM_IMAGE_GAMMA_C
  76.  *
  77.  */
  78.  
  79. #ifndef __DM_COLOR_H__
  80. #define __DM_COLOR_H__
  81.  
  82. #ifdef __cplusplus
  83. extern "C" {
  84. #endif
  85.  
  86. #ident "$Revision: 1.6 $"
  87.  
  88. #include <dmedia/dmedia.h>
  89. #include <dmedia/dm_image.h>
  90. #include <dmedia/dm_params.h>
  91.  
  92.  
  93. /*************
  94. *
  95. * dmColor subsampling filter types
  96. *
  97. *************/
  98. #define DM_COLOR_SUBSAMPLINGFILTER_TYPE0  10001  /* Replication/elimination of chroma.  */
  99. #define DM_COLOR_SUBSAMPLINGFILTER_TYPE1  10002  /* Linear interpolation/extrapolation. */
  100. #define DM_COLOR_SUBSAMPLINGFILTER_TYPE2  10003  /* Recommended CCIR filters.           */
  101.  
  102.  
  103. /*************
  104. *
  105. * dmColor errors
  106. *
  107. *************/
  108. #define DM_COLOR_ERROR_NONE                1001  /* "No error."                         */
  109. #define DM_COLOR_ERROR_OUT_OF_MEMORY       1002  /* "Out of memory!"                    */
  110. #define DM_COLOR_ERROR_INVALID_CONVERTER   1003  /* "Invalid converter!"                */
  111. #define DM_COLOR_ERROR_INVALID_SRC         1004  /* "Invalid source pointer!"           */
  112. #define DM_COLOR_ERROR_INVALID_DST         1005  /* "Invalid destination pointer!"      */
  113. #define DM_COLOR_ERROR_INVALID_TOKEN       1006  /* "Invalid token!"                    */
  114. #define DM_COLOR_ERROR_INVALID_VALUE       1007  /* "Invalid value!"                    */
  115. #define DM_COLOR_ERROR_INVALID_DIMENSION   1008  /* "Invalid dimension!"                */
  116. #define DM_COLOR_ERROR_INVALID_TRANSFORM   1009  /* "Invalid transform!"                */
  117.  
  118.  
  119. typedef struct _DMcolorconverter* DMcolorconverter;
  120.  
  121.  
  122. /*************
  123. *
  124. * dmColor set/get source and destination image parameters
  125. *
  126. *************/
  127. extern DMstatus dmColorSetSrcParams  (const DMcolorconverter converter,
  128.                                             DMparams        *imageParams);
  129. extern DMstatus dmColorSetDstParams  (const DMcolorconverter converter,
  130.                                             DMparams        *imageParams);
  131. extern DMstatus dmColorGetSrcParams  (const DMcolorconverter converter,
  132.                                             DMparams        *imageParams);
  133. extern DMstatus dmColorGetDstParams  (const DMcolorconverter converter,
  134.                                             DMparams        *imageParams);
  135.  
  136.  
  137. /*************
  138. *
  139. * dmColor set/get transform parameters
  140. *
  141. *************/
  142. extern DMstatus dmColorSetContrast          (const DMcolorconverter converter,
  143.                                              const float            contrast);
  144. extern DMstatus dmColorSetBrightness        (const DMcolorconverter converter, 
  145.                                              const float            brightness);
  146. extern DMstatus dmColorSetSaturation        (const DMcolorconverter converter,
  147.                                              const float            saturation);
  148. extern DMstatus dmColorSetHue               (const DMcolorconverter converter,
  149.                                              const float            hue);
  150. extern DMstatus dmColorSetDefaultAlpha      (const DMcolorconverter converter, 
  151.                                              const float            defaultAlpha);
  152. extern DMstatus dmColorSetSubsamplingFilter (const DMcolorconverter converter,
  153.                                              const int              subsamplingFilter);
  154.  
  155. extern DMstatus dmColorGetContrast          (const DMcolorconverter converter,
  156.                                                    float           *contrast);
  157. extern DMstatus dmColorGetBrightness        (const DMcolorconverter converter,
  158.                                                    float           *brightness);
  159. extern DMstatus dmColorGetSaturation        (const DMcolorconverter converter,
  160.                                                    float           *saturation);
  161. extern DMstatus dmColorGetHue               (const DMcolorconverter converter,
  162.                                                    float           *hue);
  163. extern DMstatus dmColorGetDefaultAlpha      (const DMcolorconverter converter,
  164.                                                    float           *defaultAlpha);
  165. extern DMstatus dmColorGetSubsamplingFilter (const DMcolorconverter converter,
  166.                                                    int             *subsamplingFilter);
  167.  
  168.  
  169. /*************
  170. *
  171. * dmColor get source/destination image size (bytes)
  172. *
  173. *************/
  174. extern DMstatus dmColorGetSrcSize (const DMcolorconverter converter,
  175.                                          int             *size);
  176. extern DMstatus dmColorGetDstSize (const DMcolorconverter converter,
  177.                                          int             *size);
  178.  
  179.  
  180. /*************
  181. *
  182. * dmColor manager routines
  183. *
  184. *************/
  185. extern DMstatus dmColorCreate            (DMcolorconverter *converter);
  186. extern DMstatus dmColorDestroy     (const DMcolorconverter  converter);
  187. extern DMstatus dmColorPrecompute  (const DMcolorconverter  converter);
  188. extern DMstatus dmColorConvert     (const DMcolorconverter  converter,
  189.                                           void             *srcImage,
  190.                                           void             *dstImage);
  191.  
  192. /*************
  193. *
  194. * dmColor error handling routines
  195. *
  196. *************/
  197. extern DMstatus    dmColorGetError       (const DMcolorconverter converter,
  198.                                                 int             *error);
  199. extern const char *dmColorGetErrorString (const int              error);
  200.  
  201.  
  202. #ifdef __cplusplus
  203. }
  204. #endif
  205.  
  206. #endif /* !__DM_COLOR_H__ */
  207.