Show a basic storage type to handle a simple RGB raster graphics image,
and some primitive associated functions.

If possible provide a function to allocate an uninitialised image,
given its width and height, and provide 3 additional functions:

   one to fill an image with a plain RGB color,
   one to set a given pixel with a color,
   one to get the color of a pixel.


(If there are specificities about the storage or the allocation, explain those.)

These functions are used as a base for the articles in the category raster graphics operations, 
and a basic output function to check the results
is available in the article write ppm file.




include c:\cxpl\codes;  \include 'code' declarations
def Width=180, Height=135, Color=$123456;
int X, Y;
[SetVid($112);  \set display for 640x480 graphics in 24-bit RGB color
for Y:= 0 to Height-1 do    \fill area with Color one pixel at a time
    for X:= 0 to Width-1 do \(this takes 4.12 ms on a Duron 850)
        Point(X, Y, Color);
Move(60, 60); HexOut(6, ReadPix(0,0));  \show color of pixel at 0,0
X:= ChIn(1);            \wait for keystroke
SetVid(3);              \restore display to normal text mode
]