jcparam.c
/*
 * Select an appropriate JPEG colorspace for in_color_space.
 */
Select an appropriate JPEG colorspace for in_color_space.
Select an appropriate JPEG colorspace for in_color_space .
GLOBAL(void)
jpeg_default_colorspace (j_compress_ptr cinfo)
{
  switch (cinfo->in_color_space) {
  case JCS_GRAYSCALE:
    jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
    break;
  case JCS_RGB:
  case JCS_EXT_RGB:
  case JCS_EXT_RGBX:
  case JCS_EXT_BGR:
  case JCS_EXT_BGRX:
  case JCS_EXT_XBGR:
  case JCS_EXT_XRGB:
  case JCS_EXT_RGBA:
  case JCS_EXT_BGRA:
  case JCS_EXT_ABGR:
  case JCS_EXT_ARGB:
    jpeg_set_colorspace(cinfo, JCS_YCbCr);
    break;
  case JCS_YCbCr:
    jpeg_set_colorspace(cinfo, JCS_YCbCr);
    break;
  case JCS_CMYK:
    jpeg_set_colorspace(cinfo, JCS_CMYK); 
    break;
  case JCS_YCCK:
    jpeg_set_colorspace(cinfo, JCS_YCCK);
    break;
  case JCS_UNKNOWN:
    jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
    break;
  default:
    ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
  }
}
GLOBAL ( void ) jpeg_default_colorspace ( j_compress_ptr cinfo ) { switch ( cinfo -> in_color_space ) { case JCS_GRAYSCALE : jpeg_set_colorspace ( cinfo , JCS_GRAYSCALE ) ; break ; case JCS_RGB : case JCS_EXT_RGB : case JCS_EXT_RGBX : case JCS_EXT_BGR : case JCS_EXT_BGRX : case JCS_EXT_XBGR : case JCS_EXT_XRGB : case JCS_EXT_RGBA : case JCS_EXT_BGRA : case JCS_EXT_ABGR : case JCS_EXT_ARGB : jpeg_set_colorspace ( cinfo , JCS_YCbCr ) ; break ; case JCS_YCbCr : jpeg_set_colorspace ( cinfo , JCS_YCbCr ) ; break ; case JCS_CMYK : jpeg_set_colorspace ( cinfo , JCS_CMYK ) ; break ; case JCS_YCCK : jpeg_set_colorspace ( cinfo , JCS_YCCK ) ; break ; case JCS_UNKNOWN : jpeg_set_colorspace ( cinfo , JCS_UNKNOWN ) ; break ; default : ERREXIT ( cinfo , JERR_BAD_IN_COLORSPACE ) ; } }
Select an appropriate JPEG colorspace for in_color_space.
Select an appropriate JPEG colorspace for in_color_space .
/* By default, no translation */