Class: Raylib::Image

Inherits:
FFI::Struct
  • Object
show all
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

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

#datavoid *

Image raw data

Returns:

  • (void *)

    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

#formatInteger

Data format (PixelFormat type)

Returns:

  • (Integer)

    format



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

#heightInteger

Image base height

Returns:

  • (Integer)

    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

#mipmapsInteger

Mipmap levels, 1 by default

Returns:

  • (Integer)

    mipmaps



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_sObject



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

#widthInteger

Image base width

Returns:

  • (Integer)

    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