class CloudmersiveImageRecognitionApiClient::FilterApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

filter_black_and_white(image_file, opts = {}) click to toggle source

Convert image to black-and-white grayscale Remove color from the image by converting to a grayscale, black-and-white image @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [String]

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 27
def filter_black_and_white(image_file, opts = {})
  data, _status_code, _headers = filter_black_and_white_with_http_info(image_file, opts)
  data
end
filter_black_and_white_with_http_info(image_file, opts = {}) click to toggle source

Convert image to black-and-white grayscale Remove color from the image by converting to a grayscale, black-and-white image @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 37
def filter_black_and_white_with_http_info(image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilterApi.filter_black_and_white ...'
  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 FilterApi.filter_black_and_white"
  end
  # resource path
  local_var_path = '/image/filter/black-and-white'

  # 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: FilterApi#filter_black_and_white\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
filter_despeckle(image_file, opts = {}) click to toggle source

Despeckle to remove point noise from the image Remove point noise / despeckle the input image @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [String]

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 82
def filter_despeckle(image_file, opts = {})
  data, _status_code, _headers = filter_despeckle_with_http_info(image_file, opts)
  data
end
filter_despeckle_with_http_info(image_file, opts = {}) click to toggle source

Despeckle to remove point noise from the image Remove point noise / despeckle the input image @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 92
def filter_despeckle_with_http_info(image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilterApi.filter_despeckle ...'
  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 FilterApi.filter_despeckle"
  end
  # resource path
  local_var_path = '/image/filter/despeckle'

  # 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: FilterApi#filter_despeckle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
filter_edge_detect(radius, image_file, opts = {}) click to toggle source

Detect and highlight edges in an image Perform an edge detection operation on the input image @param radius Radius in pixels of the edge detection operation; a larger radius will produce a greater effect @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [String]

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 138
def filter_edge_detect(radius, image_file, opts = {})
  data, _status_code, _headers = filter_edge_detect_with_http_info(radius, image_file, opts)
  data
end
filter_edge_detect_with_http_info(radius, image_file, opts = {}) click to toggle source

Detect and highlight edges in an image Perform an edge detection operation on the input image @param radius Radius in pixels of the edge detection operation; a larger radius will produce a greater effect @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 149
def filter_edge_detect_with_http_info(radius, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilterApi.filter_edge_detect ...'
  end
  # verify the required parameter 'radius' is set
  if @api_client.config.client_side_validation && radius.nil?
    fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_edge_detect"
  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 FilterApi.filter_edge_detect"
  end
  # resource path
  local_var_path = '/image/filter/edge-detect/{radius}'.sub('{' + 'radius' + '}', radius.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: FilterApi#filter_edge_detect\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
filter_emboss(radius, sigma, image_file, opts = {}) click to toggle source

Emboss an image Perform an emboss operation on the input image @param radius Radius in pixels of the emboss operation; a larger radius will produce a greater effect @param sigma Sigma, or variance, of the emboss operation @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [String]

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 200
def filter_emboss(radius, sigma, image_file, opts = {})
  data, _status_code, _headers = filter_emboss_with_http_info(radius, sigma, image_file, opts)
  data
end
filter_emboss_with_http_info(radius, sigma, image_file, opts = {}) click to toggle source

Emboss an image Perform an emboss operation on the input image @param radius Radius in pixels of the emboss operation; a larger radius will produce a greater effect @param sigma Sigma, or variance, of the emboss operation @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 212
def filter_emboss_with_http_info(radius, sigma, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilterApi.filter_emboss ...'
  end
  # verify the required parameter 'radius' is set
  if @api_client.config.client_side_validation && radius.nil?
    fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_emboss"
  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 FilterApi.filter_emboss"
  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 FilterApi.filter_emboss"
  end
  # resource path
  local_var_path = '/image/filter/emboss/{radius}/{sigma}'.sub('{' + 'radius' + '}', radius.to_s).sub('{' + 'sigma' + '}', sigma.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: FilterApi#filter_emboss\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
filter_gaussian_blur(radius, sigma, image_file, opts = {}) click to toggle source

Perform a guassian blur on the input image Perform a gaussian blur on the input image @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect @param sigma Sigma, or variance, of the gaussian blur operation @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [String]

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 267
def filter_gaussian_blur(radius, sigma, image_file, opts = {})
  data, _status_code, _headers = filter_gaussian_blur_with_http_info(radius, sigma, image_file, opts)
  data
end
filter_gaussian_blur_with_http_info(radius, sigma, image_file, opts = {}) click to toggle source

Perform a guassian blur on the input image Perform a gaussian blur on the input image @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect @param sigma Sigma, or variance, of the gaussian blur operation @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 279
def filter_gaussian_blur_with_http_info(radius, sigma, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilterApi.filter_gaussian_blur ...'
  end
  # verify the required parameter 'radius' is set
  if @api_client.config.client_side_validation && radius.nil?
    fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_gaussian_blur"
  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 FilterApi.filter_gaussian_blur"
  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 FilterApi.filter_gaussian_blur"
  end
  # resource path
  local_var_path = '/image/filter/blur/guassian/{radius}/{sigma}'.sub('{' + 'radius' + '}', radius.to_s).sub('{' + 'sigma' + '}', sigma.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: FilterApi#filter_gaussian_blur\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
filter_motion_blur(radius, sigma, angle, image_file, opts = {}) click to toggle source

Perform a motion blur on the input image Perform a motion blur on the input image at a specific angle @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect @param sigma Sigma, or variance, of the motion blur operation @param angle Angle of the motion blur in degrees @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [String]

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 335
def filter_motion_blur(radius, sigma, angle, image_file, opts = {})
  data, _status_code, _headers = filter_motion_blur_with_http_info(radius, sigma, angle, image_file, opts)
  data
end
filter_motion_blur_with_http_info(radius, sigma, angle, image_file, opts = {}) click to toggle source

Perform a motion blur on the input image Perform a motion blur on the input image at a specific angle @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect @param sigma Sigma, or variance, of the motion blur operation @param angle Angle of the motion blur in degrees @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 348
def filter_motion_blur_with_http_info(radius, sigma, angle, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilterApi.filter_motion_blur ...'
  end
  # verify the required parameter 'radius' is set
  if @api_client.config.client_side_validation && radius.nil?
    fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_motion_blur"
  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 FilterApi.filter_motion_blur"
  end
  # verify the required parameter 'angle' is set
  if @api_client.config.client_side_validation && angle.nil?
    fail ArgumentError, "Missing the required parameter 'angle' when calling FilterApi.filter_motion_blur"
  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 FilterApi.filter_motion_blur"
  end
  # resource path
  local_var_path = '/image/filter/blur/motion/{radius}/{sigma}/{angle}'.sub('{' + 'radius' + '}', radius.to_s).sub('{' + 'sigma' + '}', sigma.to_s).sub('{' + 'angle' + '}', angle.to_s)

  # 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: FilterApi#filter_motion_blur\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
filter_posterize(levels, image_file, opts = {}) click to toggle source

Posterize the image by reducing distinct colors Reduce the unique number of colors in the image to the specified level @param levels Number of unique colors to retain in the output image @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [String]

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 406
def filter_posterize(levels, image_file, opts = {})
  data, _status_code, _headers = filter_posterize_with_http_info(levels, image_file, opts)
  data
end
filter_posterize_with_http_info(levels, image_file, opts = {}) click to toggle source

Posterize the image by reducing distinct colors Reduce the unique number of colors in the image to the specified level @param levels Number of unique colors to retain in the output image @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 417
def filter_posterize_with_http_info(levels, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilterApi.filter_posterize ...'
  end
  # verify the required parameter 'levels' is set
  if @api_client.config.client_side_validation && levels.nil?
    fail ArgumentError, "Missing the required parameter 'levels' when calling FilterApi.filter_posterize"
  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 FilterApi.filter_posterize"
  end
  # resource path
  local_var_path = '/image/filter/posterize'

  # query parameters
  query_params = {}
  query_params[:'levels'] = levels

  # 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: FilterApi#filter_posterize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
filter_swirl(degrees, image_file, opts = {}) click to toggle source

Swirl distort the image Swirl distort the image by the specified number of degrees @param degrees Degrees of swirl @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [String]

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 468
def filter_swirl(degrees, image_file, opts = {})
  data, _status_code, _headers = filter_swirl_with_http_info(degrees, image_file, opts)
  data
end
filter_swirl_with_http_info(degrees, image_file, opts = {}) click to toggle source

Swirl distort the image Swirl distort the image by the specified number of degrees @param degrees Degrees of swirl @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/cloudmersive-image-recognition-api-client/api/filter_api.rb, line 479
def filter_swirl_with_http_info(degrees, image_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilterApi.filter_swirl ...'
  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 FilterApi.filter_swirl"
  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 FilterApi.filter_swirl"
  end
  # resource path
  local_var_path = '/image/filter/swirl'

  # query parameters
  query_params = {}
  query_params[:'degrees'] = degrees

  # 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: FilterApi#filter_swirl\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end