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

Sign up to get free protection for your applications and to get access to all the features.
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,753 @@
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 EditApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Normalizes image rotation and removes EXIF rotation data
23
+ # Automatically orients the input image based on EXIF information and then removes the EXIF information. EXIF is an additional set of information stored in some images taken with cell phone cameras based on the orientation of the camera. By normalizing rotation and removing EXIF data these images become much easier to process.
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 edit_auto_orient(image_file, opts = {})
28
+ data, _status_code, _headers = edit_auto_orient_with_http_info(image_file, opts)
29
+ data
30
+ end
31
+
32
+ # Normalizes image rotation and removes EXIF rotation data
33
+ # Automatically orients the input image based on EXIF information and then removes the EXIF information. EXIF is an additional set of information stored in some images taken with cell phone cameras based on the orientation of the camera. By normalizing rotation and removing EXIF data these images become much easier to process.
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 edit_auto_orient_with_http_info(image_file, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_auto_orient ...'
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 EditApi.edit_auto_orient"
44
+ end
45
+ # resource path
46
+ local_var_path = '/image/edit/auto-orient/remove-exif'
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: EditApi#edit_auto_orient\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
+ end
75
+ return data, status_code, headers
76
+ end
77
+ # Composite two images together
78
+ # Composites two input images together; a layered image onto a base image. The first image you input is the base image. The second image (the layered image) will be composited on top of this base image. Supports PNG transparency. To control padding you can include transparent pixels at the border(s) of your layered images as appropriate.
79
+ # @param location Location to composite the layered images; possible values are: \&quot;center\&quot;, \&quot;top-left\&quot;, \&quot;top-center\&quot;, \&quot;top-right\&quot;, \&quot;center-left\&quot;, \&quot;center-right\&quot;, \&quot;bottom-left\&quot;, \&quot;bottom-center\&quot;, \&quot;bottom-right\&quot;
80
+ # @param base_image Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
81
+ # @param layered_image Image to layer on top of the base image.
82
+ # @param [Hash] opts the optional parameters
83
+ # @return [String]
84
+ def edit_composite_basic(location, base_image, layered_image, opts = {})
85
+ data, _status_code, _headers = edit_composite_basic_with_http_info(location, base_image, layered_image, opts)
86
+ data
87
+ end
88
+
89
+ # Composite two images together
90
+ # Composites two input images together; a layered image onto a base image. The first image you input is the base image. The second image (the layered image) will be composited on top of this base image. Supports PNG transparency. To control padding you can include transparent pixels at the border(s) of your layered images as appropriate.
91
+ # @param location Location to composite the layered images; possible values are: \&quot;center\&quot;, \&quot;top-left\&quot;, \&quot;top-center\&quot;, \&quot;top-right\&quot;, \&quot;center-left\&quot;, \&quot;center-right\&quot;, \&quot;bottom-left\&quot;, \&quot;bottom-center\&quot;, \&quot;bottom-right\&quot;
92
+ # @param base_image Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
93
+ # @param layered_image Image to layer on top of the base image.
94
+ # @param [Hash] opts the optional parameters
95
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
96
+ def edit_composite_basic_with_http_info(location, base_image, layered_image, opts = {})
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_composite_basic ...'
99
+ end
100
+ # verify the required parameter 'location' is set
101
+ if @api_client.config.client_side_validation && location.nil?
102
+ fail ArgumentError, "Missing the required parameter 'location' when calling EditApi.edit_composite_basic"
103
+ end
104
+ # verify the required parameter 'base_image' is set
105
+ if @api_client.config.client_side_validation && base_image.nil?
106
+ fail ArgumentError, "Missing the required parameter 'base_image' when calling EditApi.edit_composite_basic"
107
+ end
108
+ # verify the required parameter 'layered_image' is set
109
+ if @api_client.config.client_side_validation && layered_image.nil?
110
+ fail ArgumentError, "Missing the required parameter 'layered_image' when calling EditApi.edit_composite_basic"
111
+ end
112
+ # resource path
113
+ local_var_path = '/image/edit/composite/{location}'.sub('{' + 'location' + '}', location.to_s)
114
+
115
+ # query parameters
116
+ query_params = {}
117
+
118
+ # header parameters
119
+ header_params = {}
120
+ # HTTP header 'Accept' (if needed)
121
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
122
+ # HTTP header 'Content-Type'
123
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
124
+
125
+ # form parameters
126
+ form_params = {}
127
+ form_params['baseImage'] = base_image
128
+ form_params['layeredImage'] = layered_image
129
+
130
+ # http body (model)
131
+ post_body = nil
132
+ auth_names = ['Apikey']
133
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
134
+ :header_params => header_params,
135
+ :query_params => query_params,
136
+ :form_params => form_params,
137
+ :body => post_body,
138
+ :auth_names => auth_names,
139
+ :return_type => 'String')
140
+ if @api_client.config.debugging
141
+ @api_client.config.logger.debug "API called: EditApi#edit_composite_basic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
142
+ end
143
+ return data, status_code, headers
144
+ end
145
+ # Adaptively adjust the contrast of the image to be more appealing and easy to see
146
+ # Uses Gamma to adjust the contrast adaptively the way the human eye sees the world. Results significantly improve the viewability and visual appeal of the image.
147
+ # @param gamma Gamma value to adjust the contrast in the image. Recommended value is 2.0. Values between 0.0 and 1.0 will reduce contrast, while values above 1.0 will increase contrast.
148
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
149
+ # @param [Hash] opts the optional parameters
150
+ # @return [String]
151
+ def edit_contrast_adaptive(gamma, image_file, opts = {})
152
+ data, _status_code, _headers = edit_contrast_adaptive_with_http_info(gamma, image_file, opts)
153
+ data
154
+ end
155
+
156
+ # Adaptively adjust the contrast of the image to be more appealing and easy to see
157
+ # Uses Gamma to adjust the contrast adaptively the way the human eye sees the world. Results significantly improve the viewability and visual appeal of the image.
158
+ # @param gamma Gamma value to adjust the contrast in the image. Recommended value is 2.0. Values between 0.0 and 1.0 will reduce contrast, while values above 1.0 will increase contrast.
159
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
162
+ def edit_contrast_adaptive_with_http_info(gamma, image_file, opts = {})
163
+ if @api_client.config.debugging
164
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_contrast_adaptive ...'
165
+ end
166
+ # verify the required parameter 'gamma' is set
167
+ if @api_client.config.client_side_validation && gamma.nil?
168
+ fail ArgumentError, "Missing the required parameter 'gamma' when calling EditApi.edit_contrast_adaptive"
169
+ end
170
+ # verify the required parameter 'image_file' is set
171
+ if @api_client.config.client_side_validation && image_file.nil?
172
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_contrast_adaptive"
173
+ end
174
+ # resource path
175
+ local_var_path = '/image/edit/contrast/{gamma}/adaptive'.sub('{' + 'gamma' + '}', gamma.to_s)
176
+
177
+ # query parameters
178
+ query_params = {}
179
+
180
+ # header parameters
181
+ header_params = {}
182
+ # HTTP header 'Accept' (if needed)
183
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
184
+ # HTTP header 'Content-Type'
185
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
186
+
187
+ # form parameters
188
+ form_params = {}
189
+ form_params['imageFile'] = image_file
190
+
191
+ # http body (model)
192
+ post_body = nil
193
+ auth_names = ['Apikey']
194
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
195
+ :header_params => header_params,
196
+ :query_params => query_params,
197
+ :form_params => form_params,
198
+ :body => post_body,
199
+ :auth_names => auth_names,
200
+ :return_type => 'String')
201
+ if @api_client.config.debugging
202
+ @api_client.config.logger.debug "API called: EditApi#edit_contrast_adaptive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
203
+ end
204
+ return data, status_code, headers
205
+ end
206
+ # Crop an image to a rectangular area
207
+ # Crop an image to a target rectangular area
208
+ # @param left The left edge of the rectangular crop area in pixels (X).
209
+ # @param top The top edge of the rectangular crop area in pixels (Y).
210
+ # @param width The width of the rectangular crop area in pixels.
211
+ # @param height The height of the rectangular crop area in pixels.
212
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
213
+ # @param [Hash] opts the optional parameters
214
+ # @return [String]
215
+ def edit_crop_rectangle(left, top, width, height, image_file, opts = {})
216
+ data, _status_code, _headers = edit_crop_rectangle_with_http_info(left, top, width, height, image_file, opts)
217
+ data
218
+ end
219
+
220
+ # Crop an image to a rectangular area
221
+ # Crop an image to a target rectangular area
222
+ # @param left The left edge of the rectangular crop area in pixels (X).
223
+ # @param top The top edge of the rectangular crop area in pixels (Y).
224
+ # @param width The width of the rectangular crop area in pixels.
225
+ # @param height The height of the rectangular crop area in pixels.
226
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
227
+ # @param [Hash] opts the optional parameters
228
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
229
+ def edit_crop_rectangle_with_http_info(left, top, width, height, image_file, opts = {})
230
+ if @api_client.config.debugging
231
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_crop_rectangle ...'
232
+ end
233
+ # verify the required parameter 'left' is set
234
+ if @api_client.config.client_side_validation && left.nil?
235
+ fail ArgumentError, "Missing the required parameter 'left' when calling EditApi.edit_crop_rectangle"
236
+ end
237
+ # verify the required parameter 'top' is set
238
+ if @api_client.config.client_side_validation && top.nil?
239
+ fail ArgumentError, "Missing the required parameter 'top' when calling EditApi.edit_crop_rectangle"
240
+ end
241
+ # verify the required parameter 'width' is set
242
+ if @api_client.config.client_side_validation && width.nil?
243
+ fail ArgumentError, "Missing the required parameter 'width' when calling EditApi.edit_crop_rectangle"
244
+ end
245
+ # verify the required parameter 'height' is set
246
+ if @api_client.config.client_side_validation && height.nil?
247
+ fail ArgumentError, "Missing the required parameter 'height' when calling EditApi.edit_crop_rectangle"
248
+ end
249
+ # verify the required parameter 'image_file' is set
250
+ if @api_client.config.client_side_validation && image_file.nil?
251
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_crop_rectangle"
252
+ end
253
+ # resource path
254
+ local_var_path = '/image/edit/crop/rectangle/{left}/{top}/{width}/{height}'.sub('{' + 'left' + '}', left.to_s).sub('{' + 'top' + '}', top.to_s).sub('{' + 'width' + '}', width.to_s).sub('{' + 'height' + '}', height.to_s)
255
+
256
+ # query parameters
257
+ query_params = {}
258
+
259
+ # header parameters
260
+ header_params = {}
261
+ # HTTP header 'Accept' (if needed)
262
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
263
+ # HTTP header 'Content-Type'
264
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
265
+
266
+ # form parameters
267
+ form_params = {}
268
+ form_params['imageFile'] = image_file
269
+
270
+ # http body (model)
271
+ post_body = nil
272
+ auth_names = ['Apikey']
273
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => 'String')
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug "API called: EditApi#edit_crop_rectangle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
282
+ end
283
+ return data, status_code, headers
284
+ end
285
+ # Draw a polygon onto an image
286
+ # Draw one or more polygons, with customized visuals, onto an image
287
+ # @param request Polygon drawing request parameters
288
+ # @param [Hash] opts the optional parameters
289
+ # @return [String]
290
+ def edit_draw_polygon(request, opts = {})
291
+ data, _status_code, _headers = edit_draw_polygon_with_http_info(request, opts)
292
+ data
293
+ end
294
+
295
+ # Draw a polygon onto an image
296
+ # Draw one or more polygons, with customized visuals, onto an image
297
+ # @param request Polygon drawing request parameters
298
+ # @param [Hash] opts the optional parameters
299
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
300
+ def edit_draw_polygon_with_http_info(request, opts = {})
301
+ if @api_client.config.debugging
302
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_draw_polygon ...'
303
+ end
304
+ # verify the required parameter 'request' is set
305
+ if @api_client.config.client_side_validation && request.nil?
306
+ fail ArgumentError, "Missing the required parameter 'request' when calling EditApi.edit_draw_polygon"
307
+ end
308
+ # resource path
309
+ local_var_path = '/image/edit/draw/polygon'
310
+
311
+ # query parameters
312
+ query_params = {}
313
+
314
+ # header parameters
315
+ header_params = {}
316
+ # HTTP header 'Accept' (if needed)
317
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
318
+ # HTTP header 'Content-Type'
319
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
320
+
321
+ # form parameters
322
+ form_params = {}
323
+
324
+ # http body (model)
325
+ post_body = @api_client.object_to_http_body(request)
326
+ auth_names = ['Apikey']
327
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
328
+ :header_params => header_params,
329
+ :query_params => query_params,
330
+ :form_params => form_params,
331
+ :body => post_body,
332
+ :auth_names => auth_names,
333
+ :return_type => 'String')
334
+ if @api_client.config.debugging
335
+ @api_client.config.logger.debug "API called: EditApi#edit_draw_polygon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
336
+ end
337
+ return data, status_code, headers
338
+ end
339
+ # Draw a rectangle onto an image
340
+ # Draw one or more rectangles, with customized visuals, onto an image
341
+ # @param request Draw rectangle parameters
342
+ # @param [Hash] opts the optional parameters
343
+ # @return [String]
344
+ def edit_draw_rectangle(request, opts = {})
345
+ data, _status_code, _headers = edit_draw_rectangle_with_http_info(request, opts)
346
+ data
347
+ end
348
+
349
+ # Draw a rectangle onto an image
350
+ # Draw one or more rectangles, with customized visuals, onto an image
351
+ # @param request Draw rectangle parameters
352
+ # @param [Hash] opts the optional parameters
353
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
354
+ def edit_draw_rectangle_with_http_info(request, opts = {})
355
+ if @api_client.config.debugging
356
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_draw_rectangle ...'
357
+ end
358
+ # verify the required parameter 'request' is set
359
+ if @api_client.config.client_side_validation && request.nil?
360
+ fail ArgumentError, "Missing the required parameter 'request' when calling EditApi.edit_draw_rectangle"
361
+ end
362
+ # resource path
363
+ local_var_path = '/image/edit/draw/rectangle'
364
+
365
+ # query parameters
366
+ query_params = {}
367
+
368
+ # header parameters
369
+ header_params = {}
370
+ # HTTP header 'Accept' (if needed)
371
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
372
+ # HTTP header 'Content-Type'
373
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
374
+
375
+ # form parameters
376
+ form_params = {}
377
+
378
+ # http body (model)
379
+ post_body = @api_client.object_to_http_body(request)
380
+ auth_names = ['Apikey']
381
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
382
+ :header_params => header_params,
383
+ :query_params => query_params,
384
+ :form_params => form_params,
385
+ :body => post_body,
386
+ :auth_names => auth_names,
387
+ :return_type => 'String')
388
+ if @api_client.config.debugging
389
+ @api_client.config.logger.debug "API called: EditApi#edit_draw_rectangle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
390
+ end
391
+ return data, status_code, headers
392
+ end
393
+ # Draw text onto an image
394
+ # Draw one or more pieces of text, with customized visuals, onto an image
395
+ # @param request Draw text parameters
396
+ # @param [Hash] opts the optional parameters
397
+ # @return [String]
398
+ def edit_draw_text(request, opts = {})
399
+ data, _status_code, _headers = edit_draw_text_with_http_info(request, opts)
400
+ data
401
+ end
402
+
403
+ # Draw text onto an image
404
+ # Draw one or more pieces of text, with customized visuals, onto an image
405
+ # @param request Draw text parameters
406
+ # @param [Hash] opts the optional parameters
407
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
408
+ def edit_draw_text_with_http_info(request, opts = {})
409
+ if @api_client.config.debugging
410
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_draw_text ...'
411
+ end
412
+ # verify the required parameter 'request' is set
413
+ if @api_client.config.client_side_validation && request.nil?
414
+ fail ArgumentError, "Missing the required parameter 'request' when calling EditApi.edit_draw_text"
415
+ end
416
+ # resource path
417
+ local_var_path = '/image/edit/draw/text'
418
+
419
+ # query parameters
420
+ query_params = {}
421
+
422
+ # header parameters
423
+ header_params = {}
424
+ # HTTP header 'Accept' (if needed)
425
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
426
+ # HTTP header 'Content-Type'
427
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
428
+
429
+ # form parameters
430
+ form_params = {}
431
+
432
+ # http body (model)
433
+ post_body = @api_client.object_to_http_body(request)
434
+ auth_names = ['Apikey']
435
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
436
+ :header_params => header_params,
437
+ :query_params => query_params,
438
+ :form_params => form_params,
439
+ :body => post_body,
440
+ :auth_names => auth_names,
441
+ :return_type => 'String')
442
+ if @api_client.config.debugging
443
+ @api_client.config.logger.debug "API called: EditApi#edit_draw_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
444
+ end
445
+ return data, status_code, headers
446
+ end
447
+ # Add a customizeable drop shadow to an image
448
+ # Add a customizeable drop shadow to the image
449
+ # @param x Horizontal (X) offset of the drop shadow
450
+ # @param y Vertical (Y) offset of the drop shadow
451
+ # @param sigma Sigma (blur distance) of the drop shadow
452
+ # @param opacity Opacity of the drop shadow; 0 is 0% and 100 is 100%
453
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
454
+ # @param [Hash] opts the optional parameters
455
+ # @return [String]
456
+ def edit_drop_shadow(x, y, sigma, opacity, image_file, opts = {})
457
+ data, _status_code, _headers = edit_drop_shadow_with_http_info(x, y, sigma, opacity, image_file, opts)
458
+ data
459
+ end
460
+
461
+ # Add a customizeable drop shadow to an image
462
+ # Add a customizeable drop shadow to the image
463
+ # @param x Horizontal (X) offset of the drop shadow
464
+ # @param y Vertical (Y) offset of the drop shadow
465
+ # @param sigma Sigma (blur distance) of the drop shadow
466
+ # @param opacity Opacity of the drop shadow; 0 is 0% and 100 is 100%
467
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
468
+ # @param [Hash] opts the optional parameters
469
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
470
+ def edit_drop_shadow_with_http_info(x, y, sigma, opacity, image_file, opts = {})
471
+ if @api_client.config.debugging
472
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_drop_shadow ...'
473
+ end
474
+ # verify the required parameter 'x' is set
475
+ if @api_client.config.client_side_validation && x.nil?
476
+ fail ArgumentError, "Missing the required parameter 'x' when calling EditApi.edit_drop_shadow"
477
+ end
478
+ # verify the required parameter 'y' is set
479
+ if @api_client.config.client_side_validation && y.nil?
480
+ fail ArgumentError, "Missing the required parameter 'y' when calling EditApi.edit_drop_shadow"
481
+ end
482
+ # verify the required parameter 'sigma' is set
483
+ if @api_client.config.client_side_validation && sigma.nil?
484
+ fail ArgumentError, "Missing the required parameter 'sigma' when calling EditApi.edit_drop_shadow"
485
+ end
486
+ # verify the required parameter 'opacity' is set
487
+ if @api_client.config.client_side_validation && opacity.nil?
488
+ fail ArgumentError, "Missing the required parameter 'opacity' when calling EditApi.edit_drop_shadow"
489
+ end
490
+ # verify the required parameter 'image_file' is set
491
+ if @api_client.config.client_side_validation && image_file.nil?
492
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_drop_shadow"
493
+ end
494
+ # resource path
495
+ local_var_path = '/image/edit/drop-shadow/{X}/{Y}/{sigma}/{opacity}'.sub('{' + 'X' + '}', x.to_s).sub('{' + 'Y' + '}', y.to_s).sub('{' + 'sigma' + '}', sigma.to_s).sub('{' + 'opacity' + '}', opacity.to_s)
496
+
497
+ # query parameters
498
+ query_params = {}
499
+
500
+ # header parameters
501
+ header_params = {}
502
+ # HTTP header 'Accept' (if needed)
503
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
504
+ # HTTP header 'Content-Type'
505
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
506
+
507
+ # form parameters
508
+ form_params = {}
509
+ form_params['imageFile'] = image_file
510
+
511
+ # http body (model)
512
+ post_body = nil
513
+ auth_names = ['Apikey']
514
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
515
+ :header_params => header_params,
516
+ :query_params => query_params,
517
+ :form_params => form_params,
518
+ :body => post_body,
519
+ :auth_names => auth_names,
520
+ :return_type => 'String')
521
+ if @api_client.config.debugging
522
+ @api_client.config.logger.debug "API called: EditApi#edit_drop_shadow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
523
+ end
524
+ return data, status_code, headers
525
+ end
526
+ # Invert, negate the colors in the image
527
+ # Inverts (negates) all of the colors in the image. If the image contains transparency, the transparency will first be removed prior to inverting the image.
528
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
529
+ # @param [Hash] opts the optional parameters
530
+ # @return [String]
531
+ def edit_invert(image_file, opts = {})
532
+ data, _status_code, _headers = edit_invert_with_http_info(image_file, opts)
533
+ data
534
+ end
535
+
536
+ # Invert, negate the colors in the image
537
+ # Inverts (negates) all of the colors in the image. If the image contains transparency, the transparency will first be removed prior to inverting the image.
538
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
539
+ # @param [Hash] opts the optional parameters
540
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
541
+ def edit_invert_with_http_info(image_file, opts = {})
542
+ if @api_client.config.debugging
543
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_invert ...'
544
+ end
545
+ # verify the required parameter 'image_file' is set
546
+ if @api_client.config.client_side_validation && image_file.nil?
547
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_invert"
548
+ end
549
+ # resource path
550
+ local_var_path = '/image/edit/invert'
551
+
552
+ # query parameters
553
+ query_params = {}
554
+
555
+ # header parameters
556
+ header_params = {}
557
+ # HTTP header 'Accept' (if needed)
558
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
559
+ # HTTP header 'Content-Type'
560
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
561
+
562
+ # form parameters
563
+ form_params = {}
564
+ form_params['imageFile'] = image_file
565
+
566
+ # http body (model)
567
+ post_body = nil
568
+ auth_names = ['Apikey']
569
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
570
+ :header_params => header_params,
571
+ :query_params => query_params,
572
+ :form_params => form_params,
573
+ :body => post_body,
574
+ :auth_names => auth_names,
575
+ :return_type => 'String')
576
+ if @api_client.config.debugging
577
+ @api_client.config.logger.debug "API called: EditApi#edit_invert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
578
+ end
579
+ return data, status_code, headers
580
+ end
581
+ # Remove EXIF data from the image
582
+ # Removes any EXIF data and profiles .
583
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
584
+ # @param [Hash] opts the optional parameters
585
+ # @return [String]
586
+ def edit_remove_exif_data(image_file, opts = {})
587
+ data, _status_code, _headers = edit_remove_exif_data_with_http_info(image_file, opts)
588
+ data
589
+ end
590
+
591
+ # Remove EXIF data from the image
592
+ # Removes any EXIF data and profiles .
593
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
594
+ # @param [Hash] opts the optional parameters
595
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
596
+ def edit_remove_exif_data_with_http_info(image_file, opts = {})
597
+ if @api_client.config.debugging
598
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_remove_exif_data ...'
599
+ end
600
+ # verify the required parameter 'image_file' is set
601
+ if @api_client.config.client_side_validation && image_file.nil?
602
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_remove_exif_data"
603
+ end
604
+ # resource path
605
+ local_var_path = '/image/edit/remove-exif'
606
+
607
+ # query parameters
608
+ query_params = {}
609
+
610
+ # header parameters
611
+ header_params = {}
612
+ # HTTP header 'Accept' (if needed)
613
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
614
+ # HTTP header 'Content-Type'
615
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
616
+
617
+ # form parameters
618
+ form_params = {}
619
+ form_params['imageFile'] = image_file
620
+
621
+ # http body (model)
622
+ post_body = nil
623
+ auth_names = ['Apikey']
624
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
625
+ :header_params => header_params,
626
+ :query_params => query_params,
627
+ :form_params => form_params,
628
+ :body => post_body,
629
+ :auth_names => auth_names,
630
+ :return_type => 'String')
631
+ if @api_client.config.debugging
632
+ @api_client.config.logger.debug "API called: EditApi#edit_remove_exif_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
633
+ end
634
+ return data, status_code, headers
635
+ end
636
+ # Remove transparency from the image
637
+ # Removes any active transparency in the image. Effectively renders the image at the same resolution, in the same file format, over a white background, thus removing transparency.
638
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
639
+ # @param [Hash] opts the optional parameters
640
+ # @return [String]
641
+ def edit_remove_transparency(image_file, opts = {})
642
+ data, _status_code, _headers = edit_remove_transparency_with_http_info(image_file, opts)
643
+ data
644
+ end
645
+
646
+ # Remove transparency from the image
647
+ # Removes any active transparency in the image. Effectively renders the image at the same resolution, in the same file format, over a white background, thus removing transparency.
648
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
649
+ # @param [Hash] opts the optional parameters
650
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
651
+ def edit_remove_transparency_with_http_info(image_file, opts = {})
652
+ if @api_client.config.debugging
653
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_remove_transparency ...'
654
+ end
655
+ # verify the required parameter 'image_file' is set
656
+ if @api_client.config.client_side_validation && image_file.nil?
657
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_remove_transparency"
658
+ end
659
+ # resource path
660
+ local_var_path = '/image/edit/remove-transparency'
661
+
662
+ # query parameters
663
+ query_params = {}
664
+
665
+ # header parameters
666
+ header_params = {}
667
+ # HTTP header 'Accept' (if needed)
668
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
669
+ # HTTP header 'Content-Type'
670
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
671
+
672
+ # form parameters
673
+ form_params = {}
674
+ form_params['imageFile'] = image_file
675
+
676
+ # http body (model)
677
+ post_body = nil
678
+ auth_names = ['Apikey']
679
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
680
+ :header_params => header_params,
681
+ :query_params => query_params,
682
+ :form_params => form_params,
683
+ :body => post_body,
684
+ :auth_names => auth_names,
685
+ :return_type => 'String')
686
+ if @api_client.config.debugging
687
+ @api_client.config.logger.debug "API called: EditApi#edit_remove_transparency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
688
+ end
689
+ return data, status_code, headers
690
+ end
691
+ # Rotate an image any number of degrees
692
+ # Rotates an image by an arbitrary number of degrees
693
+ # @param degrees Degrees to rotate the image; values range from 0.0 to 360.0.
694
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
695
+ # @param [Hash] opts the optional parameters
696
+ # @return [String]
697
+ def edit_rotate(degrees, image_file, opts = {})
698
+ data, _status_code, _headers = edit_rotate_with_http_info(degrees, image_file, opts)
699
+ data
700
+ end
701
+
702
+ # Rotate an image any number of degrees
703
+ # Rotates an image by an arbitrary number of degrees
704
+ # @param degrees Degrees to rotate the image; values range from 0.0 to 360.0.
705
+ # @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
706
+ # @param [Hash] opts the optional parameters
707
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
708
+ def edit_rotate_with_http_info(degrees, image_file, opts = {})
709
+ if @api_client.config.debugging
710
+ @api_client.config.logger.debug 'Calling API: EditApi.edit_rotate ...'
711
+ end
712
+ # verify the required parameter 'degrees' is set
713
+ if @api_client.config.client_side_validation && degrees.nil?
714
+ fail ArgumentError, "Missing the required parameter 'degrees' when calling EditApi.edit_rotate"
715
+ end
716
+ # verify the required parameter 'image_file' is set
717
+ if @api_client.config.client_side_validation && image_file.nil?
718
+ fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_rotate"
719
+ end
720
+ # resource path
721
+ local_var_path = '/image/edit/rotate/{degrees}/angle'.sub('{' + 'degrees' + '}', degrees.to_s)
722
+
723
+ # query parameters
724
+ query_params = {}
725
+
726
+ # header parameters
727
+ header_params = {}
728
+ # HTTP header 'Accept' (if needed)
729
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
730
+ # HTTP header 'Content-Type'
731
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
732
+
733
+ # form parameters
734
+ form_params = {}
735
+ form_params['imageFile'] = image_file
736
+
737
+ # http body (model)
738
+ post_body = nil
739
+ auth_names = ['Apikey']
740
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
741
+ :header_params => header_params,
742
+ :query_params => query_params,
743
+ :form_params => form_params,
744
+ :body => post_body,
745
+ :auth_names => auth_names,
746
+ :return_type => 'String')
747
+ if @api_client.config.debugging
748
+ @api_client.config.logger.debug "API called: EditApi#edit_rotate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
749
+ end
750
+ return data, status_code, headers
751
+ end
752
+ end
753
+ end