public class BitmapImagePixels extends Object
Constructor and Description |
---|
BitmapImagePixels(int width, int height, int bitsPerComponent, int numberOfComponents)
Creates a representation of empty image.
|
BitmapImagePixels(int width, int height, int bitsPerComponent, int numberOfComponents, byte[] data)
Creates a representation of an image presented as bytes array.
|
BitmapImagePixels(com.itextpdf.kernel.pdf.xobject.PdfImageXObject image)
Creates a representation of an image presented as PdfImageXObject .
|
Modifier and Type | Method and Description |
---|---|
int |
getBitsPerComponent()
Getter for bits per component parameter of the image.
|
byte[] |
getData()
Getter for byte representation of the image.
|
int |
getHeight()
Getter for a height of the image.
|
int |
getMaxComponentValue()
Gets the maximum value for the component.
|
int |
getNumberOfComponents()
Getter for number of components parameter of the image.
|
double[] |
getPixel(int x, int y)
Gets pixel of the image.
|
long[] |
getPixelAsLongs(int x, int y)
Gets pixel of the image presented as long values.
|
int |
getWidth()
Getter for a width of the image.
|
void |
setPixel(int x, int y, double[] value)
Updates a pixel of the image.
|
void |
setPixel(int x, int y, long[] value)
Updates a pixel of the image.
|
public BitmapImagePixels(int width, int height, int bitsPerComponent, int numberOfComponents)
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
public BitmapImagePixels(com.itextpdf.kernel.pdf.xobject.PdfImageXObject image)
PdfImageXObject
.
image
- is an image as PdfImageXObject
public BitmapImagePixels(int width, int height, int bitsPerComponent, int numberOfComponents, byte[] data)
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
public double[] getPixel(int x, int y)
x
- is an x-coordinate of a pixel to update
y
- is a y-coordinate of a pixel to update
public long[] getPixelAsLongs(int x, int y)
x
- is an x-coordinate of a pixel to update
y
- is a y-coordinate of a pixel to update
public void setPixel(int x, int y, double[] value)
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.] (otherwise negative value will be replaced with 0. and large numbers are replaced with 1.)
public void setPixel(int x, int y, long[] value)
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.)
public int getWidth()
public int getHeight()
public int getBitsPerComponent()
public int getNumberOfComponents()
public byte[] getData()
public int getMaxComponentValue()
Copyright © 1998–2022 iText Group NV. All rights reserved.