Bitmap
#include <bitmap.h>
Summary
Typedefs |
|
---|---|
AHardwareBuffer
|
typedefstruct AHardwareBuffer
|
AndroidBitmap_CompressWriteFunc)(void *userContext, const void *data, size_t size)
|
typedefbool(*
User-defined function for writing the output of compression. |
Functions |
|
---|---|
AndroidBitmap_compress(const AndroidBitmapInfo *info, int32_t dataspace, const void *pixels, int32_t format, int32_t quality, void *userContext, AndroidBitmap_CompressWriteFunc fn)
|
int
Compress
pixels as described by info . |
AndroidBitmap_getDataSpace(JNIEnv *env, jobject jbitmap)
|
int32_t
Given a java bitmap object, return its ADataSpace.
|
AndroidBitmap_getHardwareBuffer(JNIEnv *env, jobject bitmap, AHardwareBuffer **outBuffer)
|
int
Retrieve the native object associated with a HARDWARE Bitmap.
|
AndroidBitmap_getInfo(JNIEnv *env, jobject jbitmap, AndroidBitmapInfo *info)
|
int
Given a java bitmap object, fill out the AndroidBitmapInfo struct for it.
|
AndroidBitmap_lockPixels(JNIEnv *env, jobject jbitmap, void **addrPtr)
|
int
Given a java bitmap object, attempt to lock the pixel address.
|
AndroidBitmap_unlockPixels(JNIEnv *env, jobject jbitmap)
|
int
Call this to balance a successful call to AndroidBitmap_lockPixels.
|
Structs |
|
---|---|
AndroidBitmapInfo |
Bitmap info, see AndroidBitmap_getInfo(). |
Enumerations
Anonymous Enum 21
Anonymous Enum 21
Anonymous Enum 22
Anonymous Enum 22
Bitmap alpha format.
Anonymous Enum 23
Anonymous Enum 23
Properties | |
---|---|
ANDROID_BITMAP_FLAGS_IS_HARDWARE
|
If this bit is set in AndroidBitmapInfo.flags, the Bitmap uses the HARDWARE Config, and its AHardwareBuffer can be retrieved via AndroidBitmap_getHardwareBuffer. |
AndroidBitmapCompressFormat
AndroidBitmapCompressFormat
Specifies the formats that can be compressed to with AndroidBitmap_compress.
AndroidBitmapFormat
AndroidBitmapFormat
Bitmap pixel format.
Typedefs
AHardwareBuffer
struct AHardwareBuffer AHardwareBuffer
AndroidBitmap_CompressWriteFunc
bool(* AndroidBitmap_CompressWriteFunc)(void *userContext, const void *data, size_t size)
User-defined function for writing the output of compression.
Available since API level 30.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
Whether the operation succeeded.
|
Functions
AndroidBitmap_compress
int AndroidBitmap_compress( const AndroidBitmapInfo *info, int32_t dataspace, const void *pixels, int32_t format, int32_t quality, void *userContext, AndroidBitmap_CompressWriteFunc fn )
Compress pixels
as described by info
.
Available since API level 30.
Details | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||||
Returns |
AndroidBitmap functions result code.
|
AndroidBitmap_getDataSpace
int32_t AndroidBitmap_getDataSpace( JNIEnv *env, jobject jbitmap )
Given a java bitmap object, return its ADataSpace.
Note that ADataSpace only exposes a few values. This may return ADATASPACE_UNKNOWN, even for Named ColorSpaces, if they have no corresponding ADataSpace.
Available since API level 30.
AndroidBitmap_getHardwareBuffer
int AndroidBitmap_getHardwareBuffer( JNIEnv *env, jobject bitmap, AHardwareBuffer **outBuffer )
Retrieve the native object associated with a HARDWARE Bitmap.
Client must not modify it while a Bitmap is wrapping it.
Available since API level 30.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
AndroidBitmap functions result code. ANDROID_BITMAP_RESULT_BAD_PARAMETER if bitmap is not a HARDWARE Bitmap.
|
AndroidBitmap_getInfo
int AndroidBitmap_getInfo( JNIEnv *env, jobject jbitmap, AndroidBitmapInfo *info )
Given a java bitmap object, fill out the AndroidBitmapInfo struct for it.
If the call fails, the info parameter will be ignored.
AndroidBitmap_lockPixels
int AndroidBitmap_lockPixels( JNIEnv *env, jobject jbitmap, void **addrPtr )
Given a java bitmap object, attempt to lock the pixel address.
Locking will ensure that the memory for the pixels will not move until the unlockPixels call, and ensure that, if the pixels had been previously purged, they will have been restored.
If this call succeeds, it must be balanced by a call to AndroidBitmap_unlockPixels, after which time the address of the pixels should no longer be used.
If this succeeds, *addrPtr will be set to the pixel address. If the call fails, addrPtr will be ignored.
AndroidBitmap_unlockPixels
int AndroidBitmap_unlockPixels( JNIEnv *env, jobject jbitmap )
Call this to balance a successful call to AndroidBitmap_lockPixels.