April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          26
RGBRGB
00
01
02
08
07
06
05
03
04
10
09
11
0
1
2
...
13
12
14
w-1
15
16
17
18
...
x
y
Pixel (x,y) de uma imagem WxH – formato PPM
unsigned char *rgb_vector;
offset=3*(w*y+x);
red   = rgb_vector[offset];
green = rgb_vector[offset+1];
blue  = rgb_vector[offset+2];
0
1
2
h-1
3
...