intarsys PDF library API

de.intarsys.pdf.pd
Class PDImage

java.lang.Object
  extended by de.intarsys.pdf.cos.COSBasedObject
      extended by de.intarsys.pdf.pd.PDObject
          extended by de.intarsys.pdf.pd.PDXObject
              extended by de.intarsys.pdf.pd.PDImage
All Implemented Interfaces:
ICOSObjectListener, IAttributeSupport

public class PDImage
extends PDXObject

The representation of an image.


Nested Class Summary
static class PDImage.MetaClass
          The meta class implementation
 
Field Summary
static String C_RENDERING_VALID1
          the valid rendering intents *
static String C_RENDERING_VALID2
           
static String C_RENDERING_VALID3
           
static String C_RENDERING_VALID4
           
static COSName CN_Subtype_Image
           
static COSName DK_Alternates
           
static COSName DK_BitsPerComponent
           
static COSName DK_BPC
           
static COSName DK_ColorSpace
           
static COSName DK_CS
           
static COSName DK_D
           
static COSName DK_Decode
           
static COSName DK_DecodeParms
           
static COSName DK_DP
           
static COSName DK_H
           
static COSName DK_Height
           
static COSName DK_I
           
static COSName DK_ID
           
static COSName DK_IM
           
static COSName DK_ImageMask
           
static COSName DK_Intent
           
static COSName DK_Interpolate
           
static COSName DK_Mask
           
static COSName DK_Metadata
           
static COSName DK_Name
           
static COSName DK_OC
           
static COSName DK_OPI
           
static COSName DK_SMask
           
static COSName DK_SMaskInData
           
static COSName DK_StructParent
           
static COSName DK_W
           
static COSName DK_Width
           
static PDImage.MetaClass META
          The meta class instance
 
Fields inherited from class de.intarsys.pdf.pd.PDXObject
CN_Type_XObject, DK_Resources
 
Fields inherited from class de.intarsys.pdf.pd.PDObject
DK_Subtype, DK_Type
 
Method Summary
 COSStream cosExtractJPEGStream()
           
 COSObject cosGetColorSpace()
           
 COSObject cosGetMask()
           
 COSArray cosSetColorSpace(COSArray colorspace)
           
 COSName cosSetColorSpace(COSName colorspace)
           
 int getBitsPerComponent()
          The number of bits per component.
 byte[][] getColorKeyMask(int colors)
           
 PDColorSpace getColorSpace()
          The color space used by the image.
 int[] getDecode()
           
 int getHeight()
          get the height of the raster image
 PDImage getMaskImage()
           
 PDXObject getSMask()
           
 int getWidth()
          get the width of the raster image
 boolean hasTransparency()
           
 void invalidateCaches()
          Invalidate all local caches as the base object may have changed.
 boolean isImage()
          true if this is an image.
 boolean isImageMask()
           
 boolean isInterpolate()
           
 void setBitsPerComponent(int bits)
           
 void setColorSpace(PDColorSpace paramCachedColorSpace)
          In inline images the color space may reference the resource dictionary.
 void setDecode(int[] decode)
           
 void setHeight(int height)
          set the height of the raster image
 void setImageMask(boolean flag)
           
 void setMask(PDXObject object)
           
 void setSMask(PDXObject object)
           
 void setWidth(int width)
          set the width of the raster image
 
Methods inherited from class de.intarsys.pdf.pd.PDXObject
cosGetDict, getBytes, isForm, isPostscript, setBytes
 
Methods inherited from class de.intarsys.pdf.pd.PDObject
cosGetFieldDescendant, cosGetFieldInheritable, cosGetFieldInherited, cosGetSubtype, cosGetType, cosRemoveFieldInheritable, cosSetFieldInheritable, cosSetSubtype, cosSetType, getDoc, getGenericChildren, getGenericParent, setGenericParent, toString
 
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject
changed, cosGetArray, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

C_RENDERING_VALID1

public static final String C_RENDERING_VALID1
the valid rendering intents *

See Also:
Constant Field Values

C_RENDERING_VALID2

public static final String C_RENDERING_VALID2
See Also:
Constant Field Values

