iText 9.8.1 API
iText.IO.Image.ImageData Class Reference

Describes encoded image data and the attributes needed to embed it in a document. More...

Inheritance diagram for iText.IO.Image.ImageData:
iText.IO.Image.Jbig2ImageData iText.IO.Image.Jpeg2000ImageData iText.IO.Image.JpegImageData iText.IO.Image.RawImageData iText.Kernel.Pdf.Canvas.Wmf.WmfImageData iText.Webpimagesupport.WebPImageData iText.IO.Image.BmpImageData iText.IO.Image.PngImageData iText.IO.Image.TiffImageData

Public Member Functions

virtual bool  IsRawImage ()
  Indicates whether this instance represents raw sample data. More...
 
virtual Uri  GetUrl ()
  Gets the source URL. More...
 
virtual void  SetUrl (Uri url)
  Sets the source URL used to load image bytes. More...
 
virtual int[]  GetTransparency ()
  Gets the component-value pairs that define transparent ranges. More...
 
virtual void  SetTransparency (int[] transparency)
  Sets component-value pairs that define transparent ranges. More...
 
virtual bool  IsInverted ()
  Checks whether image samples are inverted. More...
 
virtual void  SetInverted (bool inverted)
  Sets whether image samples are inverted. More...
 
virtual float  GetRotation ()
  Gets the clockwise rotation applied to the image. More...
 
virtual void  SetRotation (float rotation)
  Sets the clockwise rotation applied to the image. More...
 
virtual IccProfile  GetProfile ()
  Gets the associated ICC color profile. More...
 
virtual void  SetProfile (IccProfile profile)
  Sets the associated ICC color profile. More...
 
virtual int  GetDpiX ()
  Gets the horizontal image resolution. More...
 
virtual int  GetDpiY ()
  Gets the vertical image resolution. More...
 
virtual void  SetDpi (int dpiX, int dpiY)
  Sets the image resolution. More...
 
virtual int  GetColorTransform ()
  Gets the color-transform selector. More...
 
virtual void  SetColorTransform (int colorTransform)
  Sets the color-transform selector. More...
 
virtual bool  IsDeflated ()
  Checks whether image bytes are already deflate-compressed. More...
 
virtual void  SetDeflated (bool deflated)
  Sets whether image bytes are already deflate-compressed. More...
 
virtual ImageType  GetOriginalType ()
  Gets the source image format. More...
 
virtual int  GetColorEncodingComponentsNumber ()
  Gets the number of components used to encode colorspace. More...
 
virtual void  SetColorEncodingComponentsNumber (int colorEncodingComponentsNumber)
  Sets the number of components used to encode colorspace. More...
 
virtual byte[]  GetData ()
  Gets the encoded image bytes. More...
 
virtual bool  CanBeMask ()
  Checks whether this image can be converted to an image mask. More...
 
virtual bool  IsMask ()
  Checks whether this image is an image mask. More...
 
virtual iText.IO.Image.ImageData  GetImageMask ()
  Gets the mask image associated with this image. More...
 
virtual void  SetImageMask (iText.IO.Image.ImageData imageMask)
  Associates a mask image with this image. More...
 
virtual bool  IsSoftMask ()
  Checks whether this image is a soft mask. More...
 
virtual void  MakeMask ()
  Converts this image to an image mask. More...
 
virtual float  GetWidth ()
  Gets the image width. More...
 
virtual void  SetWidth (float width)
  Sets the image width. More...
 
virtual float  GetHeight ()
  Gets the image height. More...
 
virtual void  SetHeight (float height)
  Sets the image height. More...
 
virtual int  GetBpc ()
  Gets the number of bits used for each color component. More...
 
virtual void  SetBpc (int bpc)
  Sets the number of bits used for each color component. More...
 
virtual bool  IsInterpolation ()
  Checks whether interpolation should be requested while rendering. More...
 
virtual void  SetInterpolation (bool interpolation)
  Sets whether interpolation should be requested while rendering. More...
 
virtual float  GetXYRatio ()
  Gets the pixel aspect ratio. More...
 
virtual void  SetXYRatio (float XYRatio)
  Sets the pixel aspect ratio. More...
 
virtual IDictionary< String, Object >  GetImageAttributes ()
  Gets additional image attributes. More...
 
virtual void  SetImageAttributes (IDictionary< String, Object > imageAttributes)
  Sets additional image attributes. More...
 
virtual String  GetFilter ()
  Gets the PDF filter name used for the image data. More...
 
virtual void  SetFilter (String filter)
  Sets the PDF filter name used for the image data. More...
 
virtual IDictionary< String, Object >  GetDecodeParms ()
  Gets image decoder parameters. More...
 
virtual float[]  GetDecode ()
  Gets the image decode array. More...
 
virtual void  SetDecode (float[] decode)
  Sets the image decode array. More...
 
virtual bool  CanImageBeInline ()
  Checks if image can be inline More...
 

Package Functions

  ImageData (Uri url, ImageType type)
  Creates image data whose bytes are available from a URL. More...
 
  ImageData (byte[] bytes, ImageType type)
  Creates image data from encoded bytes. More...
 
virtual void  LoadData ()
  Load data from URL. More...
 

Package Attributes

Uri  url
  Source URL from which the image bytes can be loaded, or null when bytes were supplied directly. More...
 
int[]  transparency
  Component-value pairs defining transparent ranges, or null when no range is specified. More...
 
ImageType  originalType
  Detected or declared format of the source image. More...
 
float  width
  Image width in pixels. More...
 
float  height
  Image height in pixels. More...
 
byte[]  data
  Encoded image bytes, or null until data is loaded from url. More...
 
int  imageSize
  Size of the image data in bytes when known. More...
 
int  bpc = 1
  Bits per color component. More...
 
int  colorEncodingComponentsNumber = -1
  Is the number of components used to encode colorspace. More...
 
float[]  decode
  Decode array applied to image samples, or null when no decode array is specified. More...
 
IDictionary< String, Object >  decodeParms
  Parameters associated with the image decoder, or null. More...
 
bool  inverted = false
  Whether the image samples are inverted. More...
 
float  rotation
  Clockwise rotation to apply to the image, in degrees. More...
 
IccProfile  profile
  ICC color profile associated with the image, or null. More...
 
int  dpiX = 0
  Horizontal resolution in dots per inch, or 0 when unspecified. More...
 
int  dpiY = 0
  Vertical resolution in dots per inch, or 0 when unspecified. More...
 
int  colorTransform = 1
  Color-transform selector used by formats that support it. More...
 
bool  deflated
  Whether data is already deflate-compressed. More...
 
bool  mask = false
  Whether this image is used as an image mask. More...
 
iText.IO.Image.ImageData  imageMask
  Mask image associated with this image, or null. More...
 
bool  interpolation
  Whether interpolation should be requested when rendering the image. More...
 
float  XYRatio = 0
  Pixel aspect ratio, or 0 when unspecified. More...
 
String  filter
  PDF filter name used to decode the image data, or null. More...
 
IDictionary< String, Object >  imageAttributes
  Additional image attributes, or null. More...
 
long?  mySerialId = GetSerialId()
 

Detailed Description

Describes encoded image data and the attributes needed to embed it in a document.

Constructor & Destructor Documentation

◆ ImageData() [1/2]

iText.IO.Image.ImageData.ImageData ( Uri  url,
ImageType  type 
)
inlinepackage

Creates image data whose bytes are available from a URL.

Parameters
url source URL, not null
type source image format

◆ ImageData() [2/2]

iText.IO.Image.ImageData.ImageData ( byte[]  bytes,
ImageType  type 
)
inlinepackage

Creates image data from encoded bytes.

Parameters
bytes encoded image bytes; the array is retained
type source image format

Member Function Documentation

◆ CanBeMask()

virtual bool iText.IO.Image.ImageData.CanBeMask ( )
inlinevirtual

Checks whether this image can be converted to an image mask.

Returns

true if the color encoding permits masking

◆ CanImageBeInline()

virtual bool iText.IO.Image.ImageData.CanImageBeInline ( )
inlinevirtual

Checks if image can be inline

Returns
if the image can be inline

Reimplemented in iText.IO.Image.Jpeg2000ImageData, and iText.IO.Image.Jbig2ImageData.

◆ GetBpc()

virtual int iText.IO.Image.ImageData.GetBpc ( )
inlinevirtual

Gets the number of bits used for each color component.

Returns
bits per component

◆ GetColorEncodingComponentsNumber()

virtual int iText.IO.Image.ImageData.GetColorEncodingComponentsNumber ( )
inlinevirtual

Gets the number of components used to encode colorspace.

Returns
the number of components used to encode colorspace

◆ GetColorTransform()

virtual int iText.IO.Image.ImageData.GetColorTransform ( )
inlinevirtual

Gets the color-transform selector.

Returns
color-transform selector

◆ GetData()

virtual byte [] iText.IO.Image.ImageData.GetData ( )
inlinevirtual

Gets the encoded image bytes.

Returns
retained encoded bytes, or null until loaded

◆ GetDecode()

virtual float [] iText.IO.Image.ImageData.GetDecode ( )
inlinevirtual

Gets the image decode array.

Returns
retained decode array, or null

◆ GetDecodeParms()

virtual IDictionary iText.IO.Image.ImageData.GetDecodeParms ( )
inlinevirtual

Gets image decoder parameters.

Returns
retained decoder-parameter map, or null

◆ GetDpiX()

virtual int iText.IO.Image.ImageData.GetDpiX ( )
inlinevirtual

Gets the horizontal image resolution.

Returns
dots per inch, or 0 when unspecified

◆ GetDpiY()

virtual int iText.IO.Image.ImageData.GetDpiY ( )
inlinevirtual

Gets the vertical image resolution.

Returns
dots per inch, or 0 when unspecified

◆ GetFilter()

virtual String iText.IO.Image.ImageData.GetFilter ( )
inlinevirtual

Gets the PDF filter name used for the image data.

Returns
filter name, or null

◆ GetHeight()

virtual float iText.IO.Image.ImageData.GetHeight ( )
inlinevirtual

Gets the image height.

Returns
height in pixels

◆ GetImageAttributes()

virtual IDictionary iText.IO.Image.ImageData.GetImageAttributes ( )
inlinevirtual

Gets additional image attributes.

Returns
retained attribute map, or null

◆ GetImageMask()

virtual iText.IO.Image.ImageData iText.IO.Image.ImageData.GetImageMask ( )
inlinevirtual

Gets the mask image associated with this image.

Returns
mask image, or null

◆ GetOriginalType()

virtual ImageType iText.IO.Image.ImageData.GetOriginalType ( )
inlinevirtual

Gets the source image format.

Returns
source image format

◆ GetProfile()

virtual IccProfile iText.IO.Image.ImageData.GetProfile ( )
inlinevirtual

Gets the associated ICC color profile.

Returns
ICC profile, or null

◆ GetRotation()

virtual float iText.IO.Image.ImageData.GetRotation ( )
inlinevirtual

Gets the clockwise rotation applied to the image.

Returns
rotation in degrees

◆ GetTransparency()

virtual int [] iText.IO.Image.ImageData.GetTransparency ( )
inlinevirtual

Gets the component-value pairs that define transparent ranges.

Returns
retained transparency array, or null

◆ GetUrl()

virtual Uri iText.IO.Image.ImageData.GetUrl ( )
inlinevirtual

Gets the source URL.

Returns
source URL, or null when the image was created from bytes

◆ GetWidth()

virtual float iText.IO.Image.ImageData.GetWidth ( )
inlinevirtual

Gets the image width.

Returns
width in pixels

◆ GetXYRatio()

virtual float iText.IO.Image.ImageData.GetXYRatio ( )
inlinevirtual

Gets the pixel aspect ratio.

Returns
pixel aspect ratio, or 0 when unspecified

◆ IsDeflated()

virtual bool iText.IO.Image.ImageData.IsDeflated ( )
inlinevirtual

Checks whether image bytes are already deflate-compressed.

Returns

true when the image bytes are deflated

◆ IsInterpolation()

virtual bool iText.IO.Image.ImageData.IsInterpolation ( )
inlinevirtual

