Documentation
¶
Overview ¶
Package image provides Go bindings for Android ImageDecoder.
Index ¶
- func AImageDecoder_resultToString(arg0 int32) string
- type ARect
- type ASSET_MODE
- type Asset
- func (h *Asset) Close() error
- func (h *Asset) GetBuffer() unsafe.Pointer
- func (h *Asset) IsAllocated() error
- func (h *Asset) OpenFileDescriptor(outStart *Off_t, outLength *Off_t) error
- func (h *Asset) OpenFileDescriptor64(outStart *Off64_t, outLength *Off64_t) error
- func (h *Asset) Pointer() unsafe.Pointer
- func (h *Asset) Read(buf unsafe.Pointer, count uint64) error
- type AssetDir
- type AssetManager
- type Decoder
- func (h *Decoder) AdvanceFrame() error
- func (h *Decoder) Close() error
- func (h *Decoder) ComputeSampledSize(sampleSize int32, width *int32, height *int32) error
- func (h *Decoder) Decode(pixels unsafe.Pointer, stride uint64, size uint64) error
- func (h *Decoder) GetFrameInfo(info *ImageDecoderFrameInfo) error
- func (h *Decoder) GetRepeatCount() error
- func (h *Decoder) HeaderInfo() *HeaderInfo
- func (h *Decoder) IsAnimated() bool
- func (h *Decoder) MinimumStride() uint64
- func (h *Decoder) Pointer() unsafe.Pointer
- func (h *Decoder) Rewind() error
- func (h *Decoder) SetAndroidBitmapFormat(format int32) error
- func (h *Decoder) SetDataSpace(dataspace int32) error
- func (h *Decoder) SetInternallyHandleDisposePrevious(handleInternally bool)
- func (h *Decoder) SetTargetSize(width int32, height int32) error
- func (h *Decoder) SetUnpremultipliedRequired(unpremultipliedRequired bool) error
- type Error
- type HeaderInfo
- type ImageDecoderFrameInfo
- func (h *ImageDecoderFrameInfo) Close() error
- func (h *ImageDecoderFrameInfo) GetBlendOp() error
- func (h *ImageDecoderFrameInfo) GetDisposeOp() error
- func (h *ImageDecoderFrameInfo) GetDuration() int64
- func (h *ImageDecoderFrameInfo) HasAlphaWithinBounds() bool
- func (h *ImageDecoderFrameInfo) Pointer() unsafe.Pointer
- type NDROID_IMAGE
- type NDROID_IMAGE_DECODER_BLEND_OP_SRC
- type NDROID_IMAGE_DECODER_DISPOSE_OP
- type Off64_t
- type Off_t
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AImageDecoder_resultToString ¶
AImageDecoder_resultToString calls the underlying C function.
Types ¶
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 ¶
NewAssetFromPointer wraps a raw AAsset pointer.
func (*Asset) IsAllocated ¶
IsAllocated calls the underlying NDK function.
func (*Asset) OpenFileDescriptor ¶
OpenFileDescriptor calls the underlying NDK function.
func (*Asset) OpenFileDescriptor64 ¶
OpenFileDescriptor64 calls the underlying NDK function.
type AssetDir ¶
type AssetDir struct {
// contains filtered or unexported fields
}
AssetDir wraps the NDK AAssetDir handle.
func NewAssetDirFromPointer ¶
NewAssetDirFromPointer wraps a raw AAssetDir pointer.
func (*AssetDir) GetNextFileName ¶
GetNextFileName returns the value directly.
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 ¶
NewDecoderFromFd calls the underlying C function.
func NewDecoderFromPointer ¶
NewDecoderFromPointer wraps a raw AImageDecoder pointer.
func (*Decoder) AdvanceFrame ¶
AdvanceFrame calls the underlying NDK function.
func (*Decoder) ComputeSampledSize ¶
ComputeSampledSize calls the underlying NDK function.
func (*Decoder) GetFrameInfo ¶
func (h *Decoder) GetFrameInfo(info *ImageDecoderFrameInfo) error
GetFrameInfo calls the underlying NDK function.
func (*Decoder) GetRepeatCount ¶
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 ¶
IsAnimated returns the value directly.
func (*Decoder) MinimumStride ¶
MinimumStride returns the value directly.
func (*Decoder) SetAndroidBitmapFormat ¶
SetAndroidBitmapFormat calls the underlying NDK function.
func (*Decoder) SetDataSpace ¶
SetDataSpace calls the underlying NDK function.
func (*Decoder) SetInternallyHandleDisposePrevious ¶
SetInternallyHandleDisposePrevious calls the underlying NDK function.
func (*Decoder) SetTargetSize ¶
SetTargetSize calls the underlying NDK function.
func (*Decoder) SetUnpremultipliedRequired ¶
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 )
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) 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.
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 )