Foxit PDF SDK
foxit::addon::optimization::ImageSettings Class Reference
Inheritance diagram for foxit::addon::optimization::ImageSettings:
foxit::Base

Public Types

enum  ImageCompressMode { e_ImageCompressHigh = 10003, e_ImageCompressjpeg = 10005, e_ImageCompressjpeg2000 = 10006, e_ImageCompressRetain = 10007 }
 Enumeration for compression mode used for color or gray image. More...
 
enum  StretchMode {
  e_StretchOff = 0x00, e_StretchInterpol = 0x20, e_StretchDownsample = 0x04, e_StretchBicubic = 0x80,
  e_StretchNoSmooth = 0x100
}
 Enumeration for stretch mode. More...
 

Public Member Functions

 ImageSettings ()
 Constructor. More...
 
 ImageSettings (const ImageSettings &other)
 Constructor, with another image setting object. More...
 
 ~ImageSettings ()
 Destructor.
 
bool IsEmpty () const
 Check whether current object is empty or not. More...
 
bool operator!= (const ImageSettings &other) const
 Not equal operator. More...
 
ImageSettingsoperator= (const ImageSettings &other)
 Assign operator. More...
 
bool operator== (const ImageSettings &other) const
 Equal operator. More...
 
void SetCompressionMode (ImageCompressMode mode)
 Set compression mode used for optimizing color/gray images in a PDF document. More...
 
void SetImageDPI (int32 dpi)
 Set the image DPI used for optimizing color/gray images in a PDF document. More...
 
void SetQuality (int32 quality)
 Set the quality for lossy compression modes, used for optimizing color/gray images in a PDF document. More...
 
void SetStretchMode (StretchMode mode)
 Set stretch mode used for optimizing color/gray images in a PDF document. More...
 
- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

Detailed Description

This class represents downsampling/recompression settings for color and grayscale images. This class object can be set to class OptimizerSettings and then be used to optimize a PDF document.

See also
OptimizerSettings

Member Enumeration Documentation

◆ ImageCompressMode

Enumeration for compression mode used for color or gray image.

Values of this enumeration should be used alone.

Enumerator
e_ImageCompressHigh 

Compression mode: high.

e_ImageCompressjpeg 

Compression mode: jpeg.

e_ImageCompressjpeg2000 

Compression mode: jpeg2000.

e_ImageCompressRetain 

Compression mode: retain, which means no compression.

◆ StretchMode

Enumeration for stretch mode.

Values of this enumeration should be used alone.

Enumerator
e_StretchOff 

When this is set, that means do without stretching.

e_StretchInterpol 

When this is set, that means to do interpolation for zooming.

e_StretchDownsample 

When this is set, that means not to do halftone for shrinking or rotating.

e_StretchBicubic 

When this is set, that means to do bicubic interpolation for zooming.

e_StretchNoSmooth 

When this is set, that means not to do any interpolation for stretching.

Constructor & Destructor Documentation

◆ ImageSettings() [1/2]

foxit::addon::optimization::ImageSettings::ImageSettings ( )

Constructor.

This constructor is to construct a color/gray image settings object with default setting options. User can also calling "set" methods in this class to change these setting options. Please refer to comment of these "set" methods for more details about default values.

◆ ImageSettings() [2/2]

foxit::addon::optimization::ImageSettings::ImageSettings ( const ImageSettings other)

Constructor, with another image setting object.

Parameters
[in]otherAnother ImageSettings object.

Member Function Documentation

◆ IsEmpty()

bool foxit::addon::optimization::ImageSettings::IsEmpty ( ) const

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ operator!=()

bool foxit::addon::optimization::ImageSettings::operator!= ( const ImageSettings other) const

Not equal operator.

Parameters
[in]otherAnother result image setting object. This function will check if current object is not equal to this one.
Returns
true means not equal, while false means equal.

◆ operator=()

ImageSettings& foxit::addon::optimization::ImageSettings::operator= ( const ImageSettings other)

Assign operator.

Parameters
[in]otherAnother result image setting object, whose value would be assigned to current object.
Returns
Reference to current object itself.

◆ operator==()

bool foxit::addon::optimization::ImageSettings::operator== ( const ImageSettings other) const

Equal operator.

Parameters
[in]otherAnother result ImageSettings object. This function will check if current object is equal to this one.
Returns
true means equal, while false means not equal.

◆ SetCompressionMode()

void foxit::addon::optimization::ImageSettings::SetCompressionMode ( ImageCompressMode  mode)

Set compression mode used for optimizing color/gray images in a PDF document.

For a newly constructed object, if this function is not called to set option, that means to use ImageSettings::e_ImageCompressjpeg as the deault value of this option.

Parameters
[in]modeImage compression mode. Please refer to values starting from ImageSettings::e_ImageCompressHigh and this should be one of these values.
Returns
None.

◆ SetImageDPI()

void foxit::addon::optimization::ImageSettings::SetImageDPI ( int32  dpi)

Set the image DPI used for optimizing color/gray images in a PDF document.

For a newly constructed object, if this function is not called to set option, that means to use 150 as the deault value of this option.

Parameters
[in]dpiDPI value.
Returns
None.

◆ SetQuality()

void foxit::addon::optimization::ImageSettings::SetQuality ( int32  quality)

Set the quality for lossy compression modes, used for optimizing color/gray images in a PDF document.

For a newly constructed object, if this function is not called to set this option, that means to use 2 as the deault value of this option.

Parameters
[in]qualityQuality value for lossy compression modes. Valid range: from 1 to 5. 5 means lossless (if possible).
Returns
None.

◆ SetStretchMode()

void foxit::addon::optimization::ImageSettings::SetStretchMode ( StretchMode  mode)

Set stretch mode used for optimizing color/gray images in a PDF document.

For a newly constructed object, if this function is not called to set this option, that means to use ImageSettings::e_StretchBicubic as the deault value of this option.

Parameters
[in]modeStretch mode. Please refer to values starting from ImageSettings::e_StretchOff and this should be one of these values.
Returns
None.