build xyz2lab tables in im_col_*
added calls to build xyz2lab tables, thanks hkaimio
This commit is contained in:
parent
863325a257
commit
f85655052e
|
@ -56,7 +56,7 @@
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
imb_UCS2LCh( float *p, float *q, int n )
|
imb_UCS2LCh( float *p, float *q, int n )
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
for( x = 0; x < n; x++ ) {
|
for( x = 0; x < n; x++ ) {
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
|
|
||||||
float cbrt_table[QUANT_ELEMENTS];
|
float cbrt_table[QUANT_ELEMENTS];
|
||||||
|
|
||||||
void
|
static void
|
||||||
imb_XYZ2Lab_tables( void )
|
imb_XYZ2Lab_tables( void )
|
||||||
{
|
{
|
||||||
static int built_tables = 0;
|
static int built_tables = 0;
|
||||||
|
@ -101,6 +101,8 @@ imb_XYZ2Lab( float *p, float *q, int n, im_colour_temperature *temp )
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
|
imb_XYZ2Lab_tables();
|
||||||
|
|
||||||
for( x = 0; x < n; x++ ) {
|
for( x = 0; x < n; x++ ) {
|
||||||
float nX, nY, nZ;
|
float nX, nY, nZ;
|
||||||
int i;
|
int i;
|
||||||
|
@ -165,7 +167,6 @@ im_XYZ2Lab_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 )
|
||||||
temp->X0 = X0;
|
temp->X0 = X0;
|
||||||
temp->Y0 = Y0;
|
temp->Y0 = Y0;
|
||||||
temp->Z0 = Z0;
|
temp->Z0 = Z0;
|
||||||
imb_XYZ2Lab_tables();
|
|
||||||
|
|
||||||
return( im__colour_unary( "im_XYZ2Lab", in, out, IM_TYPE_LAB,
|
return( im__colour_unary( "im_XYZ2Lab", in, out, IM_TYPE_LAB,
|
||||||
(im_wrapone_fn) imb_XYZ2Lab, temp, NULL ) );
|
(im_wrapone_fn) imb_XYZ2Lab, temp, NULL ) );
|
||||||
|
|
Loading…
Reference in New Issue