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

Public Types

enum  ImageCompressMode { ImageCompressMode.e_ImageCompressHigh = 10003, ImageCompressMode.e_ImageCompressjpeg = 10005, ImageCompressMode.e_ImageCompressjpeg2000 = 10006, ImageCompressMode.e_ImageCompressRetain = 10007 }
 Enumeration for compression mode used for color or gray image. More...
 
enum  ImageCompressQuality {
  ImageCompressQuality.e_ImageCompressQualityMinimum = 1, ImageCompressQuality.e_ImageCompressQualityLow = 2, ImageCompressQuality.e_ImageCompressQualityMedium = 3, ImageCompressQuality.e_ImageCompressQualityHigh = 4,
  ImageCompressQuality.e_ImageCompressQualityMaximum = 5
}
 Enumeration for loss compression quality used for color or gray image. More...
 
enum  StretchMode {
  StretchMode.e_StretchDefault = -1, StretchMode.e_StretchOff = 0x00, StretchMode.e_StretchInterpol = 0x20, StretchMode.e_StretchDownsample = 0x04,
  StretchMode.e_StretchBicubic = 0x80, StretchMode.e_StretchNoSmooth = 0x100
}
 Enumeration for stretch mode. More...
 

Public Member Functions

 ImageSettings ()
 Constructor. More...
 
 ImageSettings (ImageSettings other)
 Constructor, with another image settings object. More...
 
bool IsEmpty ()
 Check whether current object is empty or not. More...
 
void SetCompressionMode (ImageSettings.ImageCompressMode mode)
 Set compression mode used for optimizing color/gray images in a PDF document. More...
 
void SetImageDPI (int dpi)
 Set the DPI value as the target compressed value for compressing color/gray images in a PDF document. More...
 
void SetImageDPILimit (int dpi_limit)
 Set the lower limit DPI value for the color/gray image to decide if the image is to be compressed in a PDF document. More...
 
void SetQuality (ImageSettings.ImageCompressQuality quality)
 Set the quality for lossy compression modes, used for optimizing color/gray images in a PDF document. More...
 
void SetStretchMode (ImageSettings.StretchMode mode)
 Set stretch mode used for optimizing color/gray images in a PDF document. 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.

◆ ImageCompressQuality

Enumeration for loss compression quality used for color or gray image.

Values of this enumeration should be used alone.

Enumerator
e_ImageCompressQualityMinimum 

Compression quality: Minimum.

e_ImageCompressQualityLow 

Compression quality: Low.

e_ImageCompressQualityMedium 

Compression quality: Medium.

e_ImageCompressQualityHigh 

Compression quality: High.

e_ImageCompressQualityMaximum 

Compression quality: Maximum.

◆ StretchMode

Enumeration for stretch mode.

Values of this enumeration should be used alone.

Enumerator
e_StretchDefault 

When this is set, that means to do default stretching.

e_StretchOff 

When this is set, that means to 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 ( )
inline

Constructor.

This constructor is to construct a color/gray image settings object with default setting options. User can also call "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 ( ImageSettings  other)
inline

Constructor, with another image settings object.

Parameters
[in]otherAnother image settings object.

Member Function Documentation

◆ IsEmpty()

bool foxit.addon.optimization.ImageSettings.IsEmpty ( )
inline

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.

◆ SetCompressionMode()

void foxit.addon.optimization.ImageSettings.SetCompressionMode ( ImageSettings.ImageCompressMode  mode)
inline

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 foxit.addon.optimization.ImageSettings.ImageCompressMode.e_ImageCompressjpeg as the default value of this option.

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

◆ SetImageDPI()

void foxit.addon.optimization.ImageSettings.SetImageDPI ( int  dpi)
inline

Set the DPI value as the target compressed value for compressing color/gray images in a PDF document.

When an image can be compressed, the resolution of this image will be compressed to the DPI value set by current function.
For a newly constructed object, if this function is not called to set option, that means to use 150 as the default value of this option.

Parameters
[in]dpiDPI value which is set to be the target compressed DPI value.
Returns
None.

◆ SetImageDPILimit()

void foxit.addon.optimization.ImageSettings.SetImageDPILimit ( int  dpi_limit)
inline

Set the lower limit DPI value for the color/gray image to decide if the image is to be compressed in a PDF document.

If the resolution of an image in the PDF document is above the lower limit DPI value, this image will be compressed to the target compressed DPI value which is set by function ImageSettings.SetImageDPI .
For a newly constructed object, if this function is not called to set option, that means a DPI value (which is 1.5 times of target compressed DPI value) will be used as the default value of this option.

Parameters
[in]dpi_limitDPI value as the lower limit. This value should be a positive number. Suggested range: bigger than target compressed DPI value (set by function ImageSettings.SetImageDPI ) and the maximum value is 10 times of target compressed DPI value.
If input value is not bigger than the target compressed DPI value, a DPI value which is one more than the target compressed DPI value will be used instead.
If input value is bigger than the maximum value, the maximum value value will be used instead.
Returns
None.

◆ SetQuality()

void foxit.addon.optimization.ImageSettings.SetQuality ( ImageSettings.ImageCompressQuality  quality)
inline

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 foxit.addon.optimization.ImageSettings.ImageCompressQuality.e_ImageCompressQualityMinimum as the default value of this option.

Parameters
[in]qualityQuality value for lossy compression modes. Please refer to values starting from foxit.addon.optimization.ImageSettings.ImageCompressQuality.e_ImageCompressQualityMinimum and this should be one of these values.
Returns
None.

◆ SetStretchMode()

void foxit.addon.optimization.ImageSettings.SetStretchMode ( ImageSettings.StretchMode  mode)
inline

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 foxit.addon.optimization.ImageSettings.StretchMode.e_StretchBicubic as the default value of this option.

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