public class Bitmap
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
swigCMemOwn |
Constructor and Description |
---|
Bitmap(long cPtr,
boolean cMemoryOwn) |
Bitmap(UnsignedCharVector pixelData,
long width,
long height,
ColorFormat colorFormat,
int bytesPerRow,
boolean pow2Padding)
Constructs a bitmap from an already decoded vector of bytes.
|
Modifier and Type | Method and Description |
---|---|
UnsignedCharVector |
compressToInternal()
Compresses this bitmap to a internal format.
This operation is intended for serialization of the data only, no actual compression is performed. |
UnsignedCharVector |
compressToPng()
Compresses this bitmap to a png.
|
static Bitmap |
createFromCompressed(UnsignedCharVector compressedData,
boolean pow2Padding)
Creates a new bitmap from compressed byte vector.
If the power of two conversion flag is set, additional padding will be added to the image to make it's dimensions power of two. |
void |
delete() |
boolean |
equals(java.lang.Object obj)
Checks if this object is equal to the specified object.
|
protected void |
finalize() |
long |
getBytesPerPixel()
Returns the bytes per pixel parameter of this bitmap.
|
ColorFormat |
getColorFormat()
Returns the color format of this bitmap.
|
static long |
getCPtr(Bitmap obj) |
long |
getHeight()
Returns the height of the bitmap.
|
long |
getOrigHeight()
Returns the unpadded height of this bitmap.
|
long |
getOrigWidth()
Returns the unpadded width of this bitmap.
|
UnsignedCharVector |
getPixelDataCopy()
Returns a copy of the pixel data of this bitmap.
|
Bitmap |
getResizedBitmap(long width,
long height,
boolean pow2Padding)
Returns resized version of the bitmap.
|
Bitmap |
getRGBABitmap(boolean pow2Padding)
Returns copy of the bitmap converted to RGBA format.
|
Bitmap |
getSubBitmap(int xOffset,
int yOffset,
int width,
int height,
boolean pow2Padding)
Returns sub-bitmap with specified offsets and dimensions.
|
Bitmap |
getUnpaddedBitmap()
Returns copy of the bitmap with padding removed.
|
long |
getWidth()
Returns the width of the bitmap.
|
int |
hashCode()
Returns the hash value of this object.
|
public Bitmap(long cPtr, boolean cMemoryOwn)
public Bitmap(UnsignedCharVector pixelData, long width, long height, ColorFormat colorFormat, int bytesPerRow, boolean pow2Padding)
pixelData
- A vector of decoded, premultiplied bitmap bytes.width
- The width of the bitmap.height
- The height of the bitmap.colorFormat
- The color format of the bitmap.bytesPerRow
- The total number of bytes per row. Some bitmaps have additional padding at the end of each row. If the value is negative, then bitmap is assumed to be vertically flipped. In this case absolute value of the bytesPerRow value is used.pow2Padding
- The power of two conversion flag.public static long getCPtr(Bitmap obj)
protected void finalize()
finalize
in class java.lang.Object
public void delete()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public long getWidth()
public long getHeight()
public long getOrigWidth()
public long getOrigHeight()
public ColorFormat getColorFormat()
public long getBytesPerPixel()
public UnsignedCharVector getPixelDataCopy()
public UnsignedCharVector compressToPng()
public UnsignedCharVector compressToInternal()
public Bitmap getResizedBitmap(long width, long height, boolean pow2Padding)
width
- The new width of this bitmap.height
- The new height of this bitmap.pow2Padding
- The power of two conversion flag.public Bitmap getSubBitmap(int xOffset, int yOffset, int width, int height, boolean pow2Padding)
xOffset
- X coordinate offset in the bitmap.yOffset
- Y coordinate offset in the bitmap.width
- Width of the sub-bitmap.height
- Height of the sub-bitmap.pow2Padding
- The power of two conversion flag.public Bitmap getRGBABitmap(boolean pow2Padding)
pow2Padding
- The power of two conversion flag.public Bitmap getUnpaddedBitmap()
public static Bitmap createFromCompressed(UnsignedCharVector compressedData, boolean pow2Padding)
compressedData
- The compressed bitmap data.pow2Padding
- The power of two conversion flag.