class Iup::ImageRGB
Image made from RGB values.
Example
image_data_24 = [ r1,g1,b1,r2,g2,b2, ... r20,g20,b20, # 3x20 triples of RGB values ... # 20 rows ] Iup::ImageRGB.new(20, 20, image_data_24)
Public Class Methods
Source
# File lib/wrapped/image.rb, line 147 def initialize(width, height, pixels) @handle = IupLib.IupImageRGB(width, height, IupLib.pointer_from_chars(pixels)) # run any provided block on instance, to set up further attributes yield self if block_given? end
Constructor creates an image from raw pixels. If a block is given, the new instance is yielded to it.
-
width- width of image in pixels -
height- height of image in pixels -
pixels- an array of pixel values, using 3 values per pixel.