Package org.apache.pdfbox.util
Class ImageParameters
java.lang.Object
org.apache.pdfbox.util.ImageParameters
This contains all of the image parameters for in inlined image.
- Version:
- $Revision: 1.4 $
- Author:
- Ben Litchfield
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
The bits per component of this image.This will get the color space or null if none exists.getColorSpace
(Map colorSpaces) This will get the color space or null if none exists.This will get the dictionary that stores the image parameters.This will get the list of filters that are associated with this stream.int
The height of this image.int
getWidth()
The width of this image.boolean
Returns true if the image is a stencil mask.void
setBitsPerComponent
(int bpc) Set the number of bits per component.void
This will set the color space for this image.void
setFilters
(List filters) This will set the filters that are part of this stream.void
setHeight
(int h) Set the height of the image.void
setStencil
(boolean isStencil) Sets whether or not the image is a stencil.void
setWidth
(int w) Set the width of the image.
-
Constructor Details
-
ImageParameters
public ImageParameters()Constructor. -
ImageParameters
Constructor.- Parameters:
params
- The image parameters.
-
-
Method Details
-
getDictionary
This will get the dictionary that stores the image parameters.- Returns:
- The COS dictionary that stores the image parameters.
-
getBitsPerComponent
public int getBitsPerComponent()The bits per component of this image. This will return -1 if one has not been set.- Returns:
- The number of bits per component.
-
setBitsPerComponent
public void setBitsPerComponent(int bpc) Set the number of bits per component.- Parameters:
bpc
- The number of bits per component.
-
getColorSpace
This will get the color space or null if none exists.- Returns:
- The color space for this image.
- Throws:
IOException
- If there is an error getting the colorspace.
-
getColorSpace
This will get the color space or null if none exists.- Parameters:
colorSpaces
- The ColorSpace dictionary from the current resources, if any.- Returns:
- The color space for this image.
- Throws:
IOException
- If there is an error getting the colorspace.
-
setColorSpace
This will set the color space for this image.- Parameters:
cs
- The color space for this image.
-
getHeight
public int getHeight()The height of this image. This will return -1 if one has not been set.- Returns:
- The height.
-
setHeight
public void setHeight(int h) Set the height of the image.- Parameters:
h
- The height of the image.
-
getWidth
public int getWidth()The width of this image. This will return -1 if one has not been set.- Returns:
- The width.
-
setWidth
public void setWidth(int w) Set the width of the image.- Parameters:
w
- The width of the image.
-
getFilters
This will get the list of filters that are associated with this stream. Or null if there are none.- Returns:
- A list of all encoding filters to apply to this stream.
-
setFilters
This will set the filters that are part of this stream.- Parameters:
filters
- The filters that are part of this stream.
-
isStencil
public boolean isStencil()Returns true if the image is a stencil mask.- Returns:
- true if the image is a stencil mask.
-
setStencil
public void setStencil(boolean isStencil) Sets whether or not the image is a stencil. This corresponds to theImageMask
entry in the image stream's dictionary.- Parameters:
isStencil
- True to make the image a stencil.
-