LibRaw technical support

Stable LibRaw versions: technical support, errors, API questions

White balance scaling and values in pre_mul array

I'm doing white balance scaling on the raw data I've retrieved based on the values in imgdata.color.pre_mul

Processing data from a Pentax K-5 I'm seeing the following in pre_mul after calling unpack():

White balance co-efficients being used are 2.155461, 0.926686, 1.305787, 0.000000

I'm slightly surprised to see that a) the second value isn't 1.0, and b) that the fourth value is zero.

Forums: 

Fujitsu Super-CCD files not processed "correctly"

A Fujitsu RAF file from a Super-CCD sensor camera contains two images. One has the data from the larger more sensitive "S" sensels, the other for the smaller, less sensitive "R" sensels. These are supposed to be HDR combined while processing the file. Please refer to the discussion at https://translate.google.ie/translate?sl=auto&tl=en&u=http%3A%2F%2Fwww.g... for an overview of this.

Forums: 

Processing Fuji raw_image

By code to process the raw_image array looks like this:

#define RAW(row,col) \
	RawData.raw_image[(row)*S.raw_width+(col)]
 
for (row = 0; row < S.height; row++)
{
	for (col = 0; col < S.width; col++)
	{
           unsigned short val = 
              RAW(row + S.top_margin, col + S.left_margin);
           // etc ...
        }
}

This works very well for Canon raw images, but totally falls apart when processing a Fuji RAF file from an S5-Pro.

Forums: 

color.maximum and camera white level

Is the value in color.maximum the camera white level ("full well" or saturation value)? If so I am a bit confused as the data I'm testing with appears to contain pixel values that are greater than color.maximum (after subtraction of dark level).

To be more specific I'm using a CR2 file from a Canon EOS 60Da where color.maximum is showing up as 12279 but the largest pixel value in raw_image (ignoring the frame) is 13259 (after subtraction of dark value of 2047).

If color.maximum isn't the white level, is the white level for the camera available in libraw?

Forums: 

IsCameraSupported() ?

Is there a way to determine (after calling open_file() or unpack()) whether or not the camera that created the file is supported or not.

If all else fails I suppose I can iterate through all the supported camera names and say it's not supported if I can't find it. However I'm guessing the either open_file() or unpack() probably check whether the camera's supported anyway so this information might be available?

Thanks

Forums: 

Equivalent of scale_colors() for raw_image

I'm starting a new thread for this.

AFAICT the difference between dcraw -d and dcraw -D isn't just black subraction. It would seem the dcraw-d calls scale_colors() on the image.

This appears to operates on an (internal?) 4 component image array rather than on the single component raw_image and the code is (to say the least) somewhat complex.

I'm not an expert on image processing - just trying to convert some existing code to use libraw instead of the orphaned dcraw, so can you recommend how best to scale the raw image in this case.

Sorry if I'm being a pain.

Forums: 

Capturing libraw output as if PGM/PPM data

Some code I am working on uses file i/o redirection and calls the old dcraw under the covers.

Depending on the processing options passed to dcraw, the ouput is passed to the code by the following:

// Intercept the fprintf calls in write_ppm_tiff() for PGM/PPM file output.
int Printf(const char *format, va_list va) // intercepts the fprintf calls in write_ppm_tiff()
{
int nResult;
CString strText;

strText.FormatV(format, va);
nResult = strText.GetLength();

AddToBuffer(strText.GetBuffer(10000), nResult);

Forums: 

Pages

Subscribe to RSS - LibRaw technical support