Top Description Inners Fields Constructors Methods
org.apache.pdfbox.filter

public Class DecodeOptions

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.pdfbox.filter.DecodeOptions.FinalDecodeOptions
Imports
java.awt.Rectangle

Options that may be passed to a Filter to request special handling when decoding the stream. Filters may not honor some or all of the specified options, and so callers should check the honored flag if further processing relies on the options being used.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
DecodeOptions.FinalDecodeOptions

Helper class for reusable instances which may not be modified.

Field Summary

Modifier and TypeField and Description
public static final DecodeOptions
DEFAULT

Default decode options.

private boolean
private Rectangle
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
DecodeOptions()

Constructs an empty DecodeOptions instance

public
DecodeOptions(Rectangle
Region of the source image that should be decoded
sourceRegion
)

Constructs an instance specifying the region of the image that should be decoded.

public
DecodeOptions(int
x-coordinate of the top-left corner of the region to be decoded
x
,
int
y-coordinate of the top-left corner of the region to be decoded
y
,
int
Width of the region to be decoded
width
,
int
Height of the region to be decoded
height
)

Constructs an instance specifying the region of the image that should be decoded.

public
DecodeOptions(int
The number of rows and columns to advance in the source for each pixel in the decoded image.
subsampling
)

Constructs an instance specifying the image should be decoded using subsampling.

Method Summary

Modifier and TypeMethod and Description
public Rectangle

Returns:

The source region to decode, or null if the entire image should be decoded
getSourceRegion
()

When decoding an image, the part of the image that should be decoded, or null if the entire image is needed.

public int

Returns:

The x-axis subsampling offset
getSubsamplingOffsetX
()

When decoding an image, the horizontal offset for subsampling

public int

Returns:

The y-axis subsampling offset
getSubsamplingOffsetY
()

When decoding an image, the vertical offset for subsampling

public int

Returns:

The x-axis subsampling value
getSubsamplingX
()

When decoding an image, the number of columns to advance in the source for every pixel decoded.

public int

Returns:

The y-axis subsampling value
getSubsamplingY
()

When decoding an image, the number of rows to advance in the source for every pixel decoded.

public boolean

Returns:

True if the filter applied the options specified by this instance, false otherwise.
isFilterSubsampled
()

Flag used by the filter to specify if it performed subsampling.

pack-priv void
setFilterSubsampled(boolean
Value specifying if the filter could meet the requested options. Usually a filter will only call this with the value true, as the default value for the flag is false.
filterSubsampled
)

Used internally by filters to signal they have applied subsampling as requested by this options instance.

public void
setSourceRegion(Rectangle
The source region to decode, or null if the entire image should be decoded.
sourceRegion
)

Sets the region of the source image that should be decoded.

public void
setSubsamplingOffsetX(int
The x-axis subsampling offset
ssOffsetX
)

Sets the horizontal subsampling offset for decoding images

public void
setSubsamplingOffsetY(int
The y-axis subsampling offset
ssOffsetY
)

Sets the vertical subsampling offset for decoding images

public void
setSubsamplingX(int
The x-axis subsampling value
ssX
)

Sets the number of columns to advance in the source for every pixel decoded

public void
setSubsamplingY(int
The y-axis subsampling value
ssY
)

Sets the number of rows to advance in the source for every pixel decoded

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
public static final DecodeOptions DEFAULT

Default decode options. The honored flag for this instance is always true, as it represents the default behavior.

filterSubsampledback to summary
private boolean filterSubsampled
sourceRegionback to summary
private Rectangle sourceRegion
subsamplingOffsetXback to summary
private int subsamplingOffsetX
subsamplingOffsetYback to summary
private int subsamplingOffsetY
subsamplingXback to summary
private int subsamplingX
subsamplingYback to summary
private int subsamplingY

Constructor Detail

DecodeOptionsback to summary
public DecodeOptions()

Constructs an empty DecodeOptions instance

DecodeOptionsback to summary
public DecodeOptions(Rectangle sourceRegion)

