koboldy 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ddb5c7b0e1e855cf5a413bd6dcbe28e9ceb4517
4
- data.tar.gz: 7708cec25453bbafc8dcc1f776e9895df5ac45cc
3
+ metadata.gz: 16bb73985a58efb484265c6e308722b6c514e266
4
+ data.tar.gz: 5835567a7136f4ce107bbeaa51a3f537ef3f1a61
5
5
  SHA512:
6
- metadata.gz: 70a7305f92ab33d36138c8bf34ca3159ac5c214d68aea9e660d4e0350190cbc7f2a470447639dae33883d28481558fe7ce613eb3a924df79f3d1dba72a9ef234
7
- data.tar.gz: 291046c04e81623ec0ca5ebaaaceab37b8b725ef2e4ac4376b0ebc405de47e3bb4382094026183feb6e7747e955ec69f314fb5e97c32c47339777f97deee7407
6
+ metadata.gz: 934563242bc1d5bd970cbac371c806f178b18b7111d3932d573da6bb50531ea739ae9babde9c700829fc0ce2f365069815b5eccdd4ff0060e9f979abb5e700f9
7
+ data.tar.gz: 9f88ef948d9fcb8d1b8af1fce62c944cd0ef3ed6eb5c8c717b43effe2f741336d5da009eca55d245c9137ed3296e7c8739c518ee06d6b9c80c9fe7961b2dab06
data/lib/koboldy/conf.rb CHANGED
@@ -13,6 +13,53 @@ class Koboldy
13
13
  @config = OpenStruct.new
14
14
  end
15
15
 
16
+ # @param [String] path Defines the path to the second image that should be compared
17
+ # @return [OpenStruct]
18
+ def add_image_a_path(path)
19
+ @config.imageAPath = path
20
+ self
21
+ end
22
+
23
+ # @param [String] path Defines the path to the first image that should be compared
24
+ # @return [OpenStruct]
25
+ def add_image_b_path(path)
26
+ @config.imageBPath = path
27
+ self
28
+ end
29
+
30
+ # @param [String] path imageOutputPath Defines the path to the output-file. If you leaves this one off, then this feature is turned-off.
31
+ # @return [OpenStruct]
32
+ def add_image_output_path(path)
33
+ @config.imageOutputPath = path
34
+ self
35
+ end
36
+
37
+ # @param [String] difference imageOutputLimit Defines when an image output should be created.
38
+ # This can be for different images("different"),
39
+ # similar or different images("similar"),
40
+ # or all comparisons. (default: all)
41
+ # @return [OpenStruct]
42
+ def add_image_output_limit(difference)
43
+ @config.imageOutputLimit = begin
44
+ case difference
45
+ when "different"
46
+ "BlinkDiff.OUTPUT_DIFFERENT"
47
+ when "similar"
48
+ "BlinkDiff.OUTPUT_SIMILAR"
49
+ else
50
+ "BlinkDiff.OUTPUT_ALL"
51
+ end
52
+ end
53
+ self
54
+ end
55
+
56
+ # @param [Boolean] boolean Verbose output (default: false)
57
+ # @return [OpenStruct]
58
+ def add_verbose(boolean = false)
59
+ @config.verbose = boolean
60
+ self
61
+ end
62
+
16
63
  # @param [Integer] x Base x-coordinate
17
64
  # @param [Integer] y Base y-coordinate
18
65
  # @param [Integer] width Width of blockOut
@@ -25,11 +72,73 @@ class Koboldy
25
72
  param.width = width.to_i
26
73
  param.height = height.to_i
27
74
 
28
- @config.blockOut = [] if @config.blockOut.nil?
75
+ @config.blockOut = [] if @config.blockOut.nil?
29
76
  @config.blockOut.push param.to_h
30
77
  self
31
78
  end
32
79
 
