Merge commit 'de5f92937857cccc45080c59c6236561416e5ece' into libraw-copylib

Upgrade LibRaw to 0.21.2.
This commit is contained in:
Lawrence Lee
2023-12-31 12:52:34 -08:00
19 changed files with 150 additions and 49 deletions

View File

@@ -127,26 +127,36 @@ void LibRaw::kodak_thumb_loader()
int(*t_hist)[LIBRAW_HISTOGRAM_SIZE] =
(int(*)[LIBRAW_HISTOGRAM_SIZE])calloc(sizeof(*t_hist), 4);
float out[3], out_cam[3][4] = {{2.81761312f, -1.98369181f, 0.166078627f, 0},
{-0.111855984f, 1.73688626f, -0.625030339f, 0},
{-0.0379119813f, -0.891268849f, 1.92918086f, 0}};
for (img = imgdata.image[0], row = 0; row < S.height; row++)
for (col = 0; col < S.width; col++, img += 4)
{
out[0] = out[1] = out[2] = 0;
int c;
for (c = 0; c < 3; c++)
if (imgdata.idata.maker_index == LIBRAW_CAMERAMAKER_Canon) // Skip color conversion for canon PPM tiffs
{
for (img = imgdata.image[0], row = 0; row < S.height; row++)
for (col = 0; col < S.width; col++, img += 4)
for (int c = 0; c < P1.colors; c++)
t_hist[c][img[c] >> 3]++;
}
else
{
float out[3], out_cam[3][4] = {{2.81761312f, -1.98369181f, 0.166078627f, 0},
{-0.111855984f, 1.73688626f, -0.625030339f, 0},
{-0.0379119813f, -0.891268849f, 1.92918086f, 0}};
for (img = imgdata.image[0], row = 0; row < S.height; row++)
for (col = 0; col < S.width; col++, img += 4)
{
out[0] += out_cam[0][c] * img[c];
out[1] += out_cam[1][c] * img[c];
out[2] += out_cam[2][c] * img[c];
out[0] = out[1] = out[2] = 0;
int c;
for (c = 0; c < 3; c++)
{
out[0] += out_cam[0][c] * img[c];
out[1] += out_cam[1][c] * img[c];
out[2] += out_cam[2][c] * img[c];
}
for (c = 0; c < 3; c++)
img[c] = CLIP((int)out[c]);
for (c = 0; c < P1.colors; c++)
t_hist[c][img[c] >> 3]++;
}
for (c = 0; c < 3; c++)
img[c] = CLIP((int)out[c]);
for (c = 0; c < P1.colors; c++)
t_hist[c][img[c] >> 3]++;
}
}
// from gamma_lut
int(*save_hist)[LIBRAW_HISTOGRAM_SIZE] =