l
¡
¡
l
¡
¡
l
¡
2
(CPU)
RAMDAC
D/A
l
¡
¡
VRAM (Video RAM)
l
¡
l
(scan line)
¡
l
CG
¡
l
¡
•
CRT,
, …
• XY
, …
¡
CG
•
•
5
Ivan Sutherland Sketchpad
l
¡
¡
l
pixel
¡
l
8
l
l
l
l
l
bit
¡
• →0 →1 •l
¡
• • • • • ( )10
( )
Photoshop
150
150
(
50
50
(
l
l
¡
8bit (1byte)
• 0→ • 255→¡
(
)
• (12bit ) • Photoshop 16bit •19
l
:R
:G
:B
l
¡
¡
C = (R, G, B)
(1,0,0) (1,1,0) (0,1,0) (0,0,0) (1,1,1)21
(RGB)
(CMY)
22
Red
Green
Blue
Cyan
Magenta
Yellow
( )Photoshop
RGB
CMYK
Photoshop
CMYK
CMYK
lCMYK
¡
¡
l
sRGB
¡
PC
CMYK
¡
CMYK
sRGB
l
http://www.iwashi.org/archives/3342
26
1
1
l
¡
¡
GIF
0 1 2 3 4 5 6 7 5 6 7 7 7 2 3 4 4 5 6 7 7 1 2 3 3 4 5 6 7 0 1 2 6 7 7 7 7 3 4 5 7 7 7 7 7 4 5 6 7 7 7 7 7 5 6 728
h w x y wy + x (x, y) wy + x
30
point(x, y, c)
lvoid point(int x, int y, const double *c)
¡
(x, y)
c
¡
c[0] : , c[1] : , c[2] : , 0 ≦ c[0], c[1], c[2] ≦ 1
x y (x, y) c31
point()
/* */
const double red[] = { 1.0, 0.0, 0.0
};
const double blue[] = { 0.0, 0.0, 1.0
};
/* */
void draw(int width, int height) {
point(3, 5, red);
point(width, height, blue); }
x1 y x0 (x0, y) - (x1, y) (x0 =< x1) x x0 (x, y) x x + 1 BEGIN END N Y x < x 1 =
33
C
34
/* */ int x; x = x0; do { point(x, y, c); ++x; } while (x <= x1); /* */ int x; for (x = x0; x <= x1; ++x) { point(x, y, c); } /* */ int x; x = x0; while (x <= x1) { point(x, y, c); ++x; }x1 y0 x0 (x0, y0) - (x1, y1) (x0 < x1, y0< y1) y y0 (x0, y) - (x1, y) y y + 1 BEGIN END N Y y < y 1 = y1
35
R G B C C0 C1 R0 R1 G0 G1 B0 B1 1 t
C
= C
0(1 - t) + C
1t
R
= R
0(1 - t) + R
1t
G
= G
0(1 - t) + G
1t
B
= B
0(1 - t) + B
1t
036
y1 y x1 x C1 C0 BEGIN y y0 t (y- y0) / (y1 - y0) C C0(1 - t) + C1t (x0, y) - (x1, y) C y y+ 1 y y0 END Y N (x0, y0) - (x1, y1) (x0 < x1, y0 < y1)
37
38
int t; t = (y – y0) / (x – x0); double t; t = (y – y0) / (x – x0); double t;t = (double)(y – y0) / (double)(x – x0);