Constructs an instance specifying the region of the image that should be decoded. The actual region will be clipped to the dimensions of the image.

Parameters
sourceRegion:Rectangle

Region of the source image that should be decoded

DecodeOptionsback to summary
public DecodeOptions(int x, int y, int width, int height)

Constructs an instance specifying the region of the image that should be decoded. The actual region will be clipped to the dimensions of the image.

Parameters
x:int

x-coordinate of the top-left corner of the region to be decoded

y:int

y-coordinate of the top-left corner of the region to be decoded

width:int

Width of the region to be decoded

height:int

Height of the region to be decoded

DecodeOptionsback to summary
public DecodeOptions(int subsampling)

Constructs an instance specifying the image should be decoded using subsampling. The subsampling will be the same for the X and Y axes.

Parameters
subsampling:int

The number of rows and columns to advance in the source for each pixel in the decoded image.

Method Detail

getSourceRegionback to summary
public Rectangle getSourceRegion()

When decoding an image, the part of the image that should be decoded, or null if the entire image is needed.

Returns:Rectangle

The source region to decode, or null if the entire image should be decoded

getSubsamplingOffsetXback to summary
public int getSubsamplingOffsetX()

When decoding an image, the horizontal offset for subsampling

Returns:int

The x-axis subsampling offset

getSubsamplingOffsetYback to summary
public int getSubsamplingOffsetY()

When decoding an image, the vertical offset for subsampling

Returns:int

The y-axis subsampling offset

getSubsamplingXback to summary
public int getSubsamplingX()

When decoding an image, the number of columns to advance in the source for every pixel decoded.

Returns:int

The x-axis subsampling value

getSubsamplingYback to summary
public int getSubsamplingY()

When decoding an image, the number of rows to advance in the source for every pixel decoded.

Returns:int

The y-axis subsampling value

isFilterSubsampledback to summary
public boolean isFilterSubsampled()

Flag used by the filter to specify if it performed subsampling. Some filters may be unable or unwilling to apply subsampling, and so the caller must check this flag after decoding.

Returns:boolean

True if the filter applied the options specified by this instance, false otherwise.

setFilterSubsampledback to summary
pack-priv void setFilterSubsampled(boolean filterSubsampled)

Used internally by filters to signal they have applied subsampling as requested by this options instance.

Parameters
filterSubsampled:boolean

Value specifying if the filter could meet the requested options. Usually a filter will only call this with the value true, as the default value for the flag is false.

setSourceRegionback to summary
public void setSourceRegion(Rectangle sourceRegion)

Sets the region of the source image that should be decoded. The region will be clipped to the dimensions of the source image. Setting this value to null will result in the entire image being decoded.

Parameters
sourceRegion:Rectangle

The source region to decode, or null if the entire image should be decoded.

setSubsamplingOffsetXback to summary
public void setSubsamplingOffsetX(int ssOffsetX)

Sets the horizontal subsampling offset for decoding images

Parameters
ssOffsetX:int

The x-axis subsampling offset

setSubsamplingOffsetYback to summary
public void setSubsamplingOffsetY(int ssOffsetY)

Sets the vertical subsampling offset for decoding images

Parameters
ssOffsetY:int

The y-axis subsampling offset

setSubsamplingXback to summary
public void setSubsamplingX(int ssX)

Sets the number of columns to advance in the source for every pixel decoded

Parameters
ssX:int

The x-axis subsampling value

setSubsamplingYback to summary
public void setSubsamplingY(int ssY)

Sets the number of rows to advance in the source for every pixel decoded

Parameters
ssY:int

The y-axis subsampling value

org.apache.pdfbox.filter back to summary

private Class DecodeOptions.FinalDecodeOptions

extends DecodeOptions
Class Inheritance

Helper class for reusable instances which may not be modified.

Field Summary

Inherited from org.apache.pdfbox.filter.DecodeOptions:
DEFAULT

Constructor Summary

