class Iup::Image

Image made from greyscale values. The colors are defined in a table, and their indices used when defining the image pixel-map.

Example

The following image is built from 3 colors: the pixmap gives their placement in the 11x11 image, and the constructor uses a block to specify the color for each of the 3 values. When displayed, the image presents a red X on a yellow background.

 pixmap_x = [
  1,2,3,3,3,3,3,3,3,2,1, 
  2,1,2,3,3,3,3,3,2,1,2, 
  3,2,1,2,3,3,3,2,1,2,3, 
  3,3,2,1,2,3,2,1,2,3,3, 
  3,3,3,2,1,2,1,2,3,3,3, 
  3,3,3,3,2,1,2,3,3,3,3, 
  3,3,3,2,1,2,1,2,3,3,3, 
  3,3,2,1,2,3,2,1,2,3,3, 
  3,2,1,2,3,3,3,2,1,2,3, 
  2,1,2,3,3,3,3,3,2,1,2, 
  1,2,3,3,3,3,3,3,3,2,1
]

img = Iup::Image.new(11, 11, pixmap_x) do |i|
 i.color(1, '0 1 0')
 i.color(2, '255 0 0')
 i.color(3, '255 255 0')
end