Class: CloudmersiveImageRecognitionApiClient::EditApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudmersive-image-recognition-api-client/api/edit_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EditApi

Returns a new instance of EditApi.



19
20
21
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#edit_auto_orient(image_file, opts = {}) ⇒ String

Normalizes image rotation and removes EXIF rotation data 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.

Parameters:

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


28
29
30
31
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 28

def edit_auto_orient(image_file, opts = {})
  data, _status_code, _headers = edit_auto_orient_with_http_info(image_file, opts)
  return data
end

#edit_auto_orient_with_http_info(image_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Normalizes image rotation and removes EXIF rotation data 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.

Parameters:

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 38

def edit_auto_orient_with_http_info(image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_auto_orient ..."
  end
  # verify the required parameter 'image_file' is set
  if @api_client.config.client_side_validation && image_file.nil?
    fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_auto_orient"
  end
  # resource path
  local_var_path = "/image/edit/auto-orient/remove-exif"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["imageFile"] = image_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_auto_orient\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_composite_basic(location, base_image, layered_image, opts = {}) ⇒ String

Composite two images together 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.

Parameters:

  • 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;

  • base_image

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • layered_image

    Image to layer on top of the base image.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


86
87
88
89
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 86

def edit_composite_basic(location, base_image, layered_image, opts = {})
  data, _status_code, _headers = edit_composite_basic_with_http_info(location, base_image, layered_image, opts)
  return data
end

#edit_composite_basic_with_http_info(location, base_image, layered_image, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Composite two images together 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.

Parameters:

  • 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;

  • base_image

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • layered_image

    Image to layer on top of the base image.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 98

def edit_composite_basic_with_http_info(location, base_image, layered_image, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_composite_basic ..."
  end
  # verify the required parameter 'location' is set
  if @api_client.config.client_side_validation && location.nil?
    fail ArgumentError, "Missing the required parameter 'location' when calling EditApi.edit_composite_basic"
  end
  # verify the required parameter 'base_image' is set
  if @api_client.config.client_side_validation && base_image.nil?
    fail ArgumentError, "Missing the required parameter 'base_image' when calling EditApi.edit_composite_basic"
  end
  # verify the required parameter 'layered_image' is set
  if @api_client.config.client_side_validation && layered_image.nil?
    fail ArgumentError, "Missing the required parameter 'layered_image' when calling EditApi.edit_composite_basic"
  end
  # resource path
  local_var_path = "/image/edit/composite/{location}".sub('{' + 'location' + '}', location.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["baseImage"] = base_image
  form_params["layeredImage"] = layered_image

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_composite_basic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_contrast_adaptive(gamma, image_file, opts = {}) ⇒ String

Adaptively adjust the contrast of the image to be more appealing and easy to see 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.

Parameters:

  • 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.

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


154
155
156
157
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 154

def edit_contrast_adaptive(gamma, image_file, opts = {})
  data, _status_code, _headers = edit_contrast_adaptive_with_http_info(gamma, image_file, opts)
  return data
end

#edit_contrast_adaptive_with_http_info(gamma, image_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Adaptively adjust the contrast of the image to be more appealing and easy to see 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.

Parameters:

  • 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.

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 165

def edit_contrast_adaptive_with_http_info(gamma, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_contrast_adaptive ..."
  end
  # verify the required parameter 'gamma' is set
  if @api_client.config.client_side_validation && gamma.nil?
    fail ArgumentError, "Missing the required parameter 'gamma' when calling EditApi.edit_contrast_adaptive"
  end
  # verify the required parameter 'image_file' is set
  if @api_client.config.client_side_validation && image_file.nil?
    fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_contrast_adaptive"
  end
  # resource path
  local_var_path = "/image/edit/contrast/{gamma}/adaptive".sub('{' + 'gamma' + '}', gamma.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["imageFile"] = image_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_contrast_adaptive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_crop_rectangle(left, top, width, height, image_file, opts = {}) ⇒ String

Crop an image to a rectangular area Crop an image to a target rectangular area

Parameters:

  • left

    The left edge of the rectangular crop area in pixels (X).

  • top

    The top edge of the rectangular crop area in pixels (Y).

  • width

    The width of the rectangular crop area in pixels.

  • height

    The height of the rectangular crop area in pixels.

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


219
220
221
222
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 219

def edit_crop_rectangle(left, top, width, height, image_file, opts = {})
  data, _status_code, _headers = edit_crop_rectangle_with_http_info(left, top, width, height, image_file, opts)
  return data
end

#edit_crop_rectangle_with_http_info(left, top, width, height, image_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Crop an image to a rectangular area Crop an image to a target rectangular area

Parameters:

  • left

    The left edge of the rectangular crop area in pixels (X).

  • top

    The top edge of the rectangular crop area in pixels (Y).

  • width

    The width of the rectangular crop area in pixels.

  • height

    The height of the rectangular crop area in pixels.

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 233

def edit_crop_rectangle_with_http_info(left, top, width, height, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_crop_rectangle ..."
  end
  # verify the required parameter 'left' is set
  if @api_client.config.client_side_validation && left.nil?
    fail ArgumentError, "Missing the required parameter 'left' when calling EditApi.edit_crop_rectangle"
  end
  # verify the required parameter 'top' is set
  if @api_client.config.client_side_validation && top.nil?
    fail ArgumentError, "Missing the required parameter 'top' when calling EditApi.edit_crop_rectangle"
  end
  # verify the required parameter 'width' is set
  if @api_client.config.client_side_validation && width.nil?
    fail ArgumentError, "Missing the required parameter 'width' when calling EditApi.edit_crop_rectangle"
  end
  # verify the required parameter 'height' is set
  if @api_client.config.client_side_validation && height.nil?
    fail ArgumentError, "Missing the required parameter 'height' when calling EditApi.edit_crop_rectangle"
  end
  # verify the required parameter 'image_file' is set
  if @api_client.config.client_side_validation && image_file.nil?
    fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_crop_rectangle"
  end
  # resource path
  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)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["imageFile"] = image_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_crop_rectangle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_draw_polygon(request, opts = {}) ⇒ String

Draw a polygon onto an image Draw one or more polygons, with customized visuals, onto an image

Parameters:

  • request

    Polygon drawing request parameters

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


295
296
297
298
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 295

def edit_draw_polygon(request, opts = {})
  data, _status_code, _headers = edit_draw_polygon_with_http_info(request, opts)
  return data
end

#edit_draw_polygon_with_http_info(request, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Draw a polygon onto an image Draw one or more polygons, with customized visuals, onto an image

Parameters:

  • request

    Polygon drawing request parameters

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 305

def edit_draw_polygon_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_draw_polygon ..."
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling EditApi.edit_draw_polygon"
  end
  # resource path
  local_var_path = "/image/edit/draw/polygon"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_draw_polygon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_draw_rectangle(request, opts = {}) ⇒ String

Draw a rectangle onto an image Draw one or more rectangles, with customized visuals, onto an image

Parameters:

  • request

    Draw rectangle parameters

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


350
351
352
353
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 350

def edit_draw_rectangle(request, opts = {})
  data, _status_code, _headers = edit_draw_rectangle_with_http_info(request, opts)
  return data
end

#edit_draw_rectangle_with_http_info(request, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Draw a rectangle onto an image Draw one or more rectangles, with customized visuals, onto an image

Parameters:

  • request

    Draw rectangle parameters

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 360

def edit_draw_rectangle_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_draw_rectangle ..."
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling EditApi.edit_draw_rectangle"
  end
  # resource path
  local_var_path = "/image/edit/draw/rectangle"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_draw_rectangle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_draw_text(request, opts = {}) ⇒ String

Draw text onto an image Draw one or more pieces of text, with customized visuals, onto an image

Parameters:

  • request

    Draw text parameters

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


405
406
407
408
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 405

def edit_draw_text(request, opts = {})
  data, _status_code, _headers = edit_draw_text_with_http_info(request, opts)
  return data
end

#edit_draw_text_with_http_info(request, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Draw text onto an image Draw one or more pieces of text, with customized visuals, onto an image

Parameters:

  • request

    Draw text parameters

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 415

def edit_draw_text_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_draw_text ..."
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling EditApi.edit_draw_text"
  end
  # resource path
  local_var_path = "/image/edit/draw/text"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_draw_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_drop_shadow(x, y, sigma, opacity, image_file, opts = {}) ⇒ String

Add a customizeable drop shadow to an image Add a customizeable drop shadow to the image

Parameters:

  • x

    Horizontal (X) offset of the drop shadow

  • y

    Vertical (Y) offset of the drop shadow

  • sigma

    Sigma (blur distance) of the drop shadow

  • opacity

    Opacity of the drop shadow; 0 is 0% and 100 is 100%

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


464
465
466
467
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 464

def edit_drop_shadow(x, y, sigma, opacity, image_file, opts = {})
  data, _status_code, _headers = edit_drop_shadow_with_http_info(x, y, sigma, opacity, image_file, opts)
  return data
end

#edit_drop_shadow_with_http_info(x, y, sigma, opacity, image_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Add a customizeable drop shadow to an image Add a customizeable drop shadow to the image

Parameters:

  • x

    Horizontal (X) offset of the drop shadow

  • y

    Vertical (Y) offset of the drop shadow

  • sigma

    Sigma (blur distance) of the drop shadow

  • opacity

    Opacity of the drop shadow; 0 is 0% and 100 is 100%

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 478

def edit_drop_shadow_with_http_info(x, y, sigma, opacity, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_drop_shadow ..."
  end
  # verify the required parameter 'x' is set
  if @api_client.config.client_side_validation && x.nil?
    fail ArgumentError, "Missing the required parameter 'x' when calling EditApi.edit_drop_shadow"
  end
  # verify the required parameter 'y' is set
  if @api_client.config.client_side_validation && y.nil?
    fail ArgumentError, "Missing the required parameter 'y' when calling EditApi.edit_drop_shadow"
  end
  # verify the required parameter 'sigma' is set
  if @api_client.config.client_side_validation && sigma.nil?
    fail ArgumentError, "Missing the required parameter 'sigma' when calling EditApi.edit_drop_shadow"
  end
  # verify the required parameter 'opacity' is set
  if @api_client.config.client_side_validation && opacity.nil?
    fail ArgumentError, "Missing the required parameter 'opacity' when calling EditApi.edit_drop_shadow"
  end
  # verify the required parameter 'image_file' is set
  if @api_client.config.client_side_validation && image_file.nil?
    fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_drop_shadow"
  end
  # resource path
  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)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["imageFile"] = image_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_drop_shadow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_invert(image_file, opts = {}) ⇒ String

Invert, negate the colors in the image 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.

Parameters:

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


540
541
542
543
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 540

def edit_invert(image_file, opts = {})
  data, _status_code, _headers = edit_invert_with_http_info(image_file, opts)
  return data
end

#edit_invert_with_http_info(image_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Invert, negate the colors in the image 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.

Parameters:

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 550

def edit_invert_with_http_info(image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_invert ..."
  end
  # verify the required parameter 'image_file' is set
  if @api_client.config.client_side_validation && image_file.nil?
    fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_invert"
  end
  # resource path
  local_var_path = "/image/edit/invert"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["imageFile"] = image_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_invert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_remove_exif_data(image_file, opts = {}) ⇒ String

Remove EXIF data from the image Removes any EXIF data and profiles .

Parameters:

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


596
597
598
599
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 596

def edit_remove_exif_data(image_file, opts = {})
  data, _status_code, _headers = edit_remove_exif_data_with_http_info(image_file, opts)
  return data
end

#edit_remove_exif_data_with_http_info(image_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Remove EXIF data from the image Removes any EXIF data and profiles .

Parameters:

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 606

def edit_remove_exif_data_with_http_info(image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_remove_exif_data ..."
  end
  # verify the required parameter 'image_file' is set
  if @api_client.config.client_side_validation && image_file.nil?
    fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_remove_exif_data"
  end
  # resource path
  local_var_path = "/image/edit/remove-exif"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["imageFile"] = image_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_remove_exif_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_remove_transparency(image_file, opts = {}) ⇒ String

Remove transparency from the image 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.

Parameters:

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


652
653
654
655
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 652

def edit_remove_transparency(image_file, opts = {})
  data, _status_code, _headers = edit_remove_transparency_with_http_info(image_file, opts)
  return data
end

#edit_remove_transparency_with_http_info(image_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Remove transparency from the image 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.

Parameters:

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 662

def edit_remove_transparency_with_http_info(image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_remove_transparency ..."
  end
  # verify the required parameter 'image_file' is set
  if @api_client.config.client_side_validation && image_file.nil?
    fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_remove_transparency"
  end
  # resource path
  local_var_path = "/image/edit/remove-transparency"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["imageFile"] = image_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_remove_transparency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_rotate(degrees, image_file, opts = {}) ⇒ String

Rotate an image any number of degrees Rotates an image by an arbitrary number of degrees

Parameters:

  • degrees

    Degrees to rotate the image; values range from 0.0 to 360.0.

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


709
710
711
712
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 709

def edit_rotate(degrees, image_file, opts = {})
  data, _status_code, _headers = edit_rotate_with_http_info(degrees, image_file, opts)
  return data
end

#edit_rotate_with_http_info(degrees, image_file, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Rotate an image any number of degrees Rotates an image by an arbitrary number of degrees

Parameters:

  • degrees

    Degrees to rotate the image; values range from 0.0 to 360.0.

  • image_file

    Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
# File 'lib/cloudmersive-image-recognition-api-client/api/edit_api.rb', line 720

def edit_rotate_with_http_info(degrees, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EditApi.edit_rotate ..."
  end
  # verify the required parameter 'degrees' is set
  if @api_client.config.client_side_validation && degrees.nil?
    fail ArgumentError, "Missing the required parameter 'degrees' when calling EditApi.edit_rotate"
  end
  # verify the required parameter 'image_file' is set
  if @api_client.config.client_side_validation && image_file.nil?
    fail ArgumentError, "Missing the required parameter 'image_file' when calling EditApi.edit_rotate"
  end
  # resource path
  local_var_path = "/image/edit/rotate/{degrees}/angle".sub('{' + 'degrees' + '}', degrees.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["imageFile"] = image_file

  # http body (model)
  post_body = nil
  auth_names = ['Apikey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EditApi#edit_rotate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end