cloudmersive-image-recognition-api-client 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/README.md +184 -0
  4. data/Rakefile +8 -0
  5. data/cloudmersive-image-recognition-api-client.gemspec +45 -0
  6. data/docs/AgeDetectionResult.md +10 -0
  7. data/docs/ArtisticApi.md +66 -0
  8. data/docs/ColorResult.md +10 -0
  9. data/docs/ConvertApi.md +396 -0
  10. data/docs/DetectedLicensePlate.md +14 -0
  11. data/docs/DetectedObject.md +13 -0
  12. data/docs/DominantColorResult.md +9 -0
  13. data/docs/DrawPolygonInstance.md +11 -0
  14. data/docs/DrawPolygonRequest.md +10 -0
  15. data/docs/DrawRectangleInstance.md +14 -0
  16. data/docs/DrawRectangleRequest.md +10 -0
  17. data/docs/DrawTextInstance.md +15 -0
  18. data/docs/DrawTextRequest.md +10 -0
  19. data/docs/EditApi.md +704 -0
  20. data/docs/Face.md +11 -0
  21. data/docs/FaceApi.md +396 -0
  22. data/docs/FaceCompareResponse.md +11 -0
  23. data/docs/FaceLocateResponse.md +11 -0
  24. data/docs/FaceLocateWithLandmarksResponse.md +11 -0
  25. data/docs/FaceMatch.md +13 -0
  26. data/docs/FacePoint.md +9 -0
  27. data/docs/FaceWithLandmarks.md +20 -0
  28. data/docs/FilterApi.md +478 -0
  29. data/docs/FindSymbolResult.md +13 -0
  30. data/docs/FineTextDetectionResult.md +10 -0
  31. data/docs/FineTextItem.md +18 -0
  32. data/docs/GenderDetectionResult.md +10 -0
  33. data/docs/ImageDescriptionResponse.md +11 -0
  34. data/docs/ImageMetadata.md +17 -0
  35. data/docs/ImageMetadataExifValue.md +10 -0
  36. data/docs/InfoApi.md +118 -0
  37. data/docs/NsfwApi.md +63 -0
  38. data/docs/NsfwResult.md +10 -0
  39. data/docs/ObjectDetectionResult.md +10 -0
  40. data/docs/PersonWithAge.md +11 -0
  41. data/docs/PersonWithGender.md +10 -0
  42. data/docs/PolygonPoint.md +9 -0
  43. data/docs/RecognitionOutcome.md +9 -0
  44. data/docs/RecognizeApi.md +455 -0
  45. data/docs/ResizeApi.md +130 -0
  46. data/docs/TextDetectionResult.md +10 -0
  47. data/docs/TextItem.md +11 -0
  48. data/docs/VehicleLicensePlateDetectionResult.md +10 -0
  49. data/git_push.sh +55 -0
  50. data/lib/cloudmersive-image-recognition-api-client.rb +82 -0
  51. data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +84 -0
  52. data/lib/cloudmersive-image-recognition-api-client/api/convert_api.rb +414 -0
  53. data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +753 -0
  54. data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +415 -0
  55. data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +525 -0
  56. data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +133 -0
  57. data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +78 -0
  58. data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +473 -0
  59. data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +157 -0
  60. data/lib/cloudmersive-image-recognition-api-client/api_client.rb +391 -0
  61. data/lib/cloudmersive-image-recognition-api-client/api_error.rb +38 -0
  62. data/lib/cloudmersive-image-recognition-api-client/configuration.rb +209 -0
  63. data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +208 -0
  64. data/lib/cloudmersive-image-recognition-api-client/models/color_result.rb +206 -0
  65. data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +246 -0
  66. data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +236 -0
  67. data/lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb +198 -0
  68. data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_instance.rb +218 -0
  69. data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_request.rb +223 -0
  70. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +246 -0
  71. data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +223 -0
  72. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +256 -0
  73. data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +223 -0
  74. data/lib/cloudmersive-image-recognition-api-client/models/face.rb +216 -0
  75. data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +218 -0
  76. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +218 -0
  77. data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +218 -0
  78. data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +236 -0
  79. data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +196 -0
  80. data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +324 -0
  81. data/lib/cloudmersive-image-recognition-api-client/models/find_symbol_result.rb +236 -0
  82. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +208 -0
  83. data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +286 -0
  84. data/lib/cloudmersive-image-recognition-api-client/models/gender_detection_result.rb +208 -0
  85. data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +216 -0
  86. data/lib/cloudmersive-image-recognition-api-client/models/image_metadata.rb +278 -0
  87. data/lib/cloudmersive-image-recognition-api-client/models/image_metadata_exif_value.rb +206 -0
  88. data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +206 -0
  89. data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +208 -0
  90. data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +215 -0
  91. data/lib/cloudmersive-image-recognition-api-client/models/person_with_gender.rb +206 -0
  92. data/lib/cloudmersive-image-recognition-api-client/models/polygon_point.rb +196 -0
  93. data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +196 -0
  94. data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +208 -0
  95. data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +216 -0
  96. data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +208 -0
  97. data/lib/cloudmersive-image-recognition-api-client/version.rb +15 -0
  98. data/spec/api/artistic_api_spec.rb +48 -0
  99. data/spec/api/convert_api_spec.rb +120 -0
  100. data/spec/api/edit_api_spec.rb +191 -0
  101. data/spec/api/face_api_spec.rb +120 -0
  102. data/spec/api/filter_api_spec.rb +141 -0
  103. data/spec/api/info_api_spec.rb +59 -0
  104. data/spec/api/nsfw_api_spec.rb +47 -0
  105. data/spec/api/recognize_api_spec.rb +133 -0
  106. data/spec/api/resize_api_spec.rb +63 -0
  107. data/spec/api_client_spec.rb +243 -0
  108. data/spec/configuration_spec.rb +42 -0
  109. data/spec/models/age_detection_result_spec.rb +53 -0
  110. data/spec/models/color_result_spec.rb +53 -0
  111. data/spec/models/detected_license_plate_spec.rb +77 -0
  112. data/spec/models/detected_object_spec.rb +71 -0
  113. data/spec/models/dominant_color_result_spec.rb +47 -0
  114. data/spec/models/draw_polygon_instance_spec.rb +59 -0
  115. data/spec/models/draw_polygon_request_spec.rb +53 -0
  116. data/spec/models/draw_rectangle_instance_spec.rb +77 -0
  117. data/spec/models/draw_rectangle_request_spec.rb +53 -0
  118. data/spec/models/draw_text_instance_spec.rb +83 -0
  119. data/spec/models/draw_text_request_spec.rb +53 -0
  120. data/spec/models/face_compare_response_spec.rb +59 -0
  121. data/spec/models/face_locate_response_spec.rb +59 -0
  122. data/spec/models/face_locate_with_landmarks_response_spec.rb +59 -0
  123. data/spec/models/face_match_spec.rb +71 -0
  124. data/spec/models/face_point_spec.rb +47 -0
  125. data/spec/models/face_spec.rb +59 -0
  126. data/spec/models/face_with_landmarks_spec.rb +113 -0
  127. data/spec/models/find_symbol_result_spec.rb +71 -0
  128. data/spec/models/fine_text_detection_result_spec.rb +53 -0
  129. data/spec/models/fine_text_item_spec.rb +101 -0
  130. data/spec/models/gender_detection_result_spec.rb +53 -0
  131. data/spec/models/image_description_response_spec.rb +59 -0
  132. data/spec/models/image_metadata_exif_value_spec.rb +53 -0
  133. data/spec/models/image_metadata_spec.rb +95 -0
  134. data/spec/models/nsfw_result_spec.rb +53 -0
  135. data/spec/models/object_detection_result_spec.rb +53 -0
  136. data/spec/models/person_with_age_spec.rb +59 -0
  137. data/spec/models/person_with_gender_spec.rb +53 -0
  138. data/spec/models/polygon_point_spec.rb +47 -0
  139. data/spec/models/recognition_outcome_spec.rb +47 -0
  140. data/spec/models/text_detection_result_spec.rb +53 -0
  141. data/spec/models/text_item_spec.rb +59 -0
  142. data/spec/models/vehicle_license_plate_detection_result_spec.rb +53 -0
  143. data/spec/spec_helper.rb +111 -0
  144. metadata +145 -3
