Class: Raylib::Image
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Raylib::Image
- Defined in:
- lib/raylib/core/structs/image.rb
Overview
Image, pixel data stored in CPU memory (RAM)
Class Method Summary collapse
Instance Method Summary collapse
-
#data ⇒ void *
Image raw data.
-
#data=(new_data) ⇒ Object
Sets Image raw data.
-
#format ⇒ Integer
Data format (PixelFormat type).
-
#format=(new_format) ⇒ Object
Sets Data format (PixelFormat type).
-
#height ⇒ Integer
Image base height.
-
#height=(new_height) ⇒ Object
Sets Image base height.
-
#mipmaps ⇒ Integer
Mipmap levels, 1 by default.
-
#mipmaps=(new_mipmaps) ⇒ Object
Sets Mipmap levels, 1 by default.
- #to_s ⇒ Object
-
#width ⇒ Integer
Image base width.
-
#width=(new_width) ⇒ Object
Sets Image base width.
Class Method Details
.create(data, width, height, mipmaps, format) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/raylib/core/structs/image.rb', line 12 def self.create(data, width, height, mipmaps, format) new.tap do |instance| instance[:data] = data instance[:width] = width instance[:height] = height instance[:mipmaps] = mipmaps instance[:format] = format end end |
Instance Method Details
#data ⇒ void *
Image raw data
28 |
# File 'lib/raylib/core/structs/image.rb', line 28 def data = self[:data] |
#data=(new_data) ⇒ Object
Sets Image raw data
31 32 33 |
# File 'lib/raylib/core/structs/image.rb', line 31 def data=(new_data) self[:data] = new_data end |
#format ⇒ Integer
Data format (PixelFormat type)
64 |
# File 'lib/raylib/core/structs/image.rb', line 64 def format = self[:format] |
#format=(new_format) ⇒ Object
Sets Data format (PixelFormat type)
67 68 69 |
# File 'lib/raylib/core/structs/image.rb', line 67 def format=(new_format) self[:format] = new_format end |
#height ⇒ Integer
Image base height
46 |
# File 'lib/raylib/core/structs/image.rb', line 46 def height = self[:height] |
#height=(new_height) ⇒ Object
Sets Image base height
49 50 51 |
# File 'lib/raylib/core/structs/image.rb', line 49 def height=(new_height) self[:height] = new_height end |
#mipmaps ⇒ Integer
Mipmap levels, 1 by default
55 |
# File 'lib/raylib/core/structs/image.rb', line 55 def mipmaps = self[:mipmaps] |
#mipmaps=(new_mipmaps) ⇒ Object
Sets Mipmap levels, 1 by default
58 59 60 |
# File 'lib/raylib/core/structs/image.rb', line 58 def mipmaps=(new_mipmaps) self[:mipmaps] = new_mipmaps end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/raylib/core/structs/image.rb', line 22 def to_s "Raylib::Image##{object_id} data=#{data} width=#{width} height=#{height} mipmaps=#{mipmaps} format=#{format}" end |
#width ⇒ Integer
Image base width
37 |
# File 'lib/raylib/core/structs/image.rb', line 37 def width = self[:width] |
#width=(new_width) ⇒ Object
Sets Image base width
40 41 42 |
# File 'lib/raylib/core/structs/image.rb', line 40 def width=(new_width) self[:width] = new_width end |