Class: DynamicPDFApi::GifImageFormat

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

Overview

Represents GIF image format with dithering properties.

Instance Attribute Summary collapse

Attributes inherited from ImageFormat

#type

Instance Method Summary collapse

Constructor Details

#initializeGifImageFormat

Initializes a new instance of the GifImageFormat class and sets the image format type to GIF.



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

def initialize
  super(ImageFormatType::GIF)
  @dithering_percent = nil
  @dithering_algorithm = nil
end

Instance Attribute Details

#dithering_algorithmObject

Gets or sets the dithering algorithm.



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

def dithering_algorithm
  @dithering_algorithm
end

#dithering_percentObject

Gets or sets the dithering percentage.



8
9
10
# File 'lib/ruby_client/Imaging/GifImageFormat.rb', line 8

def dithering_percent
  @dithering_percent
end

Instance Method Details

#to_json(_options = {}) ⇒ String

Returns a JSON representation of the GifImageFormat object.

Returns:

  • (String)

    JSON string representing the GifImageFormat object.



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

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