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.




 
   -- create an image container box at the center of the current stack window with default properties
   create image "test"
   -- programtically choose the paint bucket tool
   choose bucket tool
   -- LiveCode engine has built-in color keywords:
   set the brushColor to "dark green"
   -- programtically mouse click at the center of image container box to fill
   click at the loc of image "test"
   -- get the RGBA values of the first pixel in the image box
   put byteToNum(byte 1 of the imageData of image "test") into tRed
   put byteToNum(byte 2 of the imageData of image "test") into tGreen
   put byteToNum(byte 3 of the imageData of image "test") into tBlue
   put byteToNum(byte 4 of the imageData of image "test") into tAlpha
   -- log message the info in the message box
   put "First Pixel Color is Red:"& tRed &" Green:"& tGreen &" Blue:"& tBlue &" Transparency:"& tAlpha
   -- just for fun replace the contents with RosettaCode logo
   wait 2 seconds
   set the filename of image "test" to "http://rosettacode.org/mw/title.png"
    -- the next line is copy of the Write a PPM task:
   export image "test" to file "~/Test.PPM" as paint -- paint format is one of PBM, PGM, or PPM
 