Class: GLFW::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/glfw/stubs/image.rb

Overview

Object describing a raw image with uncompressed pixel data, with 32-bytes per pixel in RGBA byte order.

This class may also be used for creating textures with OpenGL, simply use GL_RGBA as the pixel format and pass the value of the #pixels method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, height, pixels = nil) ⇒ Image #initialize(filename) ⇒ Image

Returns a new instance of Image.



24
25
# File 'lib/glfw/stubs/image.rb', line 24

def initialize(width, height, pixels)
end

Instance Attribute Details

#heightInteger (readonly) Also known as: rows

Returns the height of the image, in pixel units.

Returns:

  • (Integer)

    the height of the image, in pixel units.



17
18
19
# File 'lib/glfw/stubs/image.rb', line 17

def height
  @height
end

#widthInteger (readonly) Also known as: columns

Returns the width of the image, in pixel units.

Returns:

  • (Integer)

    the width of the image, in pixel units.



13
14
15
# File 'lib/glfw/stubs/image.rb', line 13

def width
  @width
end

Instance Method Details

#pixelsString Also known as: to_blob

Gets the pixel data as a binary blob.

Returns:

  • (String)

    the pixel data.



31
32
# File 'lib/glfw/stubs/image.rb', line 31

def pixels
end