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.




allocateImg := proc(width, height)
	return Array(1..width, 1..height, 1..3);
end proc:
fillColor := proc(img, rgb::list)
	local i;
	for i from 1 to 3 do
		img[..,..,i] := map(x->rgb[i], img[..,..,i]):
	end do:
end proc:
setColor := proc(x, y, img, rgb::list)
	local i:
	for i from 1 to 3 do
		img[x,y,i] := rgb[i]:
	end do:
end proc:
getColor := proc(x,y,img)
	local rgb,i:
	rgb := Array(1..3):
	for i from 1 to 3 do
		rgb(i) := img[x,y,i]:
	end do:
	return rgb:
end proc: