Class: Openseadragon::Image
- Inherits:
-
Object
- Object
- Openseadragon::Image
- Defined in:
- app/models/openseadragon/image.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#id ⇒ Object
Returns the value of attribute id.
-
#width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Image
constructor
A new instance of Image.
- #to_tilesource ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Image
Returns a new instance of Image.
13 14 15 16 17 |
# File 'app/models/openseadragon/image.rb', line 13 def initialize(attributes = {}) self.id = attributes[:id] self.width = attributes[:width] self.height = attributes[:height] end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
3 4 5 |
# File 'app/models/openseadragon/image.rb', line 3 def height @height end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'app/models/openseadragon/image.rb', line 3 def id @id end |
#width ⇒ Object
Returns the value of attribute width.
3 4 5 |
# File 'app/models/openseadragon/image.rb', line 3 def width @width end |
Class Method Details
.find(id) ⇒ Object
8 9 10 |
# File 'app/models/openseadragon/image.rb', line 8 def find(id) file_resolver.find(id) end |
Instance Method Details
#to_tilesource ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/models/openseadragon/image.rb', line 19 def to_tilesource { identifier: id, width: width, height: height, scale_factors: [1, 2, 3, 4, 5], formats: [:jpg, :png], qualities: [:native, :bitonal, :grey, :color], profile: "http://library.stanford.edu/iiif/image-api/compliance.html#level3", tile_width: 1024, tile_height: 1024, image_host: '/image-service', } end |