Add new comment

Sorry, API documentation is

Sorry, API documentation is incomplete for COLOR() call and needs to be updated.

the row,col parameters you feed to COLOR() call should be relative to image visible area, not full sensor area.

So, the intended use is (pseudocode, there is no raw_image call!)

  for(row = 0; row < height; row++)
     for(col = 0; col < width; col++)
{ 
     color = COLOR(row,col);
     data[... ][color] = raw_image(row+top_margin, col+left_margin);
 }

For most cameras this does not matter because top_margin,left_margin are multiple of 2, but both 60D and 1Ds2 use odd top_margin.

-- Alex Tutubalin @LibRaw LLC