Class: GLFW::Image
- Inherits:
-
Object
- Object
- GLFW::Image
- 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
-
#height ⇒ Integer
(also: #rows)
readonly
The height of the image, in pixel units.
-
#width ⇒ Integer
(also: #columns)
readonly
The width of the image, in pixel units.
Instance Method Summary collapse
-
#initialize(width, height, pixels) ⇒ Image
constructor
A new instance of Image.
-
#pixels ⇒ String
(also: #to_blob)
Gets the pixel data as a binary blob.
Constructor Details
Instance Attribute Details
#height ⇒ Integer (readonly) Also known as: rows
Returns the height of the image, in pixel units.
17 18 19 |
# File 'lib/glfw/stubs/image.rb', line 17 def height @height end |
#width ⇒ Integer (readonly) Also known as: columns
Returns 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
#pixels ⇒ String Also known as: to_blob
Gets the pixel data as a binary blob.
31 32 |
# File 'lib/glfw/stubs/image.rb', line 31 def pixels end |