Package com.itextpdf.io.image
Class ImageData
- java.lang.Object
-
- com.itextpdf.io.image.ImageData
-
- Direct Known Subclasses:
Jbig2ImageData
,Jpeg2000ImageData
,JpegImageData
,RawImageData
,WmfImageData
public abstract class ImageData extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected int
bpc
protected int
colorEncodingComponentsNumber
Is the number of components used to encode colorspace.protected int
colorTransform
protected byte[]
data
protected float[]
decode
protected java.util.Map<java.lang.String,java.lang.Object>
decodeParms
protected boolean
deflated
protected int
dpiX
protected int
dpiY
protected java.lang.String
filter
protected float
height
protected java.util.Map<java.lang.String,java.lang.Object>
imageAttributes
protected ImageData
imageMask
protected int
imageSize
protected boolean
interpolation
protected boolean
inverted
protected boolean
mask
protected java.lang.Long
mySerialId
protected ImageType
originalType
protected IccProfile
profile
protected float
rotation
private static long
serialId
a static that is used for attributing a unique id to each image.private static java.lang.Object
staticLock
protected int[]
transparency
protected java.net.URL
url
protected float
width
protected float
XYRatio
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeMask()
boolean
canImageBeInline()
Checks if image can be inlineint
getBpc()
int
getColorEncodingComponentsNumber()
Gets the number of components used to encode colorspace.int
getColorTransform()
byte[]
getData()
float[]
getDecode()
java.util.Map<java.lang.String,java.lang.Object>
getDecodeParms()
int
getDpiX()
int
getDpiY()
java.lang.String
getFilter()
float
getHeight()
java.util.Map<java.lang.String,java.lang.Object>
getImageAttributes()
ImageData
getImageMask()
ImageType
getOriginalType()
IccProfile
getProfile()
float
getRotation()
private static java.lang.Long
getSerialId()
Creates a new serial id.int[]
getTransparency()
java.net.URL
getUrl()
float
getWidth()
float
getXYRatio()
boolean
isDeflated()
boolean
isInterpolation()
boolean
isInverted()
boolean
isMask()
boolean
isRawImage()
boolean
isSoftMask()
(package private) void
loadData()
Load data from URL.void
makeMask()
void
setBpc(int bpc)
void
setColorEncodingComponentsNumber(int colorEncodingComponentsNumber)
Sets the number of components used to encode colorspace.void
setColorTransform(int colorTransform)
void
setDecode(float[] decode)
void
setDeflated(boolean deflated)
void
setDpi(int dpiX, int dpiY)
void
setFilter(java.lang.String filter)
void
setHeight(float height)
void
setImageAttributes(java.util.Map<java.lang.String,java.lang.Object> imageAttributes)
void
setImageMask(ImageData imageMask)
void
setInterpolation(boolean interpolation)
void
setInverted(boolean inverted)
void
setProfile(IccProfile profile)
void
setRotation(float rotation)
void
setTransparency(int[] transparency)
void
setUrl(java.net.URL url)
void
setWidth(float width)
void
setXYRatio(float XYRatio)
-
-
-
Field Detail
-
serialId
private static long serialId
a static that is used for attributing a unique id to each image.
-
staticLock
private static final java.lang.Object staticLock
-
url
protected java.net.URL url
-
transparency
protected int[] transparency
-
originalType
protected ImageType originalType
-
width
protected float width
-
height
protected float height
-
data
protected byte[] data
-
imageSize
protected int imageSize
-
bpc
protected int bpc
-
colorEncodingComponentsNumber
protected int colorEncodingComponentsNumber
Is the number of components used to encode colorspace.
-
decode
protected float[] decode
-
decodeParms
protected java.util.Map<java.lang.String,java.lang.Object> decodeParms
-
inverted
protected boolean inverted
-
rotation
protected float rotation
-
profile
protected IccProfile profile
-
dpiX
protected int dpiX
-
dpiY
protected int dpiY
-
colorTransform
protected int colorTransform
-
deflated
protected boolean deflated
-
mask
protected boolean mask
-
imageMask
protected ImageData imageMask
-
interpolation
protected boolean interpolation
-
XYRatio
protected float XYRatio
-
filter
protected java.lang.String filter
-
imageAttributes
protected java.util.Map<java.lang.String,java.lang.Object> imageAttributes
-
mySerialId
protected java.lang.Long mySerialId
-
-
Method Detail
-
isRawImage
public boolean isRawImage()
-
getUrl
public java.net.URL getUrl()
-
setUrl
public void setUrl(java.net.URL url)
-
getTransparency
public int[] getTransparency()
-
setTransparency
public void setTransparency(int[] transparency)
-
isInverted
public boolean isInverted()
-
setInverted
public void setInverted(boolean inverted)
-
getRotation
public float getRotation()
-
setRotation
public void setRotation(float rotation)
-
getProfile
public IccProfile getProfile()
-
setProfile
public void setProfile(IccProfile profile)
-
getDpiX
public int getDpiX()
-
getDpiY
public int getDpiY()
-
setDpi
public void setDpi(int dpiX, int dpiY)
-
getColorTransform
public int getColorTransform()
-
setColorTransform
public void setColorTransform(int colorTransform)
-
isDeflated
public boolean isDeflated()
-
setDeflated
public void setDeflated(boolean deflated)
-
getOriginalType
public ImageType getOriginalType()
-
getColorEncodingComponentsNumber
public int getColorEncodingComponentsNumber()
Gets the number of components used to encode colorspace.- Returns:
- the number of components used to encode colorspace
-
setColorEncodingComponentsNumber
public void setColorEncodingComponentsNumber(int colorEncodingComponentsNumber)
Sets the number of components used to encode colorspace.- Parameters:
colorEncodingComponentsNumber
- the number of components used to encode colorspace
-
getData
public byte[] getData()
-
canBeMask
public boolean canBeMask()
-
isMask
public boolean isMask()
-
getImageMask
public ImageData getImageMask()
-
setImageMask
public void setImageMask(ImageData imageMask)
-
isSoftMask
public boolean isSoftMask()
-
makeMask
public void makeMask()
-
getWidth
public float getWidth()
-
setWidth
public void setWidth(float width)
-
getHeight
public float getHeight()
-
setHeight
public void setHeight(float height)
-
getBpc
public int getBpc()
-
setBpc
public void setBpc(int bpc)
-
isInterpolation
public boolean isInterpolation()
-
setInterpolation
public void setInterpolation(boolean interpolation)
-
getXYRatio
public float getXYRatio()
-
setXYRatio
public void setXYRatio(float XYRatio)
-
getImageAttributes
public java.util.Map<java.lang.String,java.lang.Object> getImageAttributes()
-
setImageAttributes
public void setImageAttributes(java.util.Map<java.lang.String,java.lang.Object> imageAttributes)
-
getFilter
public java.lang.String getFilter()
-
setFilter
public void setFilter(java.lang.String filter)
-
getDecodeParms
public java.util.Map<java.lang.String,java.lang.Object> getDecodeParms()
-
getDecode
public float[] getDecode()
-
setDecode
public void setDecode(float[] decode)
-
canImageBeInline
public boolean canImageBeInline()
Checks if image can be inline- Returns:
- if the image can be inline
-
loadData
void loadData() throws java.io.IOException
Load data from URL. url must be not null. Note, this method doesn't check if data or url is null.- Throws:
java.io.IOException
-
getSerialId
private static java.lang.Long getSerialId()
Creates a new serial id.- Returns:
- the new serialId
-
-