Sha256: ea8fe2161cefe7f3f85519a3e689151aba00d6f607463f93952b195b558406b1

Contents?: true

Size: 538 Bytes

Versions: 14

Compression:

Stored size: 538 Bytes

Contents

module Riiif
  module Region
    module Imagemagick
      # decodes requested cooridnates into an imagemagick crop directive
      class AbsoluteDecoder
        def initialize(x, y, width, height)
          @x = x
          @y = y
          @width = width
          @height = height
        end

        # @return [String] a region for imagemagick to decode
        #                  (appropriate for passing to the -crop parameter)
        def decode
          "#{@width}x#{@height}+#{@x}+#{@y}"
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
riiif-1.7.1 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.7.0 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.6.0 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.5.1 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.5.0 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.4.4 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.4.3 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.4.2 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.4.1 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.4.0 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.3.0 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.2.0 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.1.3 app/services/riiif/region/imagemagick/absolute_decoder.rb
riiif-1.1.2 app/services/riiif/region/imagemagick/absolute_decoder.rb