z

Class MetaImage

Managed facade over SDK meta images that own a native handle and expose EXIF, bitmap, and rendering metadata. Use the provided factory helpers to create instances and always dispose when you finish with the native buffer.

public class MetaImage : IDisposable, IEquatable<MetaImage>

Constructor

MetaImage()

Creates an empty meta image without an associated bitmap. Use Bitmap or SetInstance(nint) to populate later.

public MetaImage()

MetaImage(MetaImage)

Creates a deep copy of the provided meta image by duplicating the native instance.

public MetaImage(MetaImage source)

MetaImage(object)

Creates a meta image backed by the provided platform bitmap.

public MetaImage(object bitmap)

MetaImage(object, object, string)

Creates a meta image from a bitmap using platform-specific context and metadata path (Android overload).

public MetaImage(object bitmap, object AndroidContext, string metadataUri)

MetaImage(object, string)

Creates a meta image from a bitmap and optionally loads EXIF metadata from the supplied URI.

public MetaImage(object bitmap, string metadataUri)

Field

Color1Bit

Constant representing a one-bit colour hint.

public const int Color1Bit = 1

ColorMono

Constant representing a monochrome colour hint.

public const int ColorMono = 2

ColorRgba

Constant representing an RGBA colour hint.

public const int ColorRgba = 3

ColorUndefined

Constant representing an undefined colour hint.

public const int ColorUndefined = 0

ExifFlipHorizontal

EXIF orientation value indicating horizontal flip.

public const int ExifFlipHorizontal = 2

ExifFlipVertical

EXIF orientation value indicating vertical flip.

public const int ExifFlipVertical = 4

ExifInvalid

EXIF orientation value indicating invalid orientation.

public const int ExifInvalid = -1

ExifNormal

EXIF orientation value indicating normal orientation.

public const int ExifNormal = 1

ExifRotate180

EXIF orientation value indicating 180-degree rotation.

public const int ExifRotate180 = 3

ExifRotate270

EXIF orientation value indicating 270-degree rotation.

public const int ExifRotate270 = 8

ExifRotate90

EXIF orientation value indicating 90-degree rotation.

public const int ExifRotate90 = 6

ExifTranspose

EXIF orientation value indicating transpose.

public const int ExifTranspose = 5

ExifTransverse

EXIF orientation value indicating transverse orientation.

public const int ExifTransverse = 7

ExifUndefined

EXIF orientation value indicating undefined orientation.

public const int ExifUndefined = 0

_Instance

Backing field for the native meta image handle.

protected nint _Instance

Method

Dispose()

Releases the native handle and associated buffers. Multiple invocations are safe.

public void Dispose()

EnsureBitmapMutable()

Legacy helper retained for API compatibility; no longer required.

[Obsolete("Deprecated")]
public void EnsureBitmapMutable()

Equals(MetaImage)

Determines whether the current instance references the same native handle as another meta image.

public bool Equals(MetaImage other)

FromStream(Stream, string)

Creates a meta image by reading encoded data from the provided stream and optional metadata cache.

public static MetaImage FromStream(Stream stream, string metaDataPath = "")

GetBitmap()

Converts the internal representation to a platform bitmap owned by the caller.

public object GetBitmap()

RecycleBitmap()

Releases the bitmap buffer and disposes the current instance, mirroring the behaviour of the Java implementation.

public void RecycleBitmap()

SafeGetBitmap(MetaImage)

Safely converts the provided meta image to a bitmap, returning null when the instance is absent.

public static object SafeGetBitmap(MetaImage img)

SafeRecycleBitmap(MetaImage, MetaImage)

Disposes the given source only if it does not reference the same native handle as origin.

public static void SafeRecycleBitmap(MetaImage source, MetaImage origin)

SetInstance(nint)

Replaces the current native handle with the provided one, disposing any existing handle first.

public void SetInstance(nint h)

ToStream()

Serialises the current bitmap to an encoded stream understood by the SDK.

public Stream ToStream()

Property

Bitmap

Gets or sets the backing bitmap via the platform helper.

public object Bitmap { get; set; }

BitmapBounds

Gets the bitmap bounds reported by the native handle.

public PxlPoint BitmapBounds { get; }

ColorHint

Gets or sets the color hint used for subsequent processing of the image buffer.

public MetaImage.EColorHint ColorHint { get; set; }

Device

Gets or sets the originating device class.

public MetaImage.EDevicePlatform Device { get; set; }

ExifOrientation

Gets or sets the EXIF orientation applied to the image.

public MetaImage.EOrienation ExifOrientation { get; set; }

Flash

Gets or sets the flash state recorded for the capture.

public MetaImage.FlashMode Flash { get; set; }

Handle

Gets the native handle used by the underlying SDK. Consumers should treat the pointer as opaque.

public nint Handle { get; }

Iso

Gets or sets the ISO metadata associated with the capture.

public int Iso { get; set; }

MetadataUri

Gets or sets the optional URI pointing to metadata associated with the image on disk.

public string MetadataUri { get; set; }

PageNumber

Gets or sets the logical page number associated with the image.

public int PageNumber { get; set; }

StrongShadows

Gets or sets whether the image contains strong shadows that influence processing presets.

public bool StrongShadows { get; set; }
Top