Class: DynamicPDFApi::BmpMonochromeColorFormat

Inherits:
BmpColorFormat show all
Defined in:
lib/ruby_client/Imaging/BmpMonochromeColorFormat.rb

Overview

Represents monochrome color format for BMP.

Instance Attribute Summary collapse

Attributes inherited from ColorFormat

#type

Instance Method Summary collapse

Constructor Details

#initializeBmpMonochromeColorFormat

Creates object for monochrome color format for BMP image format.



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

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

Instance Attribute Details

#black_thresholdObject

Gets or sets the black threshold for monochrome BMP, ranges from 0-255.



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

def black_threshold
  @black_threshold
end

#dithering_algorithmObject

Gets or sets the dithering algorithm for BMP.



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

def dithering_algorithm
  @dithering_algorithm
end

#dithering_percentObject

Gets or sets the dithering percentage for BMP.



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

def dithering_percent
  @dithering_percent
end

Instance Method Details

#to_json(_options = {}) ⇒ String

Returns a JSON representation of the BmpMonochromeColorFormat object.

Returns:

  • (String)

    JSON string representing the BmpMonochromeColorFormat object.



29
30
31
32
33
34
35
# File 'lib/ruby_client/Imaging/BmpMonochromeColorFormat.rb', line 29

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