cloudmersive-image-recognition-api-client 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +132 -0
- data/Rakefile +8 -0
- data/cloudmersive-image-recognition-api-client.gemspec +45 -0
- data/docs/AgeDetectionResult.md +10 -0
- data/docs/ArtisticApi.md +66 -0
- data/docs/DetectedLicensePlate.md +14 -0
- data/docs/DetectedObject.md +13 -0
- data/docs/DrawRectangleInstance.md +14 -0
- data/docs/DrawRectangleRequest.md +10 -0
- data/docs/DrawTextInstance.md +15 -0
- data/docs/DrawTextRequest.md +10 -0
- data/docs/EditApi.md +179 -0
- data/docs/Face.md +11 -0
- data/docs/FaceApi.md +228 -0
- data/docs/FaceLocateResponse.md +11 -0
- data/docs/ImageDescriptionResponse.md +11 -0
- data/docs/NsfwApi.md +63 -0
- data/docs/NsfwResult.md +10 -0
- data/docs/ObjectDetectionResult.md +10 -0
- data/docs/PersonWithAge.md +10 -0
- data/docs/RecognitionOutcome.md +9 -0
- data/docs/RecognizeApi.md +287 -0
- data/docs/ResizeApi.md +69 -0
- data/docs/VehicleLicensePlateDetectionResult.md +10 -0
- data/git_push.sh +55 -0
- data/lib/cloudmersive-image-recognition-api-client.rb +60 -0
- data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +85 -0
- data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +202 -0
- data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +247 -0
- data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +79 -0
- data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +306 -0
- data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +91 -0
- data/lib/cloudmersive-image-recognition-api-client/api_client.rb +389 -0
- data/lib/cloudmersive-image-recognition-api-client/api_error.rb +38 -0
- data/lib/cloudmersive-image-recognition-api-client/configuration.rb +209 -0
- data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +211 -0
- data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +245 -0
- data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +239 -0
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +249 -0
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +227 -0
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +259 -0
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +227 -0
- data/lib/cloudmersive-image-recognition-api-client/models/face.rb +219 -0
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +220 -0
- data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +219 -0
- data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +209 -0
- data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +211 -0
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +209 -0
- data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +199 -0
- data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +211 -0
- data/lib/cloudmersive-image-recognition-api-client/version.rb +15 -0
- data/spec/api/artistic_api_spec.rb +48 -0
- data/spec/api/edit_api_spec.rb +73 -0
- data/spec/api/face_api_spec.rb +83 -0
- data/spec/api/nsfw_api_spec.rb +47 -0
- data/spec/api/recognize_api_spec.rb +96 -0
- data/spec/api/resize_api_spec.rb +49 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/age_detection_result_spec.rb +54 -0
- data/spec/models/detected_license_plate_spec.rb +78 -0
- data/spec/models/detected_object_spec.rb +72 -0
- data/spec/models/draw_rectangle_instance_spec.rb +78 -0
- data/spec/models/draw_rectangle_request_spec.rb +54 -0
- data/spec/models/draw_text_instance_spec.rb +84 -0
- data/spec/models/draw_text_request_spec.rb +54 -0
- data/spec/models/face_locate_response_spec.rb +60 -0
- data/spec/models/face_spec.rb +60 -0
- data/spec/models/image_description_response_spec.rb +60 -0
- data/spec/models/nsfw_result_spec.rb +54 -0
- data/spec/models/object_detection_result_spec.rb +54 -0
- data/spec/models/person_with_age_spec.rb +54 -0
- data/spec/models/recognition_outcome_spec.rb +48 -0
- data/spec/models/vehicle_license_plate_detection_result_spec.rb +54 -0
- data/spec/spec_helper.rb +111 -0
- metadata +302 -0
data/docs/ResizeApi.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# CloudmersiveImageRecognitionApiClient::ResizeApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.cloudmersive.com*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**resize_post**](ResizeApi.md#resize_post) | **POST** /image/resize/preserveAspectRatio/{maxWidth}/{maxHeight} | Resize an image with parameters
|
8
|
+
|
9
|
+
|
10
|
+
# **resize_post**
|
11
|
+
> String resize_post(max_width, max_height, image_file)
|
12
|
+
|
13
|
+
Resize an image with parameters
|
14
|
+
|
15
|
+
Resize an image to a maximum width and maximum height, while preserving the image's original aspect ratio
|
16
|
+
|
17
|
+
### Example
|
18
|
+
```ruby
|
19
|
+
# load the gem
|
20
|
+
require 'cloudmersive-image-recognition-api-client'
|
21
|
+
# setup authorization
|
22
|
+
CloudmersiveImageRecognitionApiClient.configure do |config|
|
23
|
+
# Configure API key authorization: Apikey
|
24
|
+
config.api_key['Apikey'] = 'YOUR API KEY'
|
25
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
26
|
+
#config.api_key_prefix['Apikey'] = 'Bearer'
|
27
|
+
end
|
28
|
+
|
29
|
+
api_instance = CloudmersiveImageRecognitionApiClient::ResizeApi.new
|
30
|
+
|
31
|
+
max_width = 56 # Integer | Maximum width of the output image - final image will be as large as possible while less than or equial to this width
|
32
|
+
|
33
|
+
max_height = 56 # Integer | Maximum height of the output image - final image will be as large as possible while less than or equial to this height
|
34
|
+
|
35
|
+
image_file = File.new("/path/to/file.txt") # File | Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
36
|
+
|
37
|
+
|
38
|
+
begin
|
39
|
+
#Resize an image with parameters
|
40
|
+
result = api_instance.resize_post(max_width, max_height, image_file)
|
41
|
+
p result
|
42
|
+
rescue CloudmersiveImageRecognitionApiClient::ApiError => e
|
43
|
+
puts "Exception when calling ResizeApi->resize_post: #{e}"
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
### Parameters
|
48
|
+
|
49
|
+
Name | Type | Description | Notes
|
50
|
+
------------- | ------------- | ------------- | -------------
|
51
|
+
**max_width** | **Integer**| Maximum width of the output image - final image will be as large as possible while less than or equial to this width |
|
52
|
+
**max_height** | **Integer**| Maximum height of the output image - final image will be as large as possible while less than or equial to this height |
|
53
|
+
**image_file** | **File**| Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. |
|
54
|
+
|
55
|
+
### Return type
|
56
|
+
|
57
|
+
**String**
|
58
|
+
|
59
|
+
### Authorization
|
60
|
+
|
61
|
+
[Apikey](../README.md#Apikey)
|
62
|
+
|
63
|
+
### HTTP request headers
|
64
|
+
|
65
|
+
- **Content-Type**: multipart/form-data
|
66
|
+
- **Accept**: image/png
|
67
|
+
|
68
|
+
|
69
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# CloudmersiveImageRecognitionApiClient::VehicleLicensePlateDetectionResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**successful** | **BOOLEAN** | Was the image processed successfully? | [optional]
|
7
|
+
**detected_license_plates** | [**Array<DetectedLicensePlate>**](DetectedLicensePlate.md) | License plates found in the image | [optional]
|
8
|
+
**detected_license_plate_count** | **Integer** | The number of license plates detected in the image | [optional]
|
9
|
+
|
10
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
4
|
+
#
|
5
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
6
|
+
#
|
7
|
+
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
8
|
+
|
9
|
+
git_user_id=$1
|
10
|
+
git_repo_id=$2
|
11
|
+
release_note=$3
|
12
|
+
|
13
|
+
if [ "$git_user_id" = "" ]; then
|
14
|
+
git_user_id="GIT_USER_ID"
|
15
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
16
|
+
fi
|
17
|
+
|
18
|
+
if [ "$git_repo_id" = "" ]; then
|
19
|
+
git_repo_id="GIT_REPO_ID"
|
20
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
21
|
+
fi
|
22
|
+
|
23
|
+
if [ "$release_note" = "" ]; then
|
24
|
+
release_note="Minor update"
|
25
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
26
|
+
fi
|
27
|
+
|
28
|
+
# Initialize the local directory as a Git repository
|
29
|
+
git init
|
30
|
+
|
31
|
+
# Adds the files in the local repository and stages them for commit.
|
32
|
+
git add .
|
33
|
+
|
34
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
35
|
+
git commit -m "$release_note"
|
36
|
+
|
37
|
+
# Sets the new remote
|
38
|
+
git_remote=`git remote`
|
39
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
40
|
+
|
41
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
42
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
43
|
+
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
44
|
+
else
|
45
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
46
|
+
fi
|
47
|
+
|
48
|
+
fi
|
49
|
+
|
50
|
+
git pull origin master
|
51
|
+
|
52
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
53
|
+
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
54
|
+
git push origin master 2>&1 | grep -v 'To https'
|
55
|
+
|
@@ -0,0 +1,60 @@
|
|
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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'cloudmersive-image-recognition-api-client/api_client'
|
15
|
+
require 'cloudmersive-image-recognition-api-client/api_error'
|
16
|
+
require 'cloudmersive-image-recognition-api-client/version'
|
17
|
+
require 'cloudmersive-image-recognition-api-client/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'cloudmersive-image-recognition-api-client/models/age_detection_result'
|
21
|
+
require 'cloudmersive-image-recognition-api-client/models/detected_license_plate'
|
22
|
+
require 'cloudmersive-image-recognition-api-client/models/detected_object'
|
23
|
+
require 'cloudmersive-image-recognition-api-client/models/draw_rectangle_instance'
|
24
|
+
require 'cloudmersive-image-recognition-api-client/models/draw_rectangle_request'
|
25
|
+
require 'cloudmersive-image-recognition-api-client/models/draw_text_instance'
|
26
|
+
require 'cloudmersive-image-recognition-api-client/models/draw_text_request'
|
27
|
+
require 'cloudmersive-image-recognition-api-client/models/face'
|
28
|
+
require 'cloudmersive-image-recognition-api-client/models/face_locate_response'
|
29
|
+
require 'cloudmersive-image-recognition-api-client/models/image_description_response'
|
30
|
+
require 'cloudmersive-image-recognition-api-client/models/nsfw_result'
|
31
|
+
require 'cloudmersive-image-recognition-api-client/models/object_detection_result'
|
32
|
+
require 'cloudmersive-image-recognition-api-client/models/person_with_age'
|
33
|
+
require 'cloudmersive-image-recognition-api-client/models/recognition_outcome'
|
34
|
+
require 'cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result'
|
35
|
+
|
36
|
+
# APIs
|
37
|
+
require 'cloudmersive-image-recognition-api-client/api/artistic_api'
|
38
|
+
require 'cloudmersive-image-recognition-api-client/api/edit_api'
|
39
|
+
require 'cloudmersive-image-recognition-api-client/api/face_api'
|
40
|
+
require 'cloudmersive-image-recognition-api-client/api/nsfw_api'
|
41
|
+
require 'cloudmersive-image-recognition-api-client/api/recognize_api'
|
42
|
+
require 'cloudmersive-image-recognition-api-client/api/resize_api'
|
43
|
+
|
44
|
+
module CloudmersiveImageRecognitionApiClient
|
45
|
+
class << self
|
46
|
+
# Customize default settings for the SDK using block.
|
47
|
+
# CloudmersiveImageRecognitionApiClient.configure do |config|
|
48
|
+
# config.username = "xxx"
|
49
|
+
# config.password = "xxx"
|
50
|
+
# end
|
51
|
+
# If no block given, return the default Configuration object.
|
52
|
+
def configure
|
53
|
+
if block_given?
|
54
|
+
yield(Configuration.default)
|
55
|
+
else
|
56
|
+
Configuration.default
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,85 @@
|
|
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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module CloudmersiveImageRecognitionApiClient
|
16
|
+
class ArtisticApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Transform an image into an artistic painting automatically
|
24
|
+
# Uses machine learning to automatically transform an image into an artistic painting. Due to depth of AI processing, depending on image size this operation can take up to 20 seconds.
|
25
|
+
# @param style The style of the painting to apply. To start, try \"udnie\" a painting style. Possible values are: \"udnie\", \"wave\", \"la_muse\", \"rain_princess\".
|
26
|
+
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @return [String]
|
29
|
+
def artistic_painting(style, image_file, opts = {})
|
30
|
+
data, _status_code, _headers = artistic_painting_with_http_info(style, image_file, opts)
|
31
|
+
return data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Transform an image into an artistic painting automatically
|
35
|
+
# Uses machine learning to automatically transform an image into an artistic painting. Due to depth of AI processing, depending on image size this operation can take up to 20 seconds.
|
36
|
+
# @param style The style of the painting to apply. To start, try \"udnie\" a painting style. Possible values are: \"udnie\", \"wave\", \"la_muse\", \"rain_princess\".
|
37
|
+
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
40
|
+
def artistic_painting_with_http_info(style, image_file, opts = {})
|
41
|
+
if @api_client.config.debugging
|
42
|
+
@api_client.config.logger.debug "Calling API: ArtisticApi.artistic_painting ..."
|
43
|
+
end
|
44
|
+
# verify the required parameter 'style' is set
|
45
|
+
if @api_client.config.client_side_validation && style.nil?
|
46
|
+
fail ArgumentError, "Missing the required parameter 'style' when calling ArtisticApi.artistic_painting"
|
47
|
+
end
|
48
|
+
# verify the required parameter 'image_file' is set
|
49
|
+
if @api_client.config.client_side_validation && image_file.nil?
|
50
|
+
fail ArgumentError, "Missing the required parameter 'image_file' when calling ArtisticApi.artistic_painting"
|
51
|
+
end
|
52
|
+
# resource path
|
53
|
+
local_var_path = "/image/artistic/painting/{style}".sub('{' + 'style' + '}', style.to_s)
|
54
|
+
|
55
|
+
# query parameters
|
56
|
+
query_params = {}
|
57
|
+
|
58
|
+
# header parameters
|
59
|
+
header_params = {}
|
60
|
+
# HTTP header 'Accept' (if needed)
|
61
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
62
|
+
# HTTP header 'Content-Type'
|
63
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
64
|
+
|
65
|
+
# form parameters
|
66
|
+
form_params = {}
|
67
|
+
form_params["imageFile"] = image_file
|
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 => 'String')
|
79
|
+
if @api_client.config.debugging
|
80
|
+
@api_client.config.logger.debug "API called: ArtisticApi#artistic_painting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
81
|
+
end
|
82
|
+
return data, status_code, headers
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,202 @@
|
|
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: unset
|
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
|
+
|
23
|
+
# Composite two images together
|
24
|
+
# 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.
|
25
|
+
# @param location Location to composite the layered images; possible values are: \"center\", \"top-left\", \"top-center\", \"top-right\", \"center-left\", \"center-right\", \"bottom-left\", \"bottom-center\", \"bottom-right\"
|
26
|
+
# @param base_image Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
27
|
+
# @param layered_image Image to layer on top of the base image.
|
28
|
+
# @param [Hash] opts the optional parameters
|
29
|
+
# @return [Object]
|
30
|
+
def edit_composite_basic(location, base_image, layered_image, opts = {})
|
31
|
+
data, _status_code, _headers = edit_composite_basic_with_http_info(location, base_image, layered_image, opts)
|
32
|
+
return data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Composite two images together
|
36
|
+
# 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.
|
37
|
+
# @param location Location to composite the layered images; possible values are: \"center\", \"top-left\", \"top-center\", \"top-right\", \"center-left\", \"center-right\", \"bottom-left\", \"bottom-center\", \"bottom-right\"
|
38
|
+
# @param base_image Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
39
|
+
# @param layered_image Image to layer on top of the base image.
|
40
|
+
# @param [Hash] opts the optional parameters
|
41
|
+
# @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
|
42
|
+
def edit_composite_basic_with_http_info(location, base_image, layered_image, opts = {})
|
43
|
+
if @api_client.config.debugging
|
44
|
+
@api_client.config.logger.debug "Calling API: EditApi.edit_composite_basic ..."
|
45
|
+
end
|
46
|
+
# verify the required parameter 'location' is set
|
47
|
+
if @api_client.config.client_side_validation && location.nil?
|
48
|
+
fail ArgumentError, "Missing the required parameter 'location' when calling EditApi.edit_composite_basic"
|
49
|
+
end
|
50
|
+
# verify the required parameter 'base_image' is set
|
51
|
+
if @api_client.config.client_side_validation && base_image.nil?
|
52
|
+
fail ArgumentError, "Missing the required parameter 'base_image' when calling EditApi.edit_composite_basic"
|
53
|
+
end
|
54
|
+
# verify the required parameter 'layered_image' is set
|
55
|
+
if @api_client.config.client_side_validation && layered_image.nil?
|
56
|
+
fail ArgumentError, "Missing the required parameter 'layered_image' when calling EditApi.edit_composite_basic"
|
57
|
+
end
|
58
|
+
# resource path
|
59
|
+
local_var_path = "/image/edit/composite/{location}".sub('{' + 'location' + '}', location.to_s)
|
60
|
+
|
61
|
+
# query parameters
|
62
|
+
query_params = {}
|
63
|
+
|
64
|
+
# header parameters
|
65
|
+
header_params = {}
|
66
|
+
# HTTP header 'Accept' (if needed)
|
67
|
+
header_params['Accept'] = @api_client.select_header_accept(['image/png'])
|
68
|
+
# HTTP header 'Content-Type'
|
69
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
70
|
+
|
71
|
+
# form parameters
|
72
|
+
form_params = {}
|
73
|
+
form_params["baseImage"] = base_image
|
74
|
+
form_params["layeredImage"] = layered_image
|
75
|
+
|
76
|
+
# http body (model)
|
77
|
+
post_body = nil
|
78
|
+
auth_names = ['Apikey']
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
80
|
+
:header_params => header_params,
|
81
|
+
:query_params => query_params,
|
82
|
+
:form_params => form_params,
|
83
|
+
:body => post_body,
|
84
|
+
:auth_names => auth_names,
|
85
|
+
:return_type => 'Object')
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: EditApi#edit_composite_basic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
|
92
|
+
# Draw rectangle onto an image
|
93
|
+
# Draw one or more rectangles, with customized visuals, onto an image
|
94
|
+
# @param request
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [Object]
|
97
|
+
def edit_draw_rectangle(request, opts = {})
|
98
|
+
data, _status_code, _headers = edit_draw_rectangle_with_http_info(request, opts)
|
99
|
+
return data
|
100
|
+
end
|
101
|
+
|
102
|
+
# Draw rectangle onto an image
|
103
|
+
# Draw one or more rectangles, with customized visuals, onto an image
|
104
|
+
# @param request
|
105
|
+
# @param [Hash] opts the optional parameters
|
106
|
+
# @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
|
107
|
+
def edit_draw_rectangle_with_http_info(request, opts = {})
|
108
|
+
if @api_client.config.debugging
|
109
|
+
@api_client.config.logger.debug "Calling API: EditApi.edit_draw_rectangle ..."
|
110
|
+
end
|
111
|
+
# verify the required parameter 'request' is set
|
112
|
+
if @api_client.config.client_side_validation && request.nil?
|
113
|
+
fail ArgumentError, "Missing the required parameter 'request' when calling EditApi.edit_draw_rectangle"
|
114
|
+
end
|
115
|
+
# resource path
|
116
|
+
local_var_path = "/image/edit/draw/rectangle"
|
117
|
+
|
118
|
+
# query parameters
|
119
|
+
query_params = {}
|
120
|
+
|
121
|
+
# header parameters
|
122
|
+
header_params = {}
|
123
|
+
# HTTP header 'Accept' (if needed)
|
124
|
+
header_params['Accept'] = @api_client.select_header_accept(['image/png'])
|
125
|
+
# HTTP header 'Content-Type'
|
126
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
127
|
+
|
128
|
+
# form parameters
|
129
|
+
form_params = {}
|
130
|
+
|
131
|
+
# http body (model)
|
132
|
+
post_body = @api_client.object_to_http_body(request)
|
133
|
+
auth_names = ['Apikey']
|
134
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
135
|
+
:header_params => header_params,
|
136
|
+
:query_params => query_params,
|
137
|
+
:form_params => form_params,
|
138
|
+
:body => post_body,
|
139
|
+
:auth_names => auth_names,
|
140
|
+
:return_type => 'Object')
|
141
|
+
if @api_client.config.debugging
|
142
|
+
@api_client.config.logger.debug "API called: EditApi#edit_draw_rectangle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
143
|
+
end
|
144
|
+
return data, status_code, headers
|
145
|
+
end
|
146
|
+
|
147
|
+
# Draw text onto an image
|
148
|
+
# Draw one or more pieces of text, with customized visuals, onto an image
|
149
|
+
# @param request
|
150
|
+
# @param [Hash] opts the optional parameters
|
151
|
+
# @return [Object]
|
152
|
+
def edit_draw_text(request, opts = {})
|
153
|
+
data, _status_code, _headers = edit_draw_text_with_http_info(request, opts)
|
154
|
+
return data
|
155
|
+
end
|
156
|
+
|
157
|
+
# Draw text onto an image
|
158
|
+
# Draw one or more pieces of text, with customized visuals, onto an image
|
159
|
+
# @param request
|
160
|
+
# @param [Hash] opts the optional parameters
|
161
|
+
# @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
|
162
|
+
def edit_draw_text_with_http_info(request, opts = {})
|
163
|
+
if @api_client.config.debugging
|
164
|
+
@api_client.config.logger.debug "Calling API: EditApi.edit_draw_text ..."
|
165
|
+
end
|
166
|
+
# verify the required parameter 'request' is set
|
167
|
+
if @api_client.config.client_side_validation && request.nil?
|
168
|
+
fail ArgumentError, "Missing the required parameter 'request' when calling EditApi.edit_draw_text"
|
169
|
+
end
|
170
|
+
# resource path
|
171
|
+
local_var_path = "/image/edit/draw/text"
|
172
|
+
|
173
|
+
# query parameters
|
174
|
+
query_params = {}
|
175
|
+
|
176
|
+
# header parameters
|
177
|
+
header_params = {}
|
178
|
+
# HTTP header 'Accept' (if needed)
|
179
|
+
header_params['Accept'] = @api_client.select_header_accept(['image/png'])
|
180
|
+
# HTTP header 'Content-Type'
|
181
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
182
|
+
|
183
|
+
# form parameters
|
184
|
+
form_params = {}
|
185
|
+
|
186
|
+
# http body (model)
|
187
|
+
post_body = @api_client.object_to_http_body(request)
|
188
|
+
auth_names = ['Apikey']
|
189
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
190
|
+
:header_params => header_params,
|
191
|
+
:query_params => query_params,
|
192
|
+
:form_params => form_params,
|
193
|
+
:body => post_body,
|
194
|
+
:auth_names => auth_names,
|
195
|
+
:return_type => 'Object')
|
196
|
+
if @api_client.config.debugging
|
197
|
+
@api_client.config.logger.debug "API called: EditApi#edit_draw_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
198
|
+
end
|
199
|
+
return data, status_code, headers
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|