Class: Koboldy::Conf
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #add_block_out(x, y, width, height) ⇒ OpenStruct
- #add_block_out_alpha(value) ⇒ OpenStruct
- #add_block_out_blue(value) ⇒ OpenStruct
- #add_block_out_debug(boolean) ⇒ OpenStruct
- #add_block_out_green(value) ⇒ OpenStruct
- #add_block_out_opacity(value) ⇒ OpenStruct
- #add_block_out_red(value) ⇒ OpenStruct
- #add_compose_left_to_right(boolean = true) ⇒ OpenStruct
- #add_compose_top_to_bottom(boolean = true) ⇒ OpenStruct
- #add_composition(boolean = true) ⇒ OpenStruct
- #add_copy_image_a_to_output(boolean = true) ⇒ OpenStruct
- #add_copy_image_b_to_output(boolean = false) ⇒ OpenStruct
-
#add_crop_image_a(x, y, width, height) ⇒ OpenStruct
cropImageA Cropping for first image (default: no cropping) - Format: { x:, y:, width:, height: }.
-
#add_crop_image_b(x, y, width, height) ⇒ OpenStruct
cropImageB Cropping for second image (default: no cropping) - Format: { x:, y:, width:, height: }.
- #add_delta(value) ⇒ OpenStruct
- #add_filter(filter_set) ⇒ OpenStruct
- #add_gamma(value) ⇒ OpenStruct
- #add_gamma_b(value) ⇒ OpenStruct
- #add_gamma_g(value) ⇒ OpenStruct
- #add_gamma_r(value) ⇒ OpenStruct
- #add_h_shift(value = 2) ⇒ OpenStruct
- #add_hide_shift(boolean) ⇒ OpenStruct
- #add_image_a_path(path) ⇒ OpenStruct
- #add_image_b_path(path) ⇒ OpenStruct
- #add_image_output_limit(difference) ⇒ OpenStruct
- #add_image_output_path(path) ⇒ OpenStruct
- #add_perceptual(boolean = true) ⇒ OpenStruct
- #add_v_shift(value = 2) ⇒ OpenStruct
- #add_verbose(boolean = false) ⇒ OpenStruct
-
#clear_config ⇒ Object
clear @config instance.
- #generate_into(file_path) ⇒ Object
-
#initialize ⇒ Conf
constructor
see github.com/yahoo/blink-diff if you would like to know setting more.
Constructor Details
#initialize ⇒ Conf
see github.com/yahoo/blink-diff if you would like to know setting more.
12 13 14 |
# File 'lib/koboldy/conf.rb', line 12 def initialize @config = OpenStruct.new end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/koboldy/conf.rb', line 9 def config @config end |
Instance Method Details
#add_block_out(x, y, width, height) ⇒ OpenStruct
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/koboldy/conf.rb', line 68 def add_block_out(x, y, width, height) param = OpenStruct.new param.x = x.to_i param.y = y.to_i param.width = width.to_i param.height = height.to_i @config.blockOut = [] if @config.blockOut.nil? @config.blockOut.push param.to_h self end |
#add_block_out_alpha(value) ⇒ OpenStruct
106 107 108 109 |
# File 'lib/koboldy/conf.rb', line 106 def add_block_out_alpha(value) @config.blockOutAlpha = value.to_i self end |
#add_block_out_blue(value) ⇒ OpenStruct
99 100 101 102 |
# File 'lib/koboldy/conf.rb', line 99 def add_block_out_blue(value) @config.blockOutBlue = color_value(value) self end |
#add_block_out_debug(boolean) ⇒ OpenStruct
144 145 146 147 |
# File 'lib/koboldy/conf.rb', line 144 def add_block_out_debug(boolean) @config.debug = boolean self end |
#add_block_out_green(value) ⇒ OpenStruct
91 92 93 94 |
# File 'lib/koboldy/conf.rb', line 91 def add_block_out_green(value) @config.blockOutGreen = color_value(value) self end |
#add_block_out_opacity(value) ⇒ OpenStruct
113 114 115 116 |
# File 'lib/koboldy/conf.rb', line 113 def add_block_out_opacity(value) @config.blockOutOpacity = value.to_f self end |
#add_block_out_red(value) ⇒ OpenStruct
83 84 85 86 |
# File 'lib/koboldy/conf.rb', line 83 def add_block_out_red(value) @config.blockOutRed = color_value(value) self end |
#add_compose_left_to_right(boolean = true) ⇒ OpenStruct
158 159 160 161 |
# File 'lib/koboldy/conf.rb', line 158 def add_compose_left_to_right(boolean = true) @config.composeLeftToRight = boolean self end |
#add_compose_top_to_bottom(boolean = true) ⇒ OpenStruct
165 166 167 168 |
# File 'lib/koboldy/conf.rb', line 165 def add_compose_top_to_bottom(boolean = true) @config.composeTopToBottom = boolean self end |
#add_composition(boolean = true) ⇒ OpenStruct
151 152 153 154 |
# File 'lib/koboldy/conf.rb', line 151 def add_composition(boolean = true) @config.composition = boolean self end |
#add_copy_image_a_to_output(boolean = true) ⇒ OpenStruct
121 122 123 124 |
# File 'lib/koboldy/conf.rb', line 121 def add_copy_image_a_to_output(boolean = true) @config.copyImageAToOutput = boolean self end |
#add_copy_image_b_to_output(boolean = false) ⇒ OpenStruct
129 130 131 132 |
# File 'lib/koboldy/conf.rb', line 129 def add_copy_image_b_to_output(boolean = false) @config.copyImageBToOutput = boolean self end |
#add_crop_image_a(x, y, width, height) ⇒ OpenStruct
cropImageA Cropping for first image (default: no cropping) - Format: { x:, y:, width:, height: }
197 198 199 200 201 202 203 204 205 |
# File 'lib/koboldy/conf.rb', line 197 def add_crop_image_a(x, y, width, height) param = OpenStruct.new param.x = x.to_i param.y = y.to_i param.width = width.to_i param.height = height.to_i @config.cropImageA.push param.to_h self end |
#add_crop_image_b(x, y, width, height) ⇒ OpenStruct
cropImageB Cropping for second image (default: no cropping) - Format: { x:, y:, width:, height: }
213 214 215 216 217 218 219 220 221 |
# File 'lib/koboldy/conf.rb', line 213 def add_crop_image_b(x, y, width, height) param = OpenStruct.new param.x = x.to_i param.y = y.to_i param.width = width.to_i param.height = height.to_i @config.cropImageB.push param.to_h self end |
#add_delta(value) ⇒ OpenStruct
261 262 263 264 |
# File 'lib/koboldy/conf.rb', line 261 def add_delta(value) @config.delta = value.to_i self end |
#add_filter(filter_set) ⇒ OpenStruct
137 138 139 140 |
# File 'lib/koboldy/conf.rb', line 137 def add_filter(filter_set) @config.filter = filter_set self end |
#add_gamma(value) ⇒ OpenStruct
233 234 235 236 |
# File 'lib/koboldy/conf.rb', line 233 def add_gamma(value) @config.gamma = value.to_f self end |
#add_gamma_b(value) ⇒ OpenStruct
254 255 256 257 |
# File 'lib/koboldy/conf.rb', line 254 def add_gamma_b(value) @config.gammaB = value.to_f self end |
#add_gamma_g(value) ⇒ OpenStruct
247 248 249 250 |
# File 'lib/koboldy/conf.rb', line 247 def add_gamma_g(value) @config.gammaG = value.to_f self end |
#add_gamma_r(value) ⇒ OpenStruct
240 241 242 243 |
# File 'lib/koboldy/conf.rb', line 240 def add_gamma_r(value) @config.gammaR = value.to_f self end |
#add_h_shift(value = 2) ⇒ OpenStruct
172 173 174 175 |
# File 'lib/koboldy/conf.rb', line 172 def add_h_shift(value = 2) @config.hShift = value.to_i self end |
#add_hide_shift(boolean) ⇒ OpenStruct
186 187 188 189 |
# File 'lib/koboldy/conf.rb', line 186 def add_hide_shift(boolean) @config.hideShift = boolean self end |
#add_image_a_path(path) ⇒ OpenStruct
18 19 20 21 |
# File 'lib/koboldy/conf.rb', line 18 def add_image_a_path(path) @config.imageAPath = path self end |
#add_image_b_path(path) ⇒ OpenStruct
25 26 27 28 |
# File 'lib/koboldy/conf.rb', line 25 def add_image_b_path(path) @config.imageBPath = path self end |
#add_image_output_limit(difference) ⇒ OpenStruct
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/koboldy/conf.rb', line 42 def add_image_output_limit(difference) @config.imageOutputLimit = begin case difference when "different" "BlinkDiff.OUTPUT_DIFFERENT" when "similar" "BlinkDiff.OUTPUT_SIMILAR" else "BlinkDiff.OUTPUT_ALL" end end self end |
#add_image_output_path(path) ⇒ OpenStruct
32 33 34 35 |
# File 'lib/koboldy/conf.rb', line 32 def add_image_output_path(path) @config.imageOutputPath = path self end |
#add_perceptual(boolean = true) ⇒ OpenStruct
225 226 227 228 |
# File 'lib/koboldy/conf.rb', line 225 def add_perceptual(boolean = true) @config.perceptual = boolean self end |
#add_v_shift(value = 2) ⇒ OpenStruct
179 180 181 182 |
# File 'lib/koboldy/conf.rb', line 179 def add_v_shift(value = 2) @config.vShift = value.to_i self end |
#add_verbose(boolean = false) ⇒ OpenStruct
58 59 60 61 |
# File 'lib/koboldy/conf.rb', line 58 def add_verbose(boolean = false) @config.verbose = boolean self end |
#clear_config ⇒ Object
clear @config instance.
273 274 275 276 |
# File 'lib/koboldy/conf.rb', line 273 def clear_config @config = OpenStruct.new self end |
#generate_into(file_path) ⇒ Object
266 267 268 269 270 |
# File 'lib/koboldy/conf.rb', line 266 def generate_into(file_path) File.open(file_path, "w") do |file| file.puts JSON.pretty_generate(@config.to_h) end end |