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.




      Width% = 200
      Height% = 200
 
      REM Set window size:
      VDU 23,22,Width%;Height%;8,16,16,128
 
      REM Fill with an RGB colour:
      PROCfill(100,150,200)
 
      REM Set a pixel:
      PROCsetpixel(100,100,255,255,0)
 
      REM Get a pixel:
      rgb% = FNgetpixel(100,100)
      PRINT RIGHT$("00000" + STR$~rgb%, 6)
      END
 
      DEF PROCfill(r%,g%,b%)
      COLOUR 1,r%,g%,b%
      GCOL 1+128
      CLG
      ENDPROC
 
      DEF PROCsetpixel(x%,y%,r%,g%,b%)
      COLOUR 1,r%,g%,b%
      GCOL 1
      LINE x%*2,y%*2,x%*2,y%*2
      ENDPROC
 
      DEF FNgetpixel(x%,y%)
      LOCAL col%
      col% = TINT(x%*2,y%*2)
      SWAP ?^col%,?(^col%+2)
      = col%