@@ -0,0 +1,415 @@
1
+ =begin
2
+ #imageapi
3
+
4
+ #Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module CloudmersiveImageRecognitionApiClient
16
+ class FaceApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Compare and match faces
23
+ # Find the faces in an input image, and compare against a reference image to determine if there is a match against the face in the reference image. The reference image (second parameter) should contain exactly one face.
24
+ # @param input_image Image file to perform the operation on; this image can contain one or more faces which will be matched against face provided in the second image. Common file formats such as PNG, JPEG are supported.
25
+ # @param match_face Image of a single face to compare and match against.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [FaceCompareResponse]
28
+ def face_compare(input_image, match_face, opts = {})
29
+ data, _status_code, _headers = face_compare_with_http_info(input_image, match_face, opts)
30
+ data
31
+ end
32
+
33
+ # Compare and match faces
34
+ # Find the faces in an input image, and compare against a reference image to determine if there is a match against the face in the reference image. The reference image (second parameter) should contain exactly one face.
35
+ # @param input_image Image file to perform the operation on; this image can contain one or more faces which will be matched against face provided in the second image. Common file formats such as PNG, JPEG are supported.
36
+ # @param match_face Image of a single face to compare and match against.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(FaceCompareResponse, Fixnum, Hash)>] FaceCompareResponse data, response status code and response headers
39
+ def face_compare_with_http_info(input_image, match_face, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: FaceApi.face_compare ...'
42
+ end
43
+ # verify the required parameter 'input_image' is set
44
+ if @api_client.config.client_side_validation && input_image.nil?
45
+ fail ArgumentError, "Missing the required parameter 'input_image' when calling FaceApi.face_compare"
46
+ end
47
+ # verify the required parameter 'match_face' is set
48
+ if @api_client.config.client_side_validation && match_face.nil?
49
+ fail ArgumentError, "Missing the required parameter 'match_face' when calling FaceApi.face_compare"
50
+ end
51
+ # resource path
52
+ local_var_path = '/image/face/compare-and-match'
53
+
54
+ # query parameters
55
+ query_params = {}
56
+
57
+ # header parameters
58
+ header_params = {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
61
+ # HTTP header 'Content-Type'
62
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
63
+
64
+ # form parameters
65
+ form_params = {}
66
+ form_params['inputImage'] = input_image
67
+ form_params['matchFace'] = match_face
68
+
69
+ # http body (model)
70
+ post_body = nil
71
+ auth_names = ['Apikey']
72
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => 'FaceCompareResponse')
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: FaceApi#face_compare\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+ # Crop image to face with square crop
85
+ # Crop an image to the face (rectangular crop). If there is more than one face present, choose the first one.
86
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [String]
89
+ def face_crop_first(image_file, opts = {})
90
+ data, _status_code, _headers = face_crop_first_with_http_info(image_file, opts)
91
+ data
92
+ end
93
+
94
+ # Crop image to face with square crop
95
+ # Crop an image to the face (rectangular crop). If there is more than one face present, choose the first one.
96
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
99
+ def face_crop_first_with_http_info(image_file, opts = {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug 'Calling API: FaceApi.face_crop_first ...'
102
+ end
103
+ # verify the required parameter 'image_file' is set
104
+ if @api_client.config.client_side_validation && image_file.nil?
105
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_crop_first"
106
+ end
107
+ # resource path
108
+ local_var_path = '/image/face/crop/first'
109
+
110
+ # query parameters
111
+ query_params = {}
112
+
113
+ # header parameters
114
+ header_params = {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
117
+ # HTTP header 'Content-Type'
118
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
119
+
120
+ # form parameters
121
+ form_params = {}
122
+ form_params['imageFile'] = image_file
123
+
124
+ # http body (model)
125
+ post_body = nil
126
+ auth_names = ['Apikey']
127
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
128
+ :header_params => header_params,
129
+ :query_params => query_params,
130
+ :form_params => form_params,
131
+ :body => post_body,
132
+ :auth_names => auth_names,
133
+ :return_type => 'String')
134
+ if @api_client.config.debugging
135
+ @api_client.config.logger.debug "API called: FaceApi#face_crop_first\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
136
+ end
137
+ return data, status_code, headers
138
+ end
139
+ # Crop image to face with round crop
140
+ # Crop an image to the face (circular/round crop). If there is more than one face present, choose the first one.
141
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
142
+ # @param [Hash] opts the optional parameters
143
+ # @return [String]
144
+ def face_crop_first_round(image_file, opts = {})
145
+ data, _status_code, _headers = face_crop_first_round_with_http_info(image_file, opts)
146
+ data
147
+ end
148
+
149
+ # Crop image to face with round crop
150
+ # Crop an image to the face (circular/round crop). If there is more than one face present, choose the first one.
151
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
152
+ # @param [Hash] opts the optional parameters
153
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
154
+ def face_crop_first_round_with_http_info(image_file, opts = {})
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug 'Calling API: FaceApi.face_crop_first_round ...'
157
+ end
158
+ # verify the required parameter 'image_file' is set
159
+ if @api_client.config.client_side_validation && image_file.nil?
160
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_crop_first_round"
161
+ end
162
+ # resource path
163
+ local_var_path = '/image/face/crop/first/round'
164
+
165
+ # query parameters
166
+ query_params = {}
167
+
168
+ # header parameters
169
+ header_params = {}
170
+ # HTTP header 'Accept' (if needed)
171
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
172
+ # HTTP header 'Content-Type'
173
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
174
+
175
+ # form parameters
176
+ form_params = {}
177
+ form_params['imageFile'] = image_file
178
+
179
+ # http body (model)
180
+ post_body = nil
181
+ auth_names = ['Apikey']
182
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
183
+ :header_params => header_params,
184
+ :query_params => query_params,
185
+ :form_params => form_params,
186
+ :body => post_body,
187
+ :auth_names => auth_names,
188
+ :return_type => 'String')
189
+ if @api_client.config.debugging
190
+ @api_client.config.logger.debug "API called: FaceApi#face_crop_first_round\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
191
+ end
192
+ return data, status_code, headers
193
+ end
194
+ # Detect the age of people in an image
195
+ # Identify the age, position, and size of human faces in an image, along with a recognition confidence level. People in the image do NOT need to be facing the camera; they can be facing away, edge-on, etc.
196
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
197
+ # @param [Hash] opts the optional parameters
198
+ # @return [AgeDetectionResult]
199
+ def face_detect_age(image_file, opts = {})
200
+ data, _status_code, _headers = face_detect_age_with_http_info(image_file, opts)
201
+ data
202
+ end
203
+
204
+ # Detect the age of people in an image
205
+ # Identify the age, position, and size of human faces in an image, along with a recognition confidence level. People in the image do NOT need to be facing the camera; they can be facing away, edge-on, etc.
206
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
207
+ # @param [Hash] opts the optional parameters
208
+ # @return [Array<(AgeDetectionResult, Fixnum, Hash)>] AgeDetectionResult data, response status code and response headers
209
+ def face_detect_age_with_http_info(image_file, opts = {})
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug 'Calling API: FaceApi.face_detect_age ...'
212
+ end
213
+ # verify the required parameter 'image_file' is set
214
+ if @api_client.config.client_side_validation && image_file.nil?
215
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_detect_age"
216
+ end
217
+ # resource path
218
+ local_var_path = '/image/face/detect-age'
219
+
220
+ # query parameters
221
+ query_params = {}
222
+
223
+ # header parameters
224
+ header_params = {}
225
+ # HTTP header 'Accept' (if needed)
226
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
227
+ # HTTP header 'Content-Type'
228
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
229
+
230
+ # form parameters
231
+ form_params = {}
232
+ form_params['imageFile'] = image_file
233
+
234
+ # http body (model)
235
+ post_body = nil
236
+ auth_names = ['Apikey']
237
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
238
+ :header_params => header_params,
239
+ :query_params => query_params,
240
+ :form_params => form_params,
241
+ :body => post_body,
242
+ :auth_names => auth_names,
243
+ :return_type => 'AgeDetectionResult')
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug "API called: FaceApi#face_detect_age\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
246
+ end
247
+ return data, status_code, headers
248
+ end
249
+ # Detect the gender of people in an image
250
+ # Identify the gender, position, and size of human faces in an image, along with a recognition confidence level. People in the image should be facing the camera.
251
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
252
+ # @param [Hash] opts the optional parameters
253
+ # @return [GenderDetectionResult]
254
+ def face_detect_gender(image_file, opts = {})
255
+ data, _status_code, _headers = face_detect_gender_with_http_info(image_file, opts)
256
+ data
257
+ end
258
+
259
+ # Detect the gender of people in an image
260
+ # Identify the gender, position, and size of human faces in an image, along with a recognition confidence level. People in the image should be facing the camera.
261
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
262
+ # @param [Hash] opts the optional parameters
263
+ # @return [Array<(GenderDetectionResult, Fixnum, Hash)>] GenderDetectionResult data, response status code and response headers
264
+ def face_detect_gender_with_http_info(image_file, opts = {})
265
+ if @api_client.config.debugging
266
+ @api_client.config.logger.debug 'Calling API: FaceApi.face_detect_gender ...'
267
+ end
268
+ # verify the required parameter 'image_file' is set
269
+ if @api_client.config.client_side_validation && image_file.nil?
270
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_detect_gender"
271
+ end
272
+ # resource path
273
+ local_var_path = '/image/face/detect-gender'
274
+
275
+ # query parameters
276
+ query_params = {}
277
+
278
+ # header parameters
279
+ header_params = {}
280
+ # HTTP header 'Accept' (if needed)
281
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
282
+ # HTTP header 'Content-Type'
283
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
284
+
285
+ # form parameters
286
+ form_params = {}
287
+ form_params['imageFile'] = image_file
288
+
289
+ # http body (model)
290
+ post_body = nil
291
+ auth_names = ['Apikey']
292
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
293
+ :header_params => header_params,
294
+ :query_params => query_params,
295
+ :form_params => form_params,
296
+ :body => post_body,
297
+ :auth_names => auth_names,
298
+ :return_type => 'GenderDetectionResult')
299
+ if @api_client.config.debugging
300
+ @api_client.config.logger.debug "API called: FaceApi#face_detect_gender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
301
+ end
302
+ return data, status_code, headers
303
+ end
304
+ # Detect and find faces in an image
305
+ # Locate the positions of all faces in an image
306
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
307
+ # @param [Hash] opts the optional parameters
308
+ # @return [FaceLocateResponse]
309
+ def face_locate(image_file, opts = {})
310
+ data, _status_code, _headers = face_locate_with_http_info(image_file, opts)
311
+ data
312
+ end
313
+
314
+ # Detect and find faces in an image
315
+ # Locate the positions of all faces in an image
316
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
317
+ # @param [Hash] opts the optional parameters
318
+ # @return [Array<(FaceLocateResponse, Fixnum, Hash)>] FaceLocateResponse data, response status code and response headers
319
+ def face_locate_with_http_info(image_file, opts = {})
320
+ if @api_client.config.debugging
321
+ @api_client.config.logger.debug 'Calling API: FaceApi.face_locate ...'
322
+ end
323
+ # verify the required parameter 'image_file' is set
324
+ if @api_client.config.client_side_validation && image_file.nil?
325
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_locate"
326
+ end
327
+ # resource path
328
+ local_var_path = '/image/face/locate'
329
+
330
+ # query parameters
331
+ query_params = {}
332
+
333
+ # header parameters
334
+ header_params = {}
335
+ # HTTP header 'Accept' (if needed)
336
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
337
+ # HTTP header 'Content-Type'
338
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
339
+
340
+ # form parameters
341
+ form_params = {}
342
+ form_params['imageFile'] = image_file
343
+
344
+ # http body (model)
345
+ post_body = nil
346
+ auth_names = ['Apikey']
347
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
348
+ :header_params => header_params,
349
+ :query_params => query_params,
350
+ :form_params => form_params,
351
+ :body => post_body,
352
+ :auth_names => auth_names,
353
+ :return_type => 'FaceLocateResponse')
354
+ if @api_client.config.debugging
355
+ @api_client.config.logger.debug "API called: FaceApi#face_locate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
356
+ end
357
+ return data, status_code, headers
358
+ end
359
+ # Detect and find faces and landmarks eyes and nose and mouth in image
360
+ # Locate the positions of all faces in an image, along with the eyes, eye brows, nose and mouth components of each
361
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
362
+ # @param [Hash] opts the optional parameters
363
+ # @return [FaceLocateWithLandmarksResponse]
364
+ def face_locate_with_landmarks(image_file, opts = {})
365
+ data, _status_code, _headers = face_locate_with_landmarks_with_http_info(image_file, opts)
366
+ data
367
+ end
368
+
369
+ # Detect and find faces and landmarks eyes and nose and mouth in image
370
+ # Locate the positions of all faces in an image, along with the eyes, eye brows, nose and mouth components of each
371
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
372
+ # @param [Hash] opts the optional parameters
373
+ # @return [Array<(FaceLocateWithLandmarksResponse, Fixnum, Hash)>] FaceLocateWithLandmarksResponse data, response status code and response headers
374
+ def face_locate_with_landmarks_with_http_info(image_file, opts = {})
375
+ if @api_client.config.debugging
376
+ @api_client.config.logger.debug 'Calling API: FaceApi.face_locate_with_landmarks ...'
377
+ end
378
+ # verify the required parameter 'image_file' is set
379
+ if @api_client.config.client_side_validation && image_file.nil?
380
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_locate_with_landmarks"
381
+ end
382
+ # resource path
383
+ local_var_path = '/image/face/locate-with-landmarks'
384
+
385
+ # query parameters
386
+ query_params = {}
387
+
388
+ # header parameters
389
+ header_params = {}
390
+ # HTTP header 'Accept' (if needed)
391
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
392
+ # HTTP header 'Content-Type'
393
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
394
+
395
+ # form parameters
396
+ form_params = {}
397
+ form_params['imageFile'] = image_file
398
+
399
+ # http body (model)
400
+ post_body = nil
401
+ auth_names = ['Apikey']
402
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
403
+ :header_params => header_params,
404
+ :query_params => query_params,
405
+ :form_params => form_params,
406
+ :body => post_body,
407
+ :auth_names => auth_names,
408
+ :return_type => 'FaceLocateWithLandmarksResponse')
409
+ if @api_client.config.debugging
410
+ @api_client.config.logger.debug "API called: FaceApi#face_locate_with_landmarks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
411
+ end
412
+ return data, status_code, headers
413
+ end
414
+ end
415
+ end
@@ -0,0 +1,525 @@
1
+ =begin
2
+ #imageapi
3
+
4
+ #Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module CloudmersiveImageRecognitionApiClient
16
+ class FilterApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Convert image to black-and-white grayscale
23
+ # Remove color from the image by converting to a grayscale, black-and-white image
24
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [String]
27
+ def filter_black_and_white(image_file, opts = {})
28
+ data, _status_code, _headers = filter_black_and_white_with_http_info(image_file, opts)
29
+ data
30
+ end
31
+
32
+ # Convert image to black-and-white grayscale
33
+ # Remove color from the image by converting to a grayscale, black-and-white image
34
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
37
+ def filter_black_and_white_with_http_info(image_file, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: FilterApi.filter_black_and_white ...'
40
+ end
41
+ # verify the required parameter 'image_file' is set
42
+ if @api_client.config.client_side_validation && image_file.nil?
43
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_black_and_white"
44
+ end
45
+ # resource path
46
+ local_var_path = '/image/filter/black-and-white'
47
+
48
+ # query parameters
49
+ query_params = {}
50
+
51
+ # header parameters
52
+ header_params = {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
57
+
58
+ # form parameters
59
+ form_params = {}
60
+ form_params['imageFile'] = image_file
61
+
62
+ # http body (model)
63
+ post_body = nil
64
+ auth_names = ['Apikey']
65
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
66
+ :header_params => header_params,
67
+ :query_params => query_params,
68
+ :form_params => form_params,
69
+ :body => post_body,
70
+ :auth_names => auth_names,
71
+ :return_type => 'String')
72
+ if @api_client.config.debugging
73
+ @api_client.config.logger.debug "API called: FilterApi#filter_black_and_white\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
+ end
75
+ return data, status_code, headers
76
+ end
77
+ # Despeckle to remove point noise from the image
78
+ # Remove point noise / despeckle the input image
79
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
80
+ # @param [Hash] opts the optional parameters
81
+ # @return [String]
82
+ def filter_despeckle(image_file, opts = {})
83
+ data, _status_code, _headers = filter_despeckle_with_http_info(image_file, opts)
84
+ data
85
+ end
86
+
87
+ # Despeckle to remove point noise from the image
88
+ # Remove point noise / despeckle the input image
89
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
92
+ def filter_despeckle_with_http_info(image_file, opts = {})
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug 'Calling API: FilterApi.filter_despeckle ...'
95
+ end
96
+ # verify the required parameter 'image_file' is set
97
+ if @api_client.config.client_side_validation && image_file.nil?
98
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_despeckle"
99
+ end
100
+ # resource path
101
+ local_var_path = '/image/filter/despeckle'
102
+
103
+ # query parameters
104
+ query_params = {}
105
+
106
+ # header parameters
107
+ header_params = {}
108
+ # HTTP header 'Accept' (if needed)
109
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
110
+ # HTTP header 'Content-Type'
111
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
112
+
113
+ # form parameters
114
+ form_params = {}
115
+ form_params['imageFile'] = image_file
116
+
117
+ # http body (model)
118
+ post_body = nil
119
+ auth_names = ['Apikey']
120
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
121
+ :header_params => header_params,
122
+ :query_params => query_params,
123
+ :form_params => form_params,
124
+ :body => post_body,
125
+ :auth_names => auth_names,
126
+ :return_type => 'String')
127
+ if @api_client.config.debugging
128
+ @api_client.config.logger.debug "API called: FilterApi#filter_despeckle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
129
+ end
130
+ return data, status_code, headers
131
+ end
132
+ # Detect and highlight edges in an image
133
+ # Perform an edge detection operation on the input image
134
+ # @param radius Radius in pixels of the edge detection operation; a larger radius will produce a greater effect
135
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
136
+ # @param [Hash] opts the optional parameters
137
+ # @return [String]
138
+ def filter_edge_detect(radius, image_file, opts = {})
139
+ data, _status_code, _headers = filter_edge_detect_with_http_info(radius, image_file, opts)
140
+ data
141
+ end
142
+
143
+ # Detect and highlight edges in an image
144
+ # Perform an edge detection operation on the input image
145
+ # @param radius Radius in pixels of the edge detection operation; a larger radius will produce a greater effect
146
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
147
+ # @param [Hash] opts the optional parameters
148
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
149
+ def filter_edge_detect_with_http_info(radius, image_file, opts = {})
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug 'Calling API: FilterApi.filter_edge_detect ...'
152
+ end
153
+ # verify the required parameter 'radius' is set
154
+ if @api_client.config.client_side_validation && radius.nil?
155
+ fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_edge_detect"
156
+ end
157
+ # verify the required parameter 'image_file' is set
158
+ if @api_client.config.client_side_validation && image_file.nil?
159
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_edge_detect"
160
+ end
161
+ # resource path
162
+ local_var_path = '/image/filter/edge-detect/{radius}'.sub('{' + 'radius' + '}', radius.to_s)
163
+
164
+ # query parameters
165
+ query_params = {}
166
+
167
+ # header parameters
168
+ header_params = {}
169
+ # HTTP header 'Accept' (if needed)
170
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
171
+ # HTTP header 'Content-Type'
172
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
173
+
174
+ # form parameters
175
+ form_params = {}
176
+ form_params['imageFile'] = image_file
177
+
178
+ # http body (model)
179
+ post_body = nil
180
+ auth_names = ['Apikey']
181
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
182
+ :header_params => header_params,
183
+ :query_params => query_params,
184
+ :form_params => form_params,
185
+ :body => post_body,
186
+ :auth_names => auth_names,
187
+ :return_type => 'String')
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug "API called: FilterApi#filter_edge_detect\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
190
+ end
191
+ return data, status_code, headers
192
+ end
193
+ # Emboss an image
194
+ # Perform an emboss operation on the input image
195
+ # @param radius Radius in pixels of the emboss operation; a larger radius will produce a greater effect
196
+ # @param sigma Sigma, or variance, of the emboss operation
197
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
198
+ # @param [Hash] opts the optional parameters
199
+ # @return [String]
200
+ def filter_emboss(radius, sigma, image_file, opts = {})
201
+ data, _status_code, _headers = filter_emboss_with_http_info(radius, sigma, image_file, opts)
202
+ data
203
+ end
204
+
205
+ # Emboss an image
206
+ # Perform an emboss operation on the input image
207
+ # @param radius Radius in pixels of the emboss operation; a larger radius will produce a greater effect
208
+ # @param sigma Sigma, or variance, of the emboss operation
209
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
210
+ # @param [Hash] opts the optional parameters
211
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
212
+ def filter_emboss_with_http_info(radius, sigma, image_file, opts = {})
213
+ if @api_client.config.debugging
214
+ @api_client.config.logger.debug 'Calling API: FilterApi.filter_emboss ...'
215
+ end
216
+ # verify the required parameter 'radius' is set
217
+ if @api_client.config.client_side_validation && radius.nil?
218
+ fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_emboss"
219
+ end
220
+ # verify the required parameter 'sigma' is set
221
+ if @api_client.config.client_side_validation && sigma.nil?
222
+ fail ArgumentError, "Missing the required parameter 'sigma' when calling FilterApi.filter_emboss"
223
+ end
224
+ # verify the required parameter 'image_file' is set
225
+ if @api_client.config.client_side_validation && image_file.nil?
226
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_emboss"
227
+ end
228
+ # resource path
229
+ local_var_path = '/image/filter/emboss/{radius}/{sigma}'.sub('{' + 'radius' + '}', radius.to_s).sub('{' + 'sigma' + '}', sigma.to_s)
230
+
231
+ # query parameters
232
+ query_params = {}
233
+
234
+ # header parameters
235
+ header_params = {}
236
+ # HTTP header 'Accept' (if needed)
237
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
238
+ # HTTP header 'Content-Type'
239
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
240
+
241
+ # form parameters
242
+ form_params = {}
243
+ form_params['imageFile'] = image_file
244
+
245
+ # http body (model)
246
+ post_body = nil
247
+ auth_names = ['Apikey']
248
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
249
+ :header_params => header_params,
250
+ :query_params => query_params,
251
+ :form_params => form_params,
252
+ :body => post_body,
253
+ :auth_names => auth_names,
254
+ :return_type => 'String')
255
+ if @api_client.config.debugging
256
+ @api_client.config.logger.debug "API called: FilterApi#filter_emboss\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
257
+ end
258
+ return data, status_code, headers
259
+ end
260
+ # Perform a guassian blur on the input image
261
+ # Perform a gaussian blur on the input image
262
+ # @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect
263
+ # @param sigma Sigma, or variance, of the gaussian blur operation
264
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
265
+ # @param [Hash] opts the optional parameters
266
+ # @return [String]
267
+ def filter_gaussian_blur(radius, sigma, image_file, opts = {})
268
+ data, _status_code, _headers = filter_gaussian_blur_with_http_info(radius, sigma, image_file, opts)
269
+ data
270
+ end
271
+
272
+ # Perform a guassian blur on the input image
273
+ # Perform a gaussian blur on the input image
274
+ # @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect
275
+ # @param sigma Sigma, or variance, of the gaussian blur operation
276
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
277
+ # @param [Hash] opts the optional parameters
278
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
279
+ def filter_gaussian_blur_with_http_info(radius, sigma, image_file, opts = {})
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug 'Calling API: FilterApi.filter_gaussian_blur ...'
282
+ end
283
+ # verify the required parameter 'radius' is set
284
+ if @api_client.config.client_side_validation && radius.nil?
285
+ fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_gaussian_blur"
286
+ end
287
+ # verify the required parameter 'sigma' is set
288
+ if @api_client.config.client_side_validation && sigma.nil?
289
+ fail ArgumentError, "Missing the required parameter 'sigma' when calling FilterApi.filter_gaussian_blur"
290
+ end
291
+ # verify the required parameter 'image_file' is set
292
+ if @api_client.config.client_side_validation && image_file.nil?
293
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_gaussian_blur"
294
+ end
295
+ # resource path
296
+ local_var_path = '/image/filter/blur/guassian/{radius}/{sigma}'.sub('{' + 'radius' + '}', radius.to_s).sub('{' + 'sigma' + '}', sigma.to_s)
297
+
298
+ # query parameters
299
+ query_params = {}
300
+
301
+ # header parameters
302
+ header_params = {}
303
+ # HTTP header 'Accept' (if needed)
304
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
305
+ # HTTP header 'Content-Type'
306
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
307
+
308
+ # form parameters
309
+ form_params = {}
310
+ form_params['imageFile'] = image_file
311
+
312
+ # http body (model)
313
+ post_body = nil
314
+ auth_names = ['Apikey']
315
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
316
+ :header_params => header_params,
317
+ :query_params => query_params,
318
+ :form_params => form_params,
319
+ :body => post_body,
320
+ :auth_names => auth_names,
321
+ :return_type => 'String')
322
+ if @api_client.config.debugging
323
+ @api_client.config.logger.debug "API called: FilterApi#filter_gaussian_blur\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
324
+ end
325
+ return data, status_code, headers
326
+ end
327
+ # Perform a motion blur on the input image
328
+ # Perform a motion blur on the input image at a specific angle
329
+ # @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect
330
+ # @param sigma Sigma, or variance, of the motion blur operation
331
+ # @param angle Angle of the motion blur in degrees
332
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
333
+ # @param [Hash] opts the optional parameters
334
+ # @return [String]
335
+ def filter_motion_blur(radius, sigma, angle, image_file, opts = {})
336
+ data, _status_code, _headers = filter_motion_blur_with_http_info(radius, sigma, angle, image_file, opts)
337
+ data
338
+ end
339
+
340
+ # Perform a motion blur on the input image
341
+ # Perform a motion blur on the input image at a specific angle
342
+ # @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect
343
+ # @param sigma Sigma, or variance, of the motion blur operation
344
+ # @param angle Angle of the motion blur in degrees
345
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
346
+ # @param [Hash] opts the optional parameters
347
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
348
+ def filter_motion_blur_with_http_info(radius, sigma, angle, image_file, opts = {})
349
+ if @api_client.config.debugging
350
+ @api_client.config.logger.debug 'Calling API: FilterApi.filter_motion_blur ...'
351
+ end
352
+ # verify the required parameter 'radius' is set
353
+ if @api_client.config.client_side_validation && radius.nil?
354
+ fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_motion_blur"
355
+ end
356
+ # verify the required parameter 'sigma' is set
357
+ if @api_client.config.client_side_validation && sigma.nil?
358
+ fail ArgumentError, "Missing the required parameter 'sigma' when calling FilterApi.filter_motion_blur"
359
+ end
360
+ # verify the required parameter 'angle' is set
361
+ if @api_client.config.client_side_validation && angle.nil?
362
+ fail ArgumentError, "Missing the required parameter 'angle' when calling FilterApi.filter_motion_blur"
363
+ end
364
+ # verify the required parameter 'image_file' is set
365
+ if @api_client.config.client_side_validation && image_file.nil?
366
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_motion_blur"
367
+ end
368
+ # resource path
369
+ local_var_path = '/image/filter/blur/motion/{radius}/{sigma}/{angle}'.sub('{' + 'radius' + '}', radius.to_s).sub('{' + 'sigma' + '}', sigma.to_s).sub('{' + 'angle' + '}', angle.to_s)
370
+
371
+ # query parameters
372
+ query_params = {}
373
+
374
+ # header parameters
375
+ header_params = {}
376
+ # HTTP header 'Accept' (if needed)
377
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
378
+ # HTTP header 'Content-Type'
379
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
380
+
381
+ # form parameters
382
+ form_params = {}
383
+ form_params['imageFile'] = image_file
384
+
385
+ # http body (model)
386
+ post_body = nil
387
+ auth_names = ['Apikey']
388
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
389
+ :header_params => header_params,
390
+ :query_params => query_params,
391
+ :form_params => form_params,
392
+ :body => post_body,
393
+ :auth_names => auth_names,
394
+ :return_type => 'String')
395
+ if @api_client.config.debugging
396
+ @api_client.config.logger.debug "API called: FilterApi#filter_motion_blur\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
397
+ end
398
+ return data, status_code, headers
399
+ end
400
+ # Posterize the image by reducing distinct colors
401
+ # Reduce the unique number of colors in the image to the specified level
402
+ # @param levels Number of unique colors to retain in the output image
403
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
404
+ # @param [Hash] opts the optional parameters
405
+ # @return [String]
406
+ def filter_posterize(levels, image_file, opts = {})
407
+ data, _status_code, _headers = filter_posterize_with_http_info(levels, image_file, opts)
408
+ data
409
+ end
410
+
411
+ # Posterize the image by reducing distinct colors
412
+ # Reduce the unique number of colors in the image to the specified level
413
+ # @param levels Number of unique colors to retain in the output image
414
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
415
+ # @param [Hash] opts the optional parameters
416
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
417
+ def filter_posterize_with_http_info(levels, image_file, opts = {})
418
+ if @api_client.config.debugging
419
+ @api_client.config.logger.debug 'Calling API: FilterApi.filter_posterize ...'
420
+ end
421
+ # verify the required parameter 'levels' is set
422
+ if @api_client.config.client_side_validation && levels.nil?
423
+ fail ArgumentError, "Missing the required parameter 'levels' when calling FilterApi.filter_posterize"
424
+ end
425
+ # verify the required parameter 'image_file' is set
426
+ if @api_client.config.client_side_validation && image_file.nil?
427
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_posterize"
428
+ end
429
+ # resource path
430
+ local_var_path = '/image/filter/posterize'
431
+
432
+ # query parameters
433
+ query_params = {}
434
+ query_params[:'levels'] = levels
435
+
436
+ # header parameters
437
+ header_params = {}
438
+ # HTTP header 'Accept' (if needed)
439
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
440
+ # HTTP header 'Content-Type'
441
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
442
+
443
+ # form parameters
444
+ form_params = {}
445
+ form_params['imageFile'] = image_file
446
+
447
+ # http body (model)
448
+ post_body = nil
449
+ auth_names = ['Apikey']
450
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
451
+ :header_params => header_params,
452
+ :query_params => query_params,
453
+ :form_params => form_params,
454
+ :body => post_body,
455
+ :auth_names => auth_names,
456
+ :return_type => 'String')
457
+ if @api_client.config.debugging
458
+ @api_client.config.logger.debug "API called: FilterApi#filter_posterize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
459
+ end
460
+ return data, status_code, headers
461
+ end
462
+ # Swirl distort the image
463
+ # Swirl distort the image by the specified number of degrees
464
+ # @param degrees Degrees of swirl
465
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
466
+ # @param [Hash] opts the optional parameters
467
+ # @return [String]
468
+ def filter_swirl(degrees, image_file, opts = {})
469
+ data, _status_code, _headers = filter_swirl_with_http_info(degrees, image_file, opts)
470
+ data
471
+ end
472
+
473
+ # Swirl distort the image
474
+ # Swirl distort the image by the specified number of degrees
475
+ # @param degrees Degrees of swirl
476
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
477
+ # @param [Hash] opts the optional parameters
478
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
479
+ def filter_swirl_with_http_info(degrees, image_file, opts = {})
480
+ if @api_client.config.debugging
481
+ @api_client.config.logger.debug 'Calling API: FilterApi.filter_swirl ...'
482
+ end
483
+ # verify the required parameter 'degrees' is set
484
+ if @api_client.config.client_side_validation && degrees.nil?
485
+ fail ArgumentError, "Missing the required parameter 'degrees' when calling FilterApi.filter_swirl"
486
+ end
487
+ # verify the required parameter 'image_file' is set
488
+ if @api_client.config.client_side_validation && image_file.nil?
489
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_swirl"
490
+ end
491
+ # resource path
492
+ local_var_path = '/image/filter/swirl'
493
+
494
+ # query parameters
495
+ query_params = {}
496
+ query_params[:'degrees'] = degrees
497
+
498
+ # header parameters
499
+ header_params = {}
500
+ # HTTP header 'Accept' (if needed)
501
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
502
+ # HTTP header 'Content-Type'
503
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
504
+
505
+ # form parameters
506
+ form_params = {}
507
+ form_params['imageFile'] = image_file
508
+
509
+ # http body (model)
510
+ post_body = nil
511
+ auth_names = ['Apikey']
512
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
513
+ :header_params => header_params,
514
+ :query_params => query_params,
515
+ :form_params => form_params,
516
+ :body => post_body,
517
+ :auth_names => auth_names,
518
+ :return_type => 'String')
519
+ if @api_client.config.debugging
520
+ @api_client.config.logger.debug "API called: FilterApi#filter_swirl\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
521
+ end
522
+ return data, status_code, headers
523
+ end
524
+ end
525
+ end