class Iup::ImageRGBA
Image made from RGBA values.
Example
image_data = [ r1,g1,b1,a1,r2,g2,b2,a2, ... r20,g20,b20,a20, # 4x20 sets of RGBA values ... # 20 rows ] Iup::ImageRGBA.new(20, 20, image_data)
Public Class Methods
Source
# File lib/wrapped/image.rb, line 171 def initialize(width, height, pixels) @handle = IupLib.IupImageRGBA(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 4 values per pixel.