Class: Wallbum::ImagePacking::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/wallbum/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Image

Returns a new instance of Image.



13
14
15
16
17
18
# File 'lib/wallbum/image.rb', line 13

def initialize(path)
  @path = path
  @img = Magick::Image.read(path).first
  @width = @img.columns
  @height = @img.rows
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



9
10
11
# File 'lib/wallbum/image.rb', line 9

def height
  @height
end

#imgObject (readonly)

Returns the value of attribute img.



10
11
12
# File 'lib/wallbum/image.rb', line 10

def img
  @img
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/wallbum/image.rb', line 7

def path
  @path
end

#rectangleObject

Returns the value of attribute rectangle.



11
12
13
# File 'lib/wallbum/image.rb', line 11

def rectangle
  @rectangle
end

#widthObject (readonly)

Returns the value of attribute width.



8
9
10
# File 'lib/wallbum/image.rb', line 8

def width
  @width
end