|
|
@ -273,7 +273,7 @@ void CLASS canon_600_load_raw()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
black += pixel[col];
|
|
|
|
black += pixel[col];
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = pixel[col];
|
|
|
|
if(dfp) *dfp = pixel[col];
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -346,7 +346,7 @@ void CLASS canon_a5_load_raw()
|
|
|
|
buf = (vbits += 16, (buf << 16) + *dp++);
|
|
|
|
buf = (vbits += 16, (buf << 16) + *dp++);
|
|
|
|
pixel = buf >> vbits & 0x3ff;
|
|
|
|
pixel = buf >> vbits & 0x3ff;
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row+top_margin,col+left_margin);
|
|
|
|
ushort *dfp = get_masked_pointer(row+top_margin,col+left_margin);
|
|
|
|
if(dfp) *dfp = pixel;
|
|
|
|
if(dfp) *dfp = pixel;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if ((unsigned) row < height && (unsigned) col < width)
|
|
|
|
if ((unsigned) row < height && (unsigned) col < width)
|
|
|
@ -619,7 +619,7 @@ void CLASS canon_compressed_load_raw()
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
for (col=0; col < raw_width; col++) {
|
|
|
|
for (col=0; col < raw_width; col++) {
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row+r,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row+r,col);
|
|
|
|
if(dfp) *dfp = pixel[r*raw_width+col];
|
|
|
|
if(dfp) *dfp = pixel[r*raw_width+col];
|
|
|
|
if (irow >= height) continue; // skip for top/bottom rows
|
|
|
|
if (irow >= height) continue; // skip for top/bottom rows
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -771,7 +771,7 @@ void CLASS lossless_jpeg_load_raw()
|
|
|
|
if (raw_width == 3984 && (col -= 2) < 0)
|
|
|
|
if (raw_width == 3984 && (col -= 2) < 0)
|
|
|
|
col += (row--,raw_width);
|
|
|
|
col += (row--,raw_width);
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if ((unsigned) (row-top_margin) < height) {
|
|
|
|
if ((unsigned) (row-top_margin) < height) {
|
|
|
@ -880,7 +880,7 @@ void CLASS adobe_copy_pixel (int row, int col, ushort **rp)
|
|
|
|
BAYER(r,c) = val;
|
|
|
|
BAYER(r,c) = val;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row+top_margin,col+left_margin);
|
|
|
|
ushort *dfp = get_masked_pointer(row+top_margin,col+left_margin);
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#else
|
|
|
@ -987,7 +987,7 @@ void CLASS pentax_k10_load_raw()
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = hpred[col & 1];
|
|
|
|
if(dfp) *dfp = hpred[col & 1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1081,7 +1081,7 @@ void CLASS nikon_compressed_load_raw()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = xval;
|
|
|
|
if(dfp) *dfp = xval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1251,7 +1251,7 @@ void CLASS fuji_load_raw()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = pixel[col];
|
|
|
|
if(dfp) *dfp = pixel[col];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1330,7 +1330,7 @@ void CLASS rollei_load_raw()
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(todo[i] / raw_width,todo[i] % raw_width);
|
|
|
|
ushort *dfp = get_masked_pointer(todo[i] / raw_width,todo[i] % raw_width);
|
|
|
|
if(dfp) *dfp = (todo[i+1] & 0x3ff);
|
|
|
|
if(dfp) *dfp = (todo[i+1] & 0x3ff);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1553,7 +1553,7 @@ void CLASS phase_one_load_raw()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (col=0; col < raw_width; col++)
|
|
|
|
for (col=0; col < raw_width; col++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp)
|
|
|
|
if(dfp)
|
|
|
|
*dfp = pixel[col];
|
|
|
|
*dfp = pixel[col];
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -1608,9 +1608,9 @@ void CLASS phase_one_load_raw_c()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
read_shorts ((ushort *) t_black[0], raw_height*2);
|
|
|
|
read_shorts ((ushort *) t_black[0], raw_height*2);
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
imgdata.tqmasked_pixels.ph1_black = (ushort (*)[2])calloc(raw_height*2,sizeof(ushort));
|
|
|
|
imgdata.masked_pixels.ph1_black = (ushort (*)[2])calloc(raw_height*2,sizeof(ushort));
|
|
|
|
merror (imgdata.tqmasked_pixels.ph1_black, "phase_one_load_raw_c()");
|
|
|
|
merror (imgdata.masked_pixels.ph1_black, "phase_one_load_raw_c()");
|
|
|
|
memmove(imgdata.tqmasked_pixels.ph1_black,(ushort *) t_black[0],raw_height*2*sizeof(ushort));
|
|
|
|
memmove(imgdata.masked_pixels.ph1_black,(ushort *) t_black[0],raw_height*2*sizeof(ushort));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i=0; i < 256; i++)
|
|
|
|
for (i=0; i < 256; i++)
|
|
|
@ -1662,7 +1662,7 @@ void CLASS phase_one_load_raw_c()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(i>0 && dfp) *dfp = i;
|
|
|
|
if(i>0 && dfp) *dfp = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1675,7 +1675,7 @@ void CLASS phase_one_load_raw_c()
|
|
|
|
- ph1.t_black + t_black[row][(col+left_margin) >= ph1.split_col];
|
|
|
|
- ph1.t_black + t_black[row][(col+left_margin) >= ph1.split_col];
|
|
|
|
if (i > 0)
|
|
|
|
if (i > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = i;
|
|
|
|
if(dfp) *dfp = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1719,7 +1719,7 @@ void CLASS hasselblad_load_raw()
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row+top_margin,col+left_margin);
|
|
|
|
ushort *dfp = get_masked_pointer(row+top_margin,col+left_margin);
|
|
|
|
if(dfp) *dfp = pred[i];
|
|
|
|
if(dfp) *dfp = pred[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1833,7 +1833,7 @@ void CLASS packed_12_load_raw()
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = bitbuf << (52-vbits) >> 52;
|
|
|
|
if(dfp) *dfp = bitbuf << (52-vbits) >> 52;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1871,7 +1871,7 @@ void CLASS unpacked_load_raw()
|
|
|
|
//fseek (ifp, 2*(raw_width - width), SEEK_CUR);
|
|
|
|
//fseek (ifp, 2*(raw_width - width), SEEK_CUR);
|
|
|
|
for (col=0; col < raw_width; col++)
|
|
|
|
for (col=0; col < raw_width; col++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp)
|
|
|
|
if(dfp)
|
|
|
|
*dfp = pixel[col];
|
|
|
|
*dfp = pixel[col];
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -1904,7 +1904,7 @@ void CLASS nokia_load_raw()
|
|
|
|
int col;
|
|
|
|
int col;
|
|
|
|
for(col=0;col<width;col++)
|
|
|
|
for(col=0;col<width;col++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp)
|
|
|
|
if(dfp)
|
|
|
|
*dfp = pixel[col];
|
|
|
|
*dfp = pixel[col];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1969,7 +1969,7 @@ void CLASS panasonic_load_raw()
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
if(col>=width)
|
|
|
|
if(col>=width)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp)*dfp = pred[col & 1];
|
|
|
|
if(dfp)*dfp = pred[col & 1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -2008,7 +2008,7 @@ void CLASS olympus_e300_load_raw()
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
for (col=0; col < raw_width; col++)
|
|
|
|
for (col=0; col < raw_width; col++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp)
|
|
|
|
if(dfp)
|
|
|
|
*dfp = (pixel[col] & 0xfff);
|
|
|
|
*dfp = (pixel[col] & 0xfff);
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -2445,14 +2445,14 @@ void CLASS eight_bit_load_raw()
|
|
|
|
BAYER(row,col-left_margin) = val;
|
|
|
|
BAYER(row,col-left_margin) = val;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
lblack += val;
|
|
|
|
lblack += val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else // top/bottom margins
|
|
|
|
else // top/bottom margins
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2547,7 +2547,7 @@ void CLASS kodak_262_load_raw()
|
|
|
|
black += val;
|
|
|
|
black += val;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
if(dfp) *dfp = val;
|
|
|
|
black += val;
|
|
|
|
black += val;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2741,12 +2741,12 @@ void CLASS sony_load_raw()
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
for (col=0; col < left_margin; col++)
|
|
|
|
for (col=0; col < left_margin; col++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = ntohs(pixel[col]);
|
|
|
|
if(dfp) *dfp = ntohs(pixel[col]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (col=left_margin+width; col < raw_width; col++)
|
|
|
|
for (col=left_margin+width; col < raw_width; col++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = ntohs(pixel[col]);
|
|
|
|
if(dfp) *dfp = ntohs(pixel[col]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -2782,7 +2782,7 @@ void CLASS sony_arw_load_raw()
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row,col);
|
|
|
|
ushort *dfp = get_masked_pointer(row,col);
|
|
|
|
if(dfp) *dfp = sum;
|
|
|
|
if(dfp) *dfp = sum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -2903,7 +2903,7 @@ void CLASS smal_decode_segment (unsigned seg[2][2], int holes)
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
#ifdef LIBRAW_LIBRARY_BUILD
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ushort *dfp = get_tqmasked_pointer(row+top_margin,col+left_margin);
|
|
|
|
ushort *dfp = get_masked_pointer(row+top_margin,col+left_margin);
|
|
|
|
if(dfp) *dfp = pred[pix &1];
|
|
|
|
if(dfp) *dfp = pred[pix &1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|