AccessConstructor and Description
pack-priv
FinalDecodeOptions(boolean filterSubsampled)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
setFilterSubsampled(boolean
Value specifying if the filter could meet the requested options. Usually a filter will only call this with the value true, as the default value for the flag is false.
filterSubsampled
)

Overrides org.apache.pdfbox.filter.DecodeOptions.setFilterSubsampled.

Used internally by filters to signal they have applied subsampling as requested by this options instance.

public void
setSourceRegion(Rectangle
The source region to decode, or null if the entire image should be decoded.
sourceRegion
)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSourceRegion.

Sets the region of the source image that should be decoded.

public void
setSubsamplingOffsetX(int
The x-axis subsampling offset
ssOffsetX
)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSubsamplingOffsetX.

Sets the horizontal subsampling offset for decoding images

public void
setSubsamplingOffsetY(int
The y-axis subsampling offset
ssOffsetY
)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSubsamplingOffsetY.

Sets the vertical subsampling offset for decoding images

public void
setSubsamplingX(int
The x-axis subsampling value
ssX
)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSubsamplingX.

Sets the number of columns to advance in the source for every pixel decoded

public void
setSubsamplingY(int
The y-axis subsampling value
ssY
)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSubsamplingY.

Sets the number of rows to advance in the source for every pixel decoded

Inherited from org.apache.pdfbox.filter.DecodeOptions:
getSourceRegiongetSubsamplingOffsetXgetSubsamplingOffsetYgetSubsamplingXgetSubsamplingYisFilterSubsampled

Constructor Detail

FinalDecodeOptionsback to summary
pack-priv FinalDecodeOptions(boolean filterSubsampled)

Method Detail

setFilterSubsampledback to summary
pack-priv void setFilterSubsampled(boolean filterSubsampled)

Overrides org.apache.pdfbox.filter.DecodeOptions.setFilterSubsampled.

Doc from org.apache.pdfbox.filter.DecodeOptions.setFilterSubsampled.

Used internally by filters to signal they have applied subsampling as requested by this options instance.

Parameters
filterSubsampled:boolean

Value specifying if the filter could meet the requested options. Usually a filter will only call this with the value true, as the default value for the flag is false.

Annotations
@Override
setSourceRegionback to summary
public void setSourceRegion(Rectangle sourceRegion)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSourceRegion.

Doc from org.apache.pdfbox.filter.DecodeOptions.setSourceRegion.

Sets the region of the source image that should be decoded. The region will be clipped to the dimensions of the source image. Setting this value to null will result in the entire image being decoded.

Parameters
sourceRegion:Rectangle

The source region to decode, or null if the entire image should be decoded.

Annotations
@Override
setSubsamplingOffsetXback to summary
public void setSubsamplingOffsetX(int ssOffsetX)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSubsamplingOffsetX.

Doc from org.apache.pdfbox.filter.DecodeOptions.setSubsamplingOffsetX.

Sets the horizontal subsampling offset for decoding images

Parameters
ssOffsetX:int

The x-axis subsampling offset

Annotations
@Override
setSubsamplingOffsetYback to summary
public void setSubsamplingOffsetY(int ssOffsetY)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSubsamplingOffsetY.

Doc from org.apache.pdfbox.filter.DecodeOptions.setSubsamplingOffsetY.

Sets the vertical subsampling offset for decoding images

Parameters
ssOffsetY:int

The y-axis subsampling offset

Annotations
@Override
setSubsamplingXback to summary
public void setSubsamplingX(int ssX)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSubsamplingX.

Doc from org.apache.pdfbox.filter.DecodeOptions.setSubsamplingX.

Sets the number of columns to advance in the source for every pixel decoded

Parameters
ssX:int

The x-axis subsampling value

Annotations
@Override
setSubsamplingYback to summary
public void setSubsamplingY(int ssY)

Overrides org.apache.pdfbox.filter.DecodeOptions.setSubsamplingY.

Doc from org.apache.pdfbox.filter.DecodeOptions.setSubsamplingY.

Sets the number of rows to advance in the source for every pixel decoded

Parameters
ssY:int

The y-axis subsampling value

Annotations
@Override