44 float *
X,
float *
Y,
float *
Z)
58 float L = (
float)
l * 100.0F / 65535.0F;
63 *
Y = (
L * cielab->
Y0) / 903.292F;
64 cby = 7.787F * (*
Y / cielab->
Y0) + 16.0F / 116.0F;
68 cby = (
L + 16.0F) / 116.0F;
69 *
Y = cielab->
Y0 * cby * cby * cby;
72 tmp = (
float)
a / 256.0F / 500.0F + cby;
74 *
X = cielab->
X0 * (tmp - 0.13793F) / 7.787F;
76 *
X = cielab->
X0 * tmp * tmp * tmp;
78 tmp = cby - (
float)
b / 256.0F / 200.0F;
80 *
Z = cielab->
Z0 * (tmp - 0.13793F) / 7.787F;
82 *
Z = cielab->
Z0 * tmp * tmp * tmp;
85#define RINT(R) ((uint32_t)((R) > 0 ? ((R) + 0.5) : ((R)-0.5)))
176 cielab->
X0 = refWhite[0];
177 cielab->
Y0 = refWhite[1];
178 cielab->
Z0 = refWhite[2];
189#define FIX(x) ((int32_t)((x) * (1L << SHIFT) + 0.5))
190#define ONE_HALF ((int32_t)(1 << (SHIFT - 1)))
191#define Code2V(c, RB, RW, CR) \
192 ((((c) - (int32_t)(RB)) * (float)(CR)) / \
193 (float)(((RW) - (RB) != 0) ? ((RW) - (RB)) : 1))
195#define CLAMP(f, min, max) \
196 ((!((f) >= (min))) ? (min) : (f) > (max) ? (max) : (f))
197#define HICLAMP(f, max) ((f) > (max) ? (max) : (f))
206 Cb =
CLAMP(Cb, 0, 255);
207 Cr =
CLAMP(Cr, 0, 255);
220static float CLAMPw(
float v,
float vmin,
float vmax)
256#define LumaRed luma[0]
257#define LumaGreen luma[1]
258#define LumaBlue luma[2]
264 ycbcr->
clamptab = (clamptab += 256);
265 for (
i = 0;
i < 256;
i++)
268 ycbcr->
Cr_r_tab = (
int *)(clamptab + 3 * 256);
296 for (
i = 0,
x = -128;
i < 256;
i++,
x++)
299 refBlackWhite[5] - 128.0F, 127),
300 -128.0F * 32, 128.0F * 32);
302 refBlackWhite[3] - 128.0F, 127),
303 -128.0F * 32, 128.0F * 32);
310 Code2V(
x + 128, refBlackWhite[0], refBlackWhite[1], 255),
311 -128.0F * 32, 128.0F * 32);
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
double pow(double x, double y)
for(i=0;i< ARRAY_SIZE(offsets);i++)
GLint GLint GLint GLint GLint x
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static float(__cdecl *square_half_float)(float x
float Yb2b[CIELABTORGB_TABLE_RANGE+1]
float Yr2r[CIELABTORGB_TABLE_RANGE+1]
float Yg2g[CIELABTORGB_TABLE_RANGE+1]
void TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32_t l, int32_t a, int32_t b, float *X, float *Y, float *Z)
void TIFFCIELab16ToXYZ(TIFFCIELabToRGB *cielab, uint32_t l, int32_t a, int32_t b, float *X, float *Y, float *Z)
static float CLAMPw(float v, float vmin, float vmax)
void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32_t Y, int32_t Cb, int32_t Cr, uint32_t *r, uint32_t *g, uint32_t *b)
#define Code2V(c, RB, RW, CR)
#define CLAMP(f, min, max)
int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB *ycbcr, float *luma, float *refBlackWhite)
int TIFFCIELabToRGBInit(TIFFCIELabToRGB *cielab, const TIFFDisplay *display, float *refWhite)
void TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z, uint32_t *r, uint32_t *g, uint32_t *b)
void _TIFFmemset(void *p, int v, tmsize_t c)
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
unsigned char TIFFRGBValue
#define CIELABTORGB_TABLE_RANGE
#define TIFFroundup_32(x, y)