Class: Riiif::KakaduCommandFactory
- Inherits:
-
Object
- Object
- Riiif::KakaduCommandFactory
- Defined in:
- app/services/riiif/kakadu_command_factory.rb
Overview
Builds a command to run a transformation using Kakadu
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#transformation ⇒ Object
readonly
Returns the value of attribute transformation.
Instance Method Summary collapse
-
#command(tmp_file) ⇒ String
A command for running kdu_expand to produce the requested output.
-
#initialize(path, info, transformation) ⇒ KakaduCommandFactory
constructor
A helper method to instantiate and invoke build.
- #reduction_factor ⇒ Object
Constructor Details
#initialize(path, info, transformation) ⇒ KakaduCommandFactory
A helper method to instantiate and invoke build
13 14 15 16 17 |
# File 'app/services/riiif/kakadu_command_factory.rb', line 13 def initialize(path, info, transformation) @path = path @info = info @transformation = transformation end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
19 20 21 |
# File 'app/services/riiif/kakadu_command_factory.rb', line 19 def info @info end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
19 20 21 |
# File 'app/services/riiif/kakadu_command_factory.rb', line 19 def path @path end |
#transformation ⇒ Object (readonly)
Returns the value of attribute transformation.
19 20 21 |
# File 'app/services/riiif/kakadu_command_factory.rb', line 19 def transformation @transformation end |
Instance Method Details
#command(tmp_file) ⇒ String
Returns a command for running kdu_expand to produce the requested output.
23 24 25 |
# File 'app/services/riiif/kakadu_command_factory.rb', line 23 def command(tmp_file) [external_command, quiet, input, threads, region, reduce, output(tmp_file)].join end |
#reduction_factor ⇒ Object
27 28 29 |
# File 'app/services/riiif/kakadu_command_factory.rb', line 27 def reduction_factor @reduction_factor ||= Resize.new(transformation.size, info).reduction_factor end |