Class: DynamicPDFApi::TiffMonochromeColorFormat

Inherits:
TiffColorFormat show all
Defined in:
lib/ruby_client/Imaging/TiffMonochromeColorFormat.rb

Overview

Represents monochrome color format for TIFF with black threshold and compression type.

Instance Attribute Summary collapse

Attributes inherited from ColorFormat

#type

Instance Method Summary collapse

Constructor Details

#initializeTiffMonochromeColorFormat

Initializes a new instance of the TiffMonochromeColorFormat class with monochrome color format type.



17
18
19
20
21
22
23
# File 'lib/ruby_client/Imaging/TiffMonochromeColorFormat.rb', line 17

def initialize
  super(ColorFormatType::Monochrome)
  @black_threshold = nil
  @compression_type = nil
  @dithering_percent = nil
  @dithering_algorithm = nil
end

Instance Attribute Details

#black_thresholdObject

Gets or sets the black threshold for monochrome TIFF.



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

def black_threshold
  @black_threshold
end

#compression_typeObject

Gets or sets the CompressionType for monochrome TIFF.



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

def compression_type
  @compression_type
end

#dithering_algorithmObject

Gets or sets the DitheringAlgorithm for TIFF.



12
13
14
# File 'lib/ruby_client/Imaging/TiffMonochromeColorFormat.rb', line 12

def dithering_algorithm
  @dithering_algorithm
end

#dithering_percentObject

Gets or sets the dithering percentage for TIFF.



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

def dithering_percent
  @dithering_percent
end

Instance Method Details

#to_json(_options = {}) ⇒ String

Returns a JSON representation of the TiffMonochromeColorFormat object.

Returns:

  • (String)

    JSON string representing the TiffMonochromeColorFormat object.



30
31
32
33
34
35
36
37
38
# File 'lib/ruby_client/Imaging/TiffMonochromeColorFormat.rb', line 30

def to_json(_options = {})
  json_array = {}
  json_array['blackThreshold'] = @black_threshold
  json_array['compressionType'] = @compression_type
  json_array['ditheringPercent'] = @dithering_percent
  json_array['ditheringAlgorithm'] = @dithering_algorithm

  JSON.pretty_generate(json_array)
end