Class: Resedit::Image
- Inherits:
-
Object
- Object
- Resedit::Image
- Defined in:
- lib/resedit/image/image.rb
Direct Known Subclasses
Constant Summary collapse
- TYPE_PNG =
'png'
- TYPE_BMP =
'bmp'
- FORMAT_INDEXED =
0
- FORMAT_32BIT =
1
Instance Attribute Summary collapse
-
#height ⇒ Object
Abstract image class.
-
#width ⇒ Object
Abstract image class.
Instance Method Summary collapse
- #fill(color) ⇒ Object
-
#getPixel(x, y) ⇒ Object
abstract interface.
- #hline(y, color) ⇒ Object
- #save(filename) ⇒ Object
- #setPixel(x, y, color) ⇒ Object
- #vline(x, color) ⇒ Object
Instance Attribute Details
#height ⇒ Object
Abstract image class
6 7 8 |
# File 'lib/resedit/image/image.rb', line 6 def height @height end |
#width ⇒ Object
Abstract image class
6 7 8 |
# File 'lib/resedit/image/image.rb', line 6 def width @width end |
Instance Method Details
#fill(color) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/resedit/image/image.rb', line 13 def fill(color) for j in (0..@height-1) for i in (0..@width-1) setPixel(i, j, color) end end end |
#getPixel(x, y) ⇒ Object
abstract interface
37 |
# File 'lib/resedit/image/image.rb', line 37 def getPixel(x, y); end |
#hline(y, color) ⇒ Object
22 23 24 25 26 |
# File 'lib/resedit/image/image.rb', line 22 def hline(y, color) for i in (0..@width-1) setPixel(i, y, color) end end |
#save(filename) ⇒ Object
40 |
# File 'lib/resedit/image/image.rb', line 40 def save(filename); end |
#setPixel(x, y, color) ⇒ Object
38 |
# File 'lib/resedit/image/image.rb', line 38 def setPixel(x, y, color); end |
#vline(x, color) ⇒ Object
29 30 31 32 33 |
# File 'lib/resedit/image/image.rb', line 29 def vline(x, color) for j in (0..@height-1) setPixel(x, j, color) end end |