Add new comment

Read Fuji RAF in CFA

Hello,
I am trying to read RAF files in CFA (equivalent of dcraw -v -T -4 -o 0 -D -t 0 -k 0 -H 1). I'm using this piece of code which is working well with other pictures:

	raw->params.user_flip = 0;		/* no flip                                 */
	raw->params.output_color = 0;		/* output colorspace, 0=raw, 1=sRGB, 2=Adobe, 3=Wide, 4=ProPhoto, 5=XYZ*/
 
	raw_width = raw->sizes.raw_width;
	width = raw->sizes.width;
	height = raw->sizes.height;
	npixels = width * height;	
	left_margin = raw->rawdata.sizes.left_margin;
	top_margin = raw->rawdata.sizes.top_margin;
 
        [...]
 
	int offset = raw_width * top_margin + left_margin;	
	i = 0;
	for (row = 0; row < height; row++){
		for (col = 0; col < width; col++){
			buf[i++] = (WORD)raw->rawdata.raw_image[offset + col + (raw_width * row)] ;
		}
	}

I know that Fuji are different and need to be opened at 45deg, but I do not know how to handle this.
Width and height have right values of rotated image.

Please, could you give me a hand.
Regards,

Forums: