image

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 image provides Go bindings for Android ImageDecoder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AImageDecoder_resultToString

func AImageDecoder_resultToString(arg0 int32) string

AImageDecoder_resultToString calls the underlying C function.

Types

type ARect

type ARect = capi.ARect

type ASSET_MODE

type ASSET_MODE int32
const (
	AASSET_MODE_UNKNOWN   ASSET_MODE = 0
	AASSET_MODE_RANDOM    ASSET_MODE = 1
	AASSET_MODE_STREAMING ASSET_MODE = 2
	AASSET_MODE_BUFFER    ASSET_MODE = 3
)

type Asset

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

Asset wraps the NDK AAsset handle.

func NewAssetFromPointer

func NewAssetFromPointer(ptr unsafe.Pointer) *Asset

NewAssetFromPointer wraps a raw AAsset pointer.

func (*Asset) Close

func (h *Asset) Close() error

Close releases the underlying NDK handle.

func (*Asset) GetBuffer

func (h *Asset) GetBuffer() unsafe.Pointer

GetBuffer returns the value directly.

func (*Asset) IsAllocated

func (h *Asset) IsAllocated() error

IsAllocated calls the underlying NDK function.

func (*Asset) OpenFileDescriptor

func (h *Asset) OpenFileDescriptor(outStart *Off_t, outLength *Off_t) error

OpenFileDescriptor calls the underlying NDK function.

func (*Asset) OpenFileDescriptor64

func (h *Asset) OpenFileDescriptor64(outStart *Off64_t, outLength *Off64_t) error

OpenFileDescriptor64 calls the underlying NDK function.

func (*Asset) Pointer

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

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Asset) Read

func (h *Asset) Read(buf unsafe.Pointer, count uint64) error

Read calls the underlying NDK function.

type AssetDir

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

AssetDir wraps the NDK AAssetDir handle.

func NewAssetDirFromPointer

func NewAssetDirFromPointer(ptr unsafe.Pointer) *AssetDir

NewAssetDirFromPointer wraps a raw AAssetDir pointer.

func (*AssetDir) Close

func (h *AssetDir) Close() error

Close releases the underlying NDK handle.

func (*AssetDir) GetNextFileName

func (h *AssetDir) GetNextFileName() string

GetNextFileName returns the value directly.

func (*AssetDir) Pointer

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

Pointer returns the underlying pointer as unsafe.Pointer.

func (*AssetDir) Rewind

func (h *AssetDir) Rewind()

Rewind calls the underlying NDK function.

type AssetManager

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

AssetManager wraps the NDK AAssetManager handle.

func NewAssetManagerFromPointer

func NewAssetManagerFromPointer(ptr unsafe.Pointer) *AssetManager

NewAssetManagerFromPointer wraps a raw AAssetManager pointer.

func (*AssetManager) Open

func (h *AssetManager) Open(filename string, mode int32) *Asset

Open creates a new Asset from this AssetManager.

func (*AssetManager) OpenDir

func (h *AssetManager) OpenDir(dirName string) *AssetDir

OpenDir creates a new AssetDir from this AssetManager.

func (*AssetManager) Pointer

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

Pointer returns the underlying pointer as unsafe.Pointer.

type Decoder

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

Decoder wraps the NDK AImageDecoder handle.

func NewDecoderFromFd

func NewDecoderFromFd(fd int32) (*Decoder, error)

NewDecoderFromFd calls the underlying C function.

func NewDecoderFromPointer

func NewDecoderFromPointer(ptr unsafe.Pointer) *Decoder

NewDecoderFromPointer wraps a raw AImageDecoder pointer.

func (*Decoder) AdvanceFrame

func (h *Decoder) AdvanceFrame() error

AdvanceFrame calls the underlying NDK function.

func (*Decoder) Close

func (h *Decoder) Close() error

Close releases the underlying NDK handle.

func (*Decoder) ComputeSampledSize

func (h *Decoder) ComputeSampledSize(sampleSize int32, width *int32, height *int32) error

ComputeSampledSize calls the underlying NDK function.

func (*Decoder) Decode

func (h *Decoder) Decode(pixels unsafe.Pointer, stride uint64, size uint64) error

Decode calls the underlying NDK function.

func (*Decoder) GetFrameInfo

func (h *Decoder) GetFrameInfo(info *ImageDecoderFrameInfo) error

GetFrameInfo calls the underlying NDK function.

func (*Decoder) GetRepeatCount

func (h *Decoder) GetRepeatCount() error

GetRepeatCount calls the underlying NDK function.

func (*Decoder) HeaderInfo

func (h *Decoder) HeaderInfo() *HeaderInfo

HeaderInfo creates a new HeaderInfo from this Decoder.

func (*Decoder) IsAnimated

func (h *Decoder) IsAnimated() bool

IsAnimated returns the value directly.

func (*Decoder) MinimumStride

func (h *Decoder) MinimumStride() uint64

MinimumStride returns the value directly.

func (*Decoder) Pointer

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

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Decoder) Rewind

func (h *Decoder) Rewind() error

Rewind calls the underlying NDK function.

func (*Decoder) SetAndroidBitmapFormat

func (h *Decoder) SetAndroidBitmapFormat(format int32) error

SetAndroidBitmapFormat calls the underlying NDK function.

func (*Decoder) SetDataSpace

func (h *Decoder) SetDataSpace(dataspace int32) error

SetDataSpace calls the underlying NDK function.

func (*Decoder) SetInternallyHandleDisposePrevious

