Class: Ruby2D::Pixmap
- Inherits:
-
Object
- Object
- Ruby2D::Pixmap
- Defined in:
- lib/ruby2d/pixmap.rb
Overview
A pixmap represents an image made up of pixel data of fixed width and height.
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(file_path) ⇒ Pixmap
constructor
A new instance of Pixmap.
- #texture ⇒ Object
Constructor Details
#initialize(file_path) ⇒ Pixmap
Returns a new instance of Pixmap.
25 26 27 28 29 30 31 32 33 |
# File 'lib/ruby2d/pixmap.rb', line 25 def initialize(file_path) file_path = file_path.to_s raise UnknownImageFileError, file_path unless File.exist? file_path ext_load_pixmap(file_path) raise InvalidImageFileError, file_path unless @ext_pixel_data @path = file_path end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
23 24 25 |
# File 'lib/ruby2d/pixmap.rb', line 23 def height @height end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
23 24 25 |
# File 'lib/ruby2d/pixmap.rb', line 23 def path @path end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
23 24 25 |
# File 'lib/ruby2d/pixmap.rb', line 23 def width @width end |