I want to read RGB values of a pixel in C#, I tried using following code found here.
int[] raster = new int[height*width];
var b = tiffreader.ReadRGBAImage(width, height, raster);
for (int i = 0; i < width; ++i)
for (int j = 0; j < height; ++j)
{
int offset = (height - j - 1) * width + i;
color.R = Tiff.GetR(raster[offset]);
color.G = Tiff.GetG(raster[offset]);
color.B = Tiff.GetB(raster[offset]);
}
But I dint get What is this offset and why raster is in 1D when the Image is 2D. can some one help me in understanding the offset and raster thing in the above code.