80
+ # @param [Integer] value Red intensity for the block-out in the output file (default: 0)
81
+ # This color will only be visible in the result when debug-mode is turned on.
82
+ # @return [OpenStruct]
83
+ def add_block_out_red(value)
84
+ @config.blockOutRed = color_value(value)
85
+ self
86
+ end
87
+
88
+ # @param [Integer] value Green intensity for the block-out in the output file (default: 0)
89
+ # This color will only be visible in the result when debug-mode is turned on.
90
+ # @return [OpenStruct]
91
+ def add_block_out_green(value)
92
+ @config.blockOutGreen = color_value(value)
93
+ self
94
+ end
95
+
96
+ # @param [Integer] value Blue intensity for the block-out in the output file (default: 0)
97
+ # This color will only be visible in the result when debug-mode is turned on.
98
+ # @return [OpenStruct]
99
+ def add_block_out_blue(value)
100
+ @config.blockOutBlue = color_value(value)
101
+ self
102
+ end
103
+
104
+ # @param [Integer] value Alpha intensity for the block-out in the output file (default: 255)
105
+ # @return [OpenStruct]
106
+ def add_block_out_alpha(value)
107
+ @config.blockOutAlpha = value.to_i
108
+ self
109
+ end
110
+
111
+ # @param [Integer] value Opacity of the pixel for the block-out in the output file (default: 1.0)
112
+ # @return [OpenStruct]
113
+ def add_block_out_opacity(value)
114
+ @config.blockOutOpacity = value.to_f
115
+ self
116
+ end
117
+
118
+ # @param [Integer] boolean Copies the first image to the output image before the comparison begins.
119
+ # This will make sure that the output image will highlight the differences on the first image. (default)
120
+ # @return [OpenStruct]
121
+ def add_copy_image_a_to_output(boolean = true)
122
+ @config.copyImageAToOutput = boolean
123
+ self
124
+ end
125
+
126
+ # @param [Integer] boolean Copies the second image to the output image before the comparison begins.
127
+ # This will make sure that the output image will highlight the differences on the second image.
128
+ # @return [OpenStruct]
129
+ def add_copy_image_b_to_output(boolean = false)
130
+ @config.copyImageBToOutput = boolean
131
+ self
132
+ end
133
+
134
+ # @param [String] filter_set Filters that will be applied before the comparison.
135
+ # Available filters are: blur, grayScale, lightness, luma, luminosity, sepia
136
+ # @return [OpenStruct]
137
+ def add_filter(filter_set)
138
+ @config.filter = filter_set
139
+ self
140
+ end
141
+
33
142
  # @param [Boolean] boolean You can set true/false. Only for blockOut config
34
143
  # @return [OpenStruct]
35
144
  def add_block_out_debug(boolean)
@@ -37,6 +146,41 @@ class Koboldy
37
146
  self
38
147
  end
39
148
 
149
+ # @param [Boolean] boolean Creates as output a composition of all three images (approved, highlight, and build) (default: true)
150
+ # @return [OpenStruct]
151
+ def add_composition(boolean = true)
152
+ @config.composition = boolean
153
+ self
154
+ end
155
+
156
+ # @param [Boolean] boolean Creates comparison-composition from left to right, otherwise it lets decide the app on what is best
157
+ # @return [OpenStruct]
158
+ def add_compose_left_to_right(boolean = true)
159
+ @config.composeLeftToRight = boolean
160
+ self
161
+ end
162
+
163
+ # @param [Boolean] boolean Creates comparison-composition from top to bottom, otherwise it lets decide the app on what is best
164
+ # @return [OpenStruct]
165
+ def add_compose_top_to_bottom(boolean = true)
166
+ @config.composeTopToBottom = boolean
167
+ self
168
+ end
169
+
170
+ # @param [Integer] value hShift Horizontal shift for possible antialiasing (default: 2) Set to 0 to turn this off.
171
+ # @return [OpenStruct]
172
+ def add_h_shift(value = 2)
173
+ @config.hShift = value.to_i
174
+ self
175
+ end
176
+
177
+ # @param [Integer] value vShift Vertical shift for possible antialiasing (default: 2) Set to 0 to turn this off.
178
+ # @return [OpenStruct]
179
+ def add_v_shift(value = 2)
180
+ @config.vShift = value.to_i
181
+ self
182
+ end
183
+
40
184
  # @param [Boolean] boolean You can set true/false