Checks whether interpolation should be requested while rendering.

Returns

true to request interpolation

◆ IsInverted()

virtual bool iText.IO.Image.ImageData.IsInverted ( )
inlinevirtual

Checks whether image samples are inverted.

Returns

true if samples are inverted

◆ IsMask()

virtual bool iText.IO.Image.ImageData.IsMask ( )
inlinevirtual

Checks whether this image is an image mask.

Returns

true if this image is a mask

◆ IsRawImage()

virtual bool iText.IO.Image.ImageData.IsRawImage ( )
inlinevirtual

Indicates whether this instance represents raw sample data.

Returns

true for raw image data; false otherwise

Reimplemented in iText.IO.Image.RawImageData.

◆ IsSoftMask()

virtual bool iText.IO.Image.ImageData.IsSoftMask ( )
inlinevirtual

Checks whether this image is a soft mask.

Returns

true if this image is a soft mask

◆ LoadData()

virtual void iText.IO.Image.ImageData.LoadData ( )
inlinepackagevirtual

Load data from URL.

Load data from URL. url must be not null. Note, this method doesn't check if data or url is null.

◆ MakeMask()

virtual void iText.IO.Image.ImageData.MakeMask ( )
inlinevirtual

Converts this image to an image mask.

◆ SetBpc()

virtual void iText.IO.Image.ImageData.SetBpc ( int  bpc )
inlinevirtual

Sets the number of bits used for each color component.

Parameters
bpc bits per component

◆ SetColorEncodingComponentsNumber()

virtual void iText.IO.Image.ImageData.SetColorEncodingComponentsNumber ( int  colorEncodingComponentsNumber )
inlinevirtual

Sets the number of components used to encode colorspace.

Parameters
colorEncodingComponentsNumber the number of components used to encode colorspace

◆ SetColorTransform()

virtual void iText.IO.Image.ImageData.SetColorTransform ( int  colorTransform )
inlinevirtual

Sets the color-transform selector.

Parameters
colorTransform color-transform selector

◆ SetDecode()

virtual void iText.IO.Image.ImageData.SetDecode ( float[]  decode )
inlinevirtual

Sets the image decode array.

Parameters
decode decode array to retain, or null

◆ SetDeflated()

virtual void iText.IO.Image.ImageData.SetDeflated ( bool  deflated )
inlinevirtual

Sets whether image bytes are already deflate-compressed.

Parameters
deflated

true when the image bytes are deflated

◆ SetDpi()

virtual void iText.IO.Image.ImageData.SetDpi ( int  dpiX,
int  dpiY 
)
inlinevirtual

Sets the image resolution.

Parameters
dpiX horizontal resolution in dots per inch
dpiY vertical resolution in dots per inch

◆ SetFilter()

virtual void iText.IO.Image.ImageData.SetFilter ( String  filter )
inlinevirtual

Sets the PDF filter name used for the image data.

Parameters
filter PDF filter name, or null

◆ SetHeight()

virtual void iText.IO.Image.ImageData.SetHeight ( float  height )
inlinevirtual

Sets the image height.

Parameters
height height in pixels

◆ SetImageAttributes()

virtual void iText.IO.Image.ImageData.SetImageAttributes ( IDictionary< String, Object >  imageAttributes )
inlinevirtual

Sets additional image attributes.

Parameters
imageAttributes attribute map to retain, or null

◆ SetImageMask()

virtual void iText.IO.Image.ImageData.SetImageMask ( iText.IO.Image.ImageData  imageMask )
inlinevirtual

Associates a mask image with this image.

Parameters
imageMask image that has been made a mask

◆ SetInterpolation()

virtual void iText.IO.Image.ImageData.SetInterpolation ( bool  interpolation )
inlinevirtual

Sets whether interpolation should be requested while rendering.

Parameters
interpolation

true to request interpolation

◆ SetInverted()

virtual void iText.IO.Image.ImageData.SetInverted ( bool  inverted )
inlinevirtual

Sets whether image samples are inverted.

Parameters
inverted

true to invert samples

◆ SetProfile()

virtual void iText.IO.Image.ImageData.SetProfile ( IccProfile  profile )
inlinevirtual

