Bitmap
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
Declared inandroid/bitmap.h
Anonymous Enum 21
Anonymous Enum 22
Declared inandroid/bitmap.h
Anonymous Enum 22
Bitmap alpha format.
Anonymous Enum 23
Declared inandroid/bitmap.h
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
Declared inandroid/bitmap.h
AndroidBitmapCompressFormat
Specifies the formats that can be compressed to with AndroidBitmap_compress.
AndroidBitmapFormat
Declared inandroid/bitmap.h
AndroidBitmapFormat
Bitmap pixel format.
Typedefs
AHardwareBuffer
Declared inandroid/bitmap.h
struct AHardwareBuffer AHardwareBuffer
AndroidBitmap_CompressWriteFunc
Declared inandroid/bitmap.h
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
Declared inandroid/bitmap.h
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
Declared inandroid/bitmap.h
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
Declared inandroid/bitmap.h
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
Declared inandroid/bitmap.h
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
Declared inandroid/bitmap.h
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
Declared inandroid/bitmap.h
int AndroidBitmap_unlockPixels( JNIEnv *env, jobject jbitmap )
Call this to balance a successful call to AndroidBitmap_lockPixels.