Class: TexPlay::ImageStub
Overview
Used internally to create images from raw binary (blob) data (TexPlay::from_blob).
This object duck-types an RMagick image (#rows, #columns, #to_blob), so that Gosu will import it.
Direct Known Subclasses
Instance Attribute Summary collapse
- #columns ⇒ Integer readonly
- #rows ⇒ Integer readonly
Instance Method Summary collapse
-
#initialize(blob_data, width, height) ⇒ ImageStub
constructor
The first pixel in the blob will be at the top left hand corner of the created image, since that is the orientation of Gosu images.
- #to_blob ⇒ String
Constructor Details
#initialize(blob_data, width, height) ⇒ ImageStub
The first pixel in the blob will be at the top left hand corner of the created image, since that is the orientation of Gosu images.
137 138 139 |
# File 'lib/texplay.rb', line 137 def initialize(blob_data, width, height) @data, @columns, @rows = blob_data, width, height end |
Instance Attribute Details
#columns ⇒ Integer (readonly)
129 130 131 |
# File 'lib/texplay.rb', line 129 def columns @columns end |
#rows ⇒ Integer (readonly)
129 130 131 |
# File 'lib/texplay.rb', line 129 def rows @rows end |
Instance Method Details
#to_blob ⇒ String
142 143 144 |
# File 'lib/texplay.rb', line 142 def to_blob @data end |