func (h *Decoder) SetInternallyHandleDisposePrevious(handleInternally bool)

SetInternallyHandleDisposePrevious calls the underlying NDK function.

func (*Decoder) SetTargetSize

func (h *Decoder) SetTargetSize(width int32, height int32) error

SetTargetSize calls the underlying NDK function.

func (*Decoder) SetUnpremultipliedRequired

func (h *Decoder) SetUnpremultipliedRequired(unpremultipliedRequired bool) error

SetUnpremultipliedRequired calls the underlying NDK function.

type Error

type Error int32

Error represents an NDK error code.

const (
	ErrIncomplete        Error = -1
	ErrError             Error = -2
	ErrInvalidConversion Error = -3
	ErrInvalidScale      Error = -4
	ErrBadParameter      Error = -5
	ErrInvalidInput      Error = -6
	ErrSeekError         Error = -7
	ErrInternalError     Error = -8
	ErrUnsupportedFormat Error = -9
	ErrFinished          Error = -10
	ErrInvalidState      Error = -11
)

func (Error) Error

func (e Error) Error() string

type HeaderInfo

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

HeaderInfo wraps the NDK AImageDecoderHeaderInfo handle.

func NewHeaderInfoFromPointer

func NewHeaderInfoFromPointer(ptr unsafe.Pointer) *HeaderInfo

NewHeaderInfoFromPointer wraps a raw AImageDecoderHeaderInfo pointer.

func (*HeaderInfo) GetAlphaFlags

func (h *HeaderInfo) GetAlphaFlags() error

GetAlphaFlags calls the underlying NDK function.

func (*HeaderInfo) GetAndroidBitmapFormat

func (h *HeaderInfo) GetAndroidBitmapFormat() error

GetAndroidBitmapFormat calls the underlying NDK function.

func (*HeaderInfo) GetDataSpace

func (h *HeaderInfo) GetDataSpace() error

GetDataSpace calls the underlying NDK function.

func (*HeaderInfo) Height

func (h *HeaderInfo) Height() int32

Height returns the value directly.

func (*HeaderInfo) MimeType

func (h *HeaderInfo) MimeType() string

MimeType returns the value directly.

func (*HeaderInfo) Pointer

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

Pointer returns the underlying pointer as unsafe.Pointer.

func (*HeaderInfo) Width

func (h *HeaderInfo) Width() int32

Width returns the value directly.

type ImageDecoderFrameInfo

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

ImageDecoderFrameInfo wraps the NDK AImageDecoderFrameInfo handle.

func NewImageDecoderFrameInfo

func NewImageDecoderFrameInfo() *ImageDecoderFrameInfo

NewImageDecoderFrameInfo creates a new ImageDecoderFrameInfo.

func NewImageDecoderFrameInfoFromPointer

func NewImageDecoderFrameInfoFromPointer(ptr unsafe.Pointer) *ImageDecoderFrameInfo

NewImageDecoderFrameInfoFromPointer wraps a raw AImageDecoderFrameInfo pointer.

func (*ImageDecoderFrameInfo) Close

func (h *ImageDecoderFrameInfo) Close() error

Close releases the underlying NDK handle.

func (*ImageDecoderFrameInfo) GetBlendOp

func (h *ImageDecoderFrameInfo) GetBlendOp() error

GetBlendOp calls the underlying NDK function.

func (*ImageDecoderFrameInfo) GetDisposeOp

func (h *ImageDecoderFrameInfo) GetDisposeOp() error

GetDisposeOp calls the underlying NDK function.

func (*ImageDecoderFrameInfo) GetDuration

func (h *ImageDecoderFrameInfo) GetDuration() int64

GetDuration returns the value directly.

func (*ImageDecoderFrameInfo) HasAlphaWithinBounds

func (h *ImageDecoderFrameInfo) HasAlphaWithinBounds() bool

HasAlphaWithinBounds returns the value directly.

func (*ImageDecoderFrameInfo) Pointer

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

Pointer returns the underlying pointer as unsafe.Pointer.

type NDROID_IMAGE

type NDROID_IMAGE int32
const (
	ANDROID_IMAGE_DECODER_INFINITE NDROID_IMAGE = 2147483647
)

type NDROID_IMAGE_DECODER_BLEND_OP_SRC

type NDROID_IMAGE_DECODER_BLEND_OP_SRC int32
const (
	ANDROID_IMAGE_DECODER_BLEND_OP_SRC      NDROID_IMAGE_DECODER_BLEND_OP_SRC = 1
	ANDROID_IMAGE_DECODER_BLEND_OP_SRC_OVER NDROID_IMAGE_DECODER_BLEND_OP_SRC = 2
)

type NDROID_IMAGE_DECODER_DISPOSE_OP

type NDROID_IMAGE_DECODER_DISPOSE_OP int32
const (
	ANDROID_IMAGE_DECODER_DISPOSE_OP_NONE       NDROID_IMAGE_DECODER_DISPOSE_OP = 1
	ANDROID_IMAGE_DECODER_DISPOSE_OP_BACKGROUND NDROID_IMAGE_DECODER_DISPOSE_OP = 2
	ANDROID_IMAGE_DECODER_DISPOSE_OP_PREVIOUS   NDROID_IMAGE_DECODER_DISPOSE_OP = 3
)

type Off64_t

type Off64_t = capi.Off64_t

type Off_t

type Off_t = capi.Off_t

Jump to

Keyboard shortcuts

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