Bitmap wrapper.
More...
|
| | Bitmap (Context context, android.graphics.Bitmap bitmap) throws BadPixelFormat |
| | Creates new bitmap from Android bitmap object. More...
|
| |
| synchronized void | dispose () |
| | Destroys the native object. More...
|
| |
Bitmap wrapper.
Definition at line 32 of file Bitmap.java.
◆ Bitmap() [1/2]
Creates new bitmap from Android bitmap object.
NO PIXEL DATA IS COPIED.
- Parameters
-
| context | Beatmup context |
| bitmap | source bitmap |
- Exceptions
-
Definition at line 71 of file Bitmap.java.
72 super(createNativeBitmapEnsuringPixelFormat(context, bitmap));
73 this.context = context;
void watchBitmap(Bitmap bitmap)
Adds a bitmap to the watch list.
◆ Bitmap() [2/2]
Creates new internally managed bitmap.
- Parameters
-
| context | Beatmup context |
| width | bitmap width in pixels |
| height | bitmap height in pixels |
| pixelFormat | bitmap pixel format |
Definition at line 85 of file Bitmap.java.
86 super(newInternalBitmap(context, width, height, pixelFormat.ordinal()));
87 this.context = context;
◆ createEmpty()
Creates an empty bitmap of the same size and pixel format as a given bitmap.
- Parameters
-
| bitmap | the bitmap specifying size and pixel format |
- Returns
- the new bitmap
Definition at line 113 of file Bitmap.java.
114 return new Bitmap(bitmap.context, bitmap.getWidth(), bitmap.getHeight(), bitmap.getPixelFormat());
◆ getWidth()
| int Beatmup.Bitmap.getWidth |
( |
| ) |
|
|
inline |
- Returns
- bitmap width in pixels
Definition at line 121 of file Bitmap.java.
long handle
pointer to the native object
◆ getHeight()
| int Beatmup.Bitmap.getHeight |
( |
| ) |
|
|
inline |
- Returns
- bitmap height in pixels
Definition at line 129 of file Bitmap.java.
◆ clientRectangle()
- Returns
- bitmap border rectangle in pixels
Definition at line 137 of file Bitmap.java.
◆ getPixelFormat()
- Returns
- bitmap pixel format
Definition at line 145 of file Bitmap.java.
PixelFormat getPixelFormat()
◆ zero()
| void Beatmup.Bitmap.zero |
( |
| ) |
|
|
inline |
Sets all bitmap pixels to zero.
Definition at line 153 of file Bitmap.java.
void zero()
Sets all bitmap pixels to zero.
◆ clone() [1/2]
| Bitmap Beatmup.Bitmap.clone |
( |
| ) |
|
|
inline |
◆ clone() [2/2]
- Returns
- copy of this bitmap with a different pixel format
Definition at line 174 of file Bitmap.java.
175 return context.copyBitmap(
this, pixelFormat);
◆ copyRegion()
Creates a bitmap containing a copy of a rectangular region.
- Parameters
-
- Returns
- the new bitmap
Definition at line 184 of file Bitmap.java.
185 Bitmap copy = Bitmap.createByteAligned(context, region.getWidth(), region.getHeight(),
getPixelFormat());
186 if (copy.getWidth() != region.getWidth())
188 crop(
handle, copy.handle, region.x1, region.y1, region.x2, region.y2, 0, 0);
◆ projectOn()
| void Beatmup.Bitmap.projectOn |
( |
Bitmap |
bitmap, |
|
|
int |
left, |
|
|
int |
top |
|
) |
| |
|
inline |
Copies a rectangular area to another bitmap.
The area size is equal to the target bitmap size.
- Parameters
-
| bitmap | the target bitmap |
| left | source area top-left corner horizontal position in pixels |
| top | source area top-left corner vertical position in pixels |
Definition at line 198 of file Bitmap.java.
199 crop(
handle, bitmap.handle, left, top, left+bitmap.getWidth(), top+bitmap.getHeight(), 0, 0);
◆ invert()
| void Beatmup.Bitmap.invert |
( |
| ) |
|
|
inline |
Pixelwise bitmap inversion.
Definition at line 205 of file Bitmap.java.
void invert()
Pixelwise bitmap inversion.
◆ pullPixels()
| void Beatmup.Bitmap.pullPixels |
( |
| ) |
|
|
inline |
Transfers pixel data from GPU to CPU.
Definition at line 212 of file Bitmap.java.
void pullPixels()
Transfers pixel data from GPU to CPU.
The documentation for this class was generated from the following file: