Class: EXIFR::TIFF::Orientation
- Inherits:
-
Object
- Object
- EXIFR::TIFF::Orientation
- Defined in:
- lib/exifr/tiff.rb
Overview
The orientation of the image with respect to the rows and columns.
Instance Method Summary collapse
-
#==(other) ⇒ Object
:nodoc:.
-
#initialize(value, type) ⇒ Orientation
constructor
:nodoc:.
-
#inspect ⇒ Object
Debugging output.
-
#to_i ⇒ Object
Field value.
-
#to_sym ⇒ Object
Symbolic value.
-
#transform_rmagick(img) ⇒ Object
Rotate and/or flip for proper viewing.
Constructor Details
#initialize(value, type) ⇒ Orientation
:nodoc:
267 268 269 |
# File 'lib/exifr/tiff.rb', line 267 def initialize(value, type) # :nodoc: @value, @type = value, type end |
Instance Method Details
#==(other) ⇒ Object
:nodoc:
301 302 303 |
# File 'lib/exifr/tiff.rb', line 301 def ==(other) # :nodoc: Orientation === other && to_i == other.to_i end |
#inspect ⇒ Object
Debugging output.
282 283 284 |
# File 'lib/exifr/tiff.rb', line 282 def inspect "\#<EXIFR::TIFF::Orientation:#{@type}(#{@value})>" end |
#to_i ⇒ Object
Field value.
272 273 274 |
# File 'lib/exifr/tiff.rb', line 272 def to_i @value end |
#to_sym ⇒ Object
Symbolic value.
277 278 279 |
# File 'lib/exifr/tiff.rb', line 277 def to_sym @type end |
#transform_rmagick(img) ⇒ Object
Rotate and/or flip for proper viewing.
287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/exifr/tiff.rb', line 287 def transform_rmagick(img) case @type when :TopRight ; img.flop when :BottomRight ; img.rotate(180) when :BottomLeft ; img.flip when :LeftTop ; img.rotate(90).flop when :RightTop ; img.rotate(90) when :RightBottom ; img.rotate(270).flop when :LeftBottom ; img.rotate(270) else img end end |