41
185
  # @return [OpenStruct]
42
186
  def add_hide_shift(boolean)
@@ -44,31 +188,71 @@ class Koboldy
44
188
  self
45
189
  end
46
190
 
47
- # @param [Boolean] boolean You can set true/false
191
+ # cropImageA Cropping for first image (default: no cropping) - Format: { x:, y:, width:, height: }
192
+ # @param [Integer] x Base x-coordinate
193
+ # @param [Integer] y Base y-coordinate
194
+ # @param [Integer] width Width of blockOut
195
+ # @param [Integer] height Height of blockOut
48
196
  # @return [OpenStruct]
49
- def add_compose_left_to_right(boolean)
50
- @config.composeLeftToRight = boolean
197
+ def add_crop_image_a(x, y, width, height)
198
+ param = OpenStruct.new
199
+ param.x = x.to_i
200
+ param.y = y.to_i
201
+ param.width = width.to_i
202
+ param.height = height.to_i
203
+ @config.cropImageA.push param.to_h
51
204
  self
52
205
  end
53
206
 
54
- # @param [Integer] value You can set value from 0 to 255
207
+ # cropImageB Cropping for second image (default: no cropping) - Format: { x:, y:, width:, height: }
208
+ # @param [Integer] x Base x-coordinate
209
+ # @param [Integer] y Base y-coordinate
210
+ # @param [Integer] width Width of blockOut
211
+ # @param [Integer] height Height of blockOut
55
212
  # @return [OpenStruct]
56
- def add_block_out_red(value)
57
- @config.blockOutRed = color_value(value)
213
+ def add_crop_image_b(x, y, width, height)
214
+ param = OpenStruct.new
215
+ param.x = x.to_i
216
+ param.y = y.to_i
217
+ param.width = width.to_i
218
+ param.height = height.to_i
219
+ @config.cropImageB.push param.to_h
58
220
  self
59
221
  end
60
222
 
61
- # @param [Integer] value You can set value from 0 to 255
223
+ # @param [Boolean] boolean Turn the perceptual comparison mode on. See below for more information.
62
224
  # @return [OpenStruct]
63
- def add_block_out_blue(value)
64
- @config.blockOutBlue = color_value(value)
225
+ def add_perceptual(boolean = true)
226
+ @config.perceptual = boolean
65
227
  self
66
228
  end
67
229
 
68
- # @param [Integer] value You can set value from 0 to 255
230
+ # @param [Float] value gamma Gamma correction for all colors (will be used as base) (default: none)
231
+ # - Any value here will turn the perceptual comparison mode on
69
232
  # @return [OpenStruct]
70
- def add_block_out_green(value)
71
- @config.blockOutGreen = color_value(value)
233
+ def add_gamma(value)
234
+ @config.gamma = value.to_f
235
+ self
236
+ end
237
+
238
+ # @param [Float] value gammaR Gamma correction for red - Any value here will turn the perceptual comparison mode on
239
+ # @return [OpenStruct]
240
+ def add_gamma_r(value)
241
+ @config.gammaR = value.to_f
242
+ self
243
+ end
244
+
245
+ # @param [Float] value gammaG Gamma correction for green - Any value here will turn the perceptual comparison mode on
246
+ # @return [OpenStruct]
247
+ def add_gamma_g(value)
248
+ @config.gammaG = value.to_f
249
+ self
250
+ end
251
+
252
+ # @param [Float] value gammaB Gamma correction for blue - Any value here will turn the perceptual comparison mode on
253
+ # @return [OpenStruct]
254
+ def add_gamma_b(value)
255
+ @config.gammaB = value.to_f
72
256
  self
73
257
  end
74
258
 
@@ -1,3 +1,3 @@
1
1
  class Koboldy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koboldy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-06 00:00:00.000000000 Z
11
+ date: 2015-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit