bitmap

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package bitmap provides Go bindings for Android Bitmap (jnigraphics).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInfo

func GetInfo(env *JNIEnv, jbitmap Jobject, info *AndroidBitmapInfo) int32

GetInfo calls the underlying C function.

func LockPixels

func LockPixels(env *JNIEnv, jbitmap Jobject, addrPtr *unsafe.Pointer) int32

LockPixels calls the underlying C function.

func UnlockPixels

func UnlockPixels(env *JNIEnv, jbitmap Jobject) int32

UnlockPixels calls the underlying C function.

Types

type AndroidBitmapCompressFormat

type AndroidBitmapCompressFormat int32
const (
	ANDROID_BITMAP_COMPRESS_FORMAT_JPEG          AndroidBitmapCompressFormat = 0
	ANDROID_BITMAP_COMPRESS_FORMAT_PNG           AndroidBitmapCompressFormat = 1
	ANDROID_BITMAP_COMPRESS_FORMAT_WEBP_LOSSY    AndroidBitmapCompressFormat = 3
	ANDROID_BITMAP_COMPRESS_FORMAT_WEBP_LOSSLESS AndroidBitmapCompressFormat = 4
)

type AndroidBitmapInfo

type AndroidBitmapInfo struct {
	// contains filtered or unexported fields
}

AndroidBitmapInfo wraps the NDK AndroidBitmapInfo handle.

func NewAndroidBitmapInfoFromPointer

func NewAndroidBitmapInfoFromPointer(ptr unsafe.Pointer) *AndroidBitmapInfo

NewAndroidBitmapInfoFromPointer wraps a raw AndroidBitmapInfo pointer.

func (*AndroidBitmapInfo) Pointer

func (h *AndroidBitmapInfo) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type AndroidBitmap_CompressWriteFunc

type AndroidBitmap_CompressWriteFunc = capi.AndroidBitmap_CompressWriteFunc

type Error

type Error int32

Error represents an NDK error code.

const (
	ErrBadParameter     Error = -1
	ErrJniException     Error = -2
	ErrAllocationFailed Error = -3
)

func (Error) Error

func (e Error) Error() string

type Format

type Format int32
const (
	None        Format = 0
	Rgba8888    Format = 1
	Rgb565      Format = 4
	Rgba4444    Format = 7
	A8          Format = 8
	RgbaF16     Format = 9
	Rgba1010102 Format = 10
)

type HardwareBuffer

type HardwareBuffer struct {
	// contains filtered or unexported fields
}

HardwareBuffer wraps the NDK AHardwareBuffer handle.

func NewHardwareBufferFromPointer

func NewHardwareBufferFromPointer(ptr unsafe.Pointer) *HardwareBuffer

NewHardwareBufferFromPointer wraps a raw AHardwareBuffer pointer.

func (*HardwareBuffer) Pointer

func (h *HardwareBuffer) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type JNIEnv

type JNIEnv = capi.JNIEnv

type Jobject

type Jobject = capi.Jobject

type NDROID_BITMAP_FLAGS

type NDROID_BITMAP_FLAGS int32
const (
	ANDROID_BITMAP_FLAGS_IS_HARDWARE NDROID_BITMAP_FLAGS = -2147483648
)

type NDROID_BITMAP_FLAGS_ALPHA

type NDROID_BITMAP_FLAGS_ALPHA int32
const (
	ANDROID_BITMAP_FLAGS_ALPHA_PREMUL   NDROID_BITMAP_FLAGS_ALPHA = 0
	ANDROID_BITMAP_FLAGS_ALPHA_OPAQUE   NDROID_BITMAP_FLAGS_ALPHA = 1
	ANDROID_BITMAP_FLAGS_ALPHA_UNPREMUL NDROID_BITMAP_FLAGS_ALPHA = 2
	ANDROID_BITMAP_FLAGS_ALPHA_MASK     NDROID_BITMAP_FLAGS_ALPHA = 3
	ANDROID_BITMAP_FLAGS_ALPHA_SHIFT    NDROID_BITMAP_FLAGS_ALPHA = 0
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL