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(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 imageheight - is a height of the imagebitsPerComponent - is an amount of bits representing each color component of a pixelnumberOfComponents - is a number of components representing a pixelpublic BitmapImagePixels(PdfImageXObject image)
PdfImageXObject.image - is an image as PdfImageXObjectpublic BitmapImagePixels(int width,
int height,
int bitsPerComponent,
int numberOfComponents,
byte[] data)
width - is a width of the imageheight - is a height of the imagebitsPerComponent - is an amount of bits representing each color component of a pixelnumberOfComponents - is a number of components representing a pixeldata - is an image datapublic double[] getPixel(int x,
int y)
x - is an x-coordinate of a pixel to updatey - is a y-coordinate of a pixel to updatepublic long[] getPixelAsLongs(int x,
int y)
x - is an x-coordinate of a pixel to updatey - is a y-coordinate of a pixel to updatepublic void setPixel(int x,
int y,
double[] value)
x - is an x-coordinate of a pixel to updatey - is a y-coordinate of a pixel to updatevalue - 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 updatey - is a y-coordinate of a pixel to updatevalue - 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–2025 Apryse Group NV. All rights reserved.