Class: IIIF::Image::Region::Absolute

Inherits:
Object
  • Object
show all
Defined in:
lib/iiif/image/region/absolute.rb

Overview

Represents an absolute specified region

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, width, height) ⇒ Absolute

Returns a new instance of Absolute.

Parameters:

  • x (Integer)
  • y (Integer)
  • width (Integer)
  • height (Integer)


9
10
11
12
13
14
# File 'lib/iiif/image/region/absolute.rb', line 9

def initialize(x, y, width, height)
  @offset_x = x
  @offset_y = y
  @width = width
  @height = height
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



16
17
18
# File 'lib/iiif/image/region/absolute.rb', line 16

def height
  @height
end

#offset_xObject (readonly)

Returns the value of attribute offset_x.



16
17
18
# File 'lib/iiif/image/region/absolute.rb', line 16

def offset_x
  @offset_x
end

#offset_yObject (readonly)

Returns the value of attribute offset_y.



16
17
18
# File 'lib/iiif/image/region/absolute.rb', line 16

def offset_y
  @offset_y
end

#widthObject (readonly)

Returns the value of attribute width.



16
17
18
# File 'lib/iiif/image/region/absolute.rb', line 16

def width
  @width
end

Instance Method Details

#dimensionsObject



18
19
20
# File 'lib/iiif/image/region/absolute.rb', line 18

def dimensions
  Dimension.new(width: width, height: height)
end

#to_sObject



22
23
24
# File 'lib/iiif/image/region/absolute.rb', line 22

def to_s
  "#{offset_x},#{offset_y},#{width},#{height}"
end