Class: DynamicPDFApi::PngImageFormat

Inherits:
ImageFormat show all
Defined in:
lib/ruby_client/Imaging/PngImageFormat.rb

Overview

Represents PNG image format with color format.

Instance Attribute Summary collapse

Attributes inherited from ImageFormat

#type

Instance Method Summary collapse

Constructor Details

#initializePngImageFormat

Initializes a new instance of the PngImageFormat class.



15
16
17
18
# File 'lib/ruby_client/Imaging/PngImageFormat.rb', line 15

def initialize
  super(ImageFormatType::PNG)
  @color_format = nil
end

Instance Attribute Details

#color_formatObject

Gets or sets the PngColorFormat for PNG.



10
11
12
# File 'lib/ruby_client/Imaging/PngImageFormat.rb', line 10

def color_format
  @color_format
end

Instance Method Details

#to_json(_options = {}) ⇒ String

Returns a JSON representation of the PngImageFormat object.

Returns:

  • (String)

    JSON string representing the PngImageFormat object.



25
26
27
28
29
30
31
# File 'lib/ruby_client/Imaging/PngImageFormat.rb', line 25

def to_json(_options = {})
  json_array = {}
  json_array['type'] = 'png'

  json_array['colorFormat'] = @color_format
  JSON.pretty_generate(json_array)
end