C_RENDERING_VALID3

public static final String C_RENDERING_VALID3
See Also:
Constant Field Values

C_RENDERING_VALID4

public static final String C_RENDERING_VALID4
See Also:
Constant Field Values

CN_Subtype_Image

public static final COSName CN_Subtype_Image

DK_Alternates

public static final COSName DK_Alternates

DK_BitsPerComponent

public static final COSName DK_BitsPerComponent

DK_BPC

public static final COSName DK_BPC

DK_ColorSpace

public static final COSName DK_ColorSpace

DK_CS

public static final COSName DK_CS

DK_D

public static final COSName DK_D

DK_Decode

public static final COSName DK_Decode

DK_DecodeParms

public static final COSName DK_DecodeParms

DK_DP

public static final COSName DK_DP

DK_H

public static final COSName DK_H

DK_Height

public static final COSName DK_Height

DK_I

public static final COSName DK_I

DK_ID

public static final COSName DK_ID

DK_IM

public static final COSName DK_IM

DK_ImageMask

public static final COSName DK_ImageMask

DK_Intent

public static final COSName DK_Intent

DK_Interpolate

public static final COSName DK_Interpolate

DK_Mask

public static final COSName DK_Mask

DK_Metadata

public static final COSName DK_Metadata

DK_Name

public static final COSName DK_Name

DK_OC

public static final COSName DK_OC

DK_OPI

public static final COSName DK_OPI

DK_SMask

public static final COSName DK_SMask

DK_SMaskInData

public static final COSName DK_SMaskInData

DK_StructParent

public static final COSName DK_StructParent

DK_W

public static final COSName DK_W

DK_Width

public static final COSName DK_Width

META

public static final PDImage.MetaClass META
The meta class instance

Method Detail

cosGetColorSpace

public COSObject cosGetColorSpace()

cosGetMask

public COSObject cosGetMask()

cosExtractJPEGStream

public COSStream cosExtractJPEGStream()
                               throws IOException
Throws:
IOException

getBitsPerComponent

public int getBitsPerComponent()
The number of bits per component.

This information is stored in different attributes depending if the image is inlined or explicit.

Returns:
The number of bits per component.

getColorKeyMask

public byte[][] getColorKeyMask(int colors)

getColorSpace

public PDColorSpace getColorSpace()
The color space used by the image.

Color space information is stored in different attributes in inlined and explicit images.

Returns:
The color space used by the image.

getDecode

public int[] getDecode()

getHeight

public int getHeight()
get the height of the raster image

Returns:
the height

getMaskImage

public PDImage getMaskImage()

getSMask

public PDXObject getSMask()

getWidth

public int getWidth()
get the width of the raster image

Returns:
the width

hasTransparency

public boolean hasTransparency()

invalidateCaches

public void invalidateCaches()
Description copied from class: COSBasedObject
Invalidate all local caches as the base object may have changed.

Overrides:
invalidateCaches in class COSBasedObject

isImage

public boolean isImage()
Description copied from class: PDXObject
true if this is an image.

Overrides:
isImage in class PDXObject
Returns:
true if this is an image.

isImageMask

public boolean isImageMask()

isInterpolate

public boolean isInterpolate()
Returns:
interpolation flag (used if a image is scaled)

setBitsPerComponent

public void setBitsPerComponent(int bits)

setColorSpace

public void setColorSpace(PDColorSpace paramCachedColorSpace)
In inline images the color space may reference the resource dictionary. In this case the color space is resolved and assigned externaly.

Parameters:
paramCachedColorSpace - The color space to use.

cosSetColorSpace

public COSArray cosSetColorSpace(COSArray colorspace)

cosSetColorSpace

public COSName cosSetColorSpace(COSName colorspace)

setDecode

public void setDecode(int[] decode)

setHeight

public void setHeight(int height)
set the height of the raster image

Parameters:
height - the height of the raster image

setImageMask

public void setImageMask(boolean flag)

setMask

public void setMask(PDXObject object)

setSMask

public void setSMask(PDXObject object)

setWidth

public void setWidth(int width)
set the width of the raster image

Parameters:
width - the width of the raster image

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.