pdfOptimizer 3.0.1 API
iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels Class Reference

Class allows to process pixels of the bitmap image stored as byte array according to PDF specification. More...

Public Member Functions

  BitmapImagePixels (int width, int height, int bitsPerComponent, int numberOfComponents)
  Creates a representation of empty image. More...
 
  BitmapImagePixels (PdfImageXObject image)
  Creates a representation of an image presented as iText.Kernel.Pdf.Xobject.PdfImageXObject. More...
 
  BitmapImagePixels (int width, int height, int bitsPerComponent, int numberOfComponents, byte[] data)
  Creates a representation of an image presented as bytes array. More...
 
virtual double[]  GetPixel (int x, int y)
  Gets pixel of the image. More...
 
virtual long[]  GetPixelAsLongs (int x, int y)
  Gets pixel of the image presented as long values. More...
 
virtual void  SetPixel (int x, int y, double[] value)
  Updates a pixel of the image. More...
 
virtual void  SetPixel (int x, int y, long[] value)
  Updates a pixel of the image. More...
 
virtual int  GetWidth ()
  Getter for a width of the image. More...
 
virtual int  GetHeight ()
  Getter for a height of the image. More...
 
virtual int  GetBitsPerComponent ()
  Getter for bits per component parameter of the image. More...
 
virtual int  GetNumberOfComponents ()
  Getter for number of components parameter of the image. More...
 
virtual byte[]  GetData ()
  Getter for byte representation of the image. More...
 
virtual int  GetMaxComponentValue ()
  Gets the maximum value for the component. More...
 

Detailed Description

Class allows to process pixels of the bitmap image stored as byte array according to PDF specification.

Constructor & Destructor Documentation

◆ BitmapImagePixels() [1/3]

iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.BitmapImagePixels ( int  width,
int  height,
int  bitsPerComponent,
int  numberOfComponents 
)
inline

Creates a representation of empty image.

Parameters
width is a width of the image
height is a height of the image
bitsPerComponent is an amount of bits representing each color component of a pixel
numberOfComponents is a number of components representing a pixel

◆ BitmapImagePixels() [2/3]

iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.BitmapImagePixels ( PdfImageXObject  image )
inline

Creates a representation of an image presented as iText.Kernel.Pdf.Xobject.PdfImageXObject.

Parameters
image is an image as iText.Kernel.Pdf.Xobject.PdfImageXObject

◆ BitmapImagePixels() [3/3]

iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.BitmapImagePixels ( int  width,
int  height,
int  bitsPerComponent,
int  numberOfComponents,
byte[]  data 
)
inline

Creates a representation of an image presented as bytes array.

Parameters
width is a width of the image
height is a height of the image
bitsPerComponent is an amount of bits representing each color component of a pixel
numberOfComponents is a number of components representing a pixel
data is an image data

Member Function Documentation

◆ GetBitsPerComponent()

virtual int iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.GetBitsPerComponent ( )
inlinevirtual

Getter for bits per component parameter of the image.

Returns
bits per component parameter of the image

◆ GetData()

virtual byte [] iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.GetData ( )
inlinevirtual

Getter for byte representation of the image.

Returns
image data as byte array

◆ GetHeight()

virtual int iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.GetHeight ( )
inlinevirtual

Getter for a height of the image.

Returns
height of the image

◆ GetMaxComponentValue()

virtual int iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.GetMaxComponentValue ( )
inlinevirtual

Gets the maximum value for the component.

Returns
maximum value of the component

◆ GetNumberOfComponents()

virtual int iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.GetNumberOfComponents ( )
inlinevirtual

Getter for number of components parameter of the image.

Returns
number of components of the image

◆ GetPixel()

virtual double [] iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.GetPixel ( int  x,
int  y 
)
inlinevirtual

Gets pixel of the image.

Parameters
x is an x-coordinate of a pixel to update
y is a y-coordinate of a pixel to update
Returns
an array representing pixel color according to used color space

◆ GetPixelAsLongs()

virtual long [] iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.GetPixelAsLongs ( int  x,
int  y 
)
inlinevirtual

Gets pixel of the image presented as long values.

Parameters
x is an x-coordinate of a pixel to update
y is a y-coordinate of a pixel to update
Returns
an array representing pixel color according to used color space

◆ GetWidth()

virtual int iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.GetWidth ( )
inlinevirtual

Getter for a width of the image.

Returns
width of the image

◆ SetPixel() [1/2]

virtual void iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.SetPixel ( int  x,
int  y,
double[]  value 
)
inlinevirtual

Updates a pixel of the image.

Parameters
x is an x-coordinate of a pixel to update
y is a y-coordinate of a pixel to update
value is a pixel color. Pixel should be presented as double array according to used color space. Each value should be in range 0., 1.

◆ SetPixel() [2/2]

virtual void iText.Pdfoptimizer.Handlers.Util.BitmapImagePixels.SetPixel ( int  x,
int  y,
long[]  value 
)
inlinevirtual

Updates a pixel of the image.

Parameters
x is an x-coordinate of a pixel to update
y is a y-coordinate of a pixel to update
value is a pixel color. Pixel should be presented as long array according to used color space. Each value should be in range [0, 2 ^ bitsPerComponent - 1] (otherwise negative value will be replaced with 0. and large numbers are replaced with maximum allowed value.)