Sets the associated ICC color profile.

Parameters
profile ICC profile to associate, or null

◆ SetRotation()

virtual void iText.IO.Image.ImageData.SetRotation ( float  rotation )
inlinevirtual

Sets the clockwise rotation applied to the image.

Parameters
rotation rotation in degrees

◆ SetTransparency()

virtual void iText.IO.Image.ImageData.SetTransparency ( int[]  transparency )
inlinevirtual

Sets component-value pairs that define transparent ranges.

Parameters
transparency transparency array to retain, or null

◆ SetUrl()

virtual void iText.IO.Image.ImageData.SetUrl ( Uri  url )
inlinevirtual

Sets the source URL used to load image bytes.

Parameters
url source URL, or null

◆ SetWidth()

virtual void iText.IO.Image.ImageData.SetWidth ( float  width )
inlinevirtual

Sets the image width.

Parameters
width width in pixels

◆ SetXYRatio()

virtual void iText.IO.Image.ImageData.SetXYRatio ( float  XYRatio )
inlinevirtual

Sets the pixel aspect ratio.

Parameters
XYRatio pixel aspect ratio

Member Data Documentation

◆ bpc

int iText.IO.Image.ImageData.bpc = 1
package

Bits per color component.

◆ colorEncodingComponentsNumber

int iText.IO.Image.ImageData.colorEncodingComponentsNumber = -1
package

Is the number of components used to encode colorspace.

◆ colorTransform

int iText.IO.Image.ImageData.colorTransform = 1
package

Color-transform selector used by formats that support it.

◆ data

byte [] iText.IO.Image.ImageData.data
package

Encoded image bytes, or null until data is loaded from url.

◆ decode

float [] iText.IO.Image.ImageData.decode
package

Decode array applied to image samples, or null when no decode array is specified.

◆ decodeParms

IDictionary iText.IO.Image.ImageData.decodeParms
package

Parameters associated with the image decoder, or null.

◆ deflated

bool iText.IO.Image.ImageData.deflated
package

Whether data is already deflate-compressed.

◆ dpiX

int iText.IO.Image.ImageData.dpiX = 0
package

Horizontal resolution in dots per inch, or 0 when unspecified.

◆ dpiY

int iText.IO.Image.ImageData.dpiY = 0
package

Vertical resolution in dots per inch, or 0 when unspecified.

◆ filter

String iText.IO.Image.ImageData.filter
package

PDF filter name used to decode the image data, or null.

◆ height

float iText.IO.Image.ImageData.height
package

Image height in pixels.

◆ imageAttributes

IDictionary iText.IO.Image.ImageData.imageAttributes
package

Additional image attributes, or null.

◆ imageMask

iText.IO.Image.ImageData iText.IO.Image.ImageData.imageMask
package

Mask image associated with this image, or null.

◆ imageSize

int iText.IO.Image.ImageData.imageSize
package

Size of the image data in bytes when known.

◆ interpolation

bool iText.IO.Image.ImageData.interpolation
package

Whether interpolation should be requested when rendering the image.

◆ inverted

bool iText.IO.Image.ImageData.inverted = false
package

Whether the image samples are inverted.

◆ mask

bool iText.IO.Image.ImageData.mask = false
package

Whether this image is used as an image mask.

◆ originalType

ImageType iText.IO.Image.ImageData.originalType
package

Detected or declared format of the source image.

◆ profile

IccProfile iText.IO.Image.ImageData.profile
package

ICC color profile associated with the image, or null.

◆ rotation

float iText.IO.Image.ImageData.rotation
package

Clockwise rotation to apply to the image, in degrees.

◆ transparency

int [] iText.IO.Image.ImageData.transparency
package

Component-value pairs defining transparent ranges, or null when no range is specified.

◆ url

Uri iText.IO.Image.ImageData.url
package

Source URL from which the image bytes can be loaded, or null when bytes were supplied directly.

◆ width

float iText.IO.Image.ImageData.width
package

Image width in pixels.

◆ XYRatio

float iText.IO.Image.ImageData.XYRatio = 0
package

Pixel aspect ratio, or 0 when unspecified.