Canon - offset in color filter array

Hi,

When I use image demosaicing with color filter array got by LibRaw::COLOR(row, column) most outputs looks consistent apart from some Canon images, which looks too purple.
For those files obtained color filter array (by COLOR(row, col)) looks like simple RGGB:
R G
G B
However if I use row offset instead:
G B
R G
the results seems to be OK.
Does LibRaw return correct cfa pattern for those files?

Example files:
https://drive.google.com/open?id=0B6ENEUKTZp-LNWtmdUE4TWs0bWs (Canon EOS 60D)
https://drive.google.com/open?id=0B6ENEUKTZp-LcDJtSF81YlZabEE (Canon EOS 1Ds Mark II)

Thank you,
Konrad

Forums: 

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

Thank you!

Thank you!