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 intbpcprotected intcolorEncodingComponentsNumberIs the number of components used to encode colorspace.protected intcolorTransformprotected byte[]dataprotected float[]decodeprotected java.util.Map<java.lang.String,java.lang.Object>decodeParmsprotected booleandeflatedprotected intdpiXprotected intdpiYprotected java.lang.Stringfilterprotected floatheightprotected java.util.Map<java.lang.String,java.lang.Object>imageAttributesprotected ImageDataimageMaskprotected intimageSizeprotected booleaninterpolationprotected booleaninvertedprotected booleanmaskprotected java.lang.LongmySerialIdprotected ImageTypeoriginalTypeprotected IccProfileprofileprotected floatrotationprivate static longserialIda static that is used for attributing a unique id to each image.private static java.lang.ObjectstaticLockprotected int[]transparencyprotected java.net.URLurlprotected floatwidthprotected floatXYRatio
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBeMask()booleancanImageBeInline()Checks if image can be inlineintgetBpc()intgetColorEncodingComponentsNumber()Gets the number of components used to encode colorspace.intgetColorTransform()byte[]getData()float[]getDecode()java.util.Map<java.lang.String,java.lang.Object>getDecodeParms()intgetDpiX()intgetDpiY()java.lang.StringgetFilter()floatgetHeight()java.util.Map<java.lang.String,java.lang.Object>getImageAttributes()ImageDatagetImageMask()ImageTypegetOriginalType()IccProfilegetProfile()floatgetRotation()private static java.lang.LonggetSerialId()Creates a new serial id.int[]getTransparency()java.net.URLgetUrl()floatgetWidth()floatgetXYRatio()booleanisDeflated()booleanisInterpolation()booleanisInverted()booleanisMask()booleanisRawImage()booleanisSoftMask()(package private) voidloadData()Load data from URL.voidmakeMask()voidsetBpc(int bpc)voidsetColorEncodingComponentsNumber(int colorEncodingComponentsNumber)Sets the number of components used to encode colorspace.voidsetColorTransform(int colorTransform)voidsetDecode(float[] decode)voidsetDeflated(boolean deflated)voidsetDpi(int dpiX, int dpiY)voidsetFilter(java.lang.String filter)voidsetHeight(float height)voidsetImageAttributes(java.util.Map<java.lang.String,java.lang.Object> imageAttributes)voidsetImageMask(ImageData imageMask)voidsetInterpolation(boolean interpolation)voidsetInverted(boolean inverted)voidsetProfile(IccProfile profile)voidsetRotation(float rotation)voidsetTransparency(int[] transparency)voidsetUrl(java.net.URL url)voidsetWidth(float width)voidsetXYRatio(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.IOExceptionLoad 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
-
-