Class: DynamicPDFApi::PngIndexedColorFormat

Inherits:
PngColorFormat show all
Defined in:
lib/ruby_client/Imaging/PngIndexedColorFormat.rb

Overview

Represents indexed color format for PNG.

Instance Attribute Summary collapse

Attributes inherited from ColorFormat

#type

Instance Method Summary collapse

Constructor Details

#initializePngIndexedColorFormat

Initializes a new instance of the PngIndexedColorFormat class with indexed color format type.



16
17
18
19
20
21
# File 'lib/ruby_client/Imaging/PngIndexedColorFormat.rb', line 16

def initialize
  super(ColorFormatType::Indexed)
  @quantization_algorithm = nil
  @dithering_percent = nil
  @dithering_algorithm = nil
end

Instance Attribute Details

#dithering_algorithmObject

Gets or sets the DitheringAlgorithm for PNG.



11
12
13
# File 'lib/ruby_client/Imaging/PngIndexedColorFormat.rb', line 11

def dithering_algorithm
  @dithering_algorithm
end

#dithering_percentObject

Gets or sets the dithering percentage for PNG.



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

def dithering_percent
  @dithering_percent
end

#quantization_algorithmObject

Gets or sets the QuantizationAlgorithm for PNG.



9
10
11
# File 'lib/ruby_client/Imaging/PngIndexedColorFormat.rb', line 9

def quantization_algorithm
  @quantization_algorithm
end

Instance Method Details

#to_json(_options = {}) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/ruby_client/Imaging/PngIndexedColorFormat.rb', line 23

def to_json(_options = {})
  json_array = {}
  json_array['quantizationAlgorithm'] = @quantization_algorithm
  json_array['ditheringPercent'] = @dithering_percent
  json_array['ditheringAlgorithm'] = @dithering_algorithm
  JSON.pretty_generate(json_array)
end