Class ImageDecoder

Definition

Namespace:
Tizen.Multimedia.Util
Assembly:
Tizen.Multimedia.Util.dll
API Level:
4

This is a base class for image decoders.

C#
Copy
public abstract class ImageDecoder : IDisposable
Inheritance
System.Object
ImageDecoder
Derived
Implements
System.IDisposable

Properties

View Source

InputFormat

Gets the image format of this decoder.

Declaration
C#
Copy
public ImageFormat InputFormat { get; }
Property Value
Type Description
ImageFormat
API Level: 4

Methods

View Source

DecodeAsync(Byte[])

Decodes an image from the buffer.

Declaration
C#
Copy
public Task<IEnumerable<BitmapFrame>> DecodeAsync(byte[] inputBuffer)
Parameters
Type Name Description
System.Byte[] inputBuffer

The image buffer from which to decode.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<BitmapFrame>>

A task that represents the asynchronous decoding operation.

Remarks

Only Graphics Interchange Format(GIF) codec returns more than one frame.

Exceptions
Type Condition
System.ArgumentNullException

inputBuffer is null.

System.ArgumentException

inputBuffer is an empty array.

FileFormatException

The format of inputBuffer is not InputFormat.

ObjectDisposedException

The ImageDecoder has already been disposed of.

API Level: 4
View Source

DecodeAsync(String)

Decodes an image from the specified file.

Declaration
C#
Copy
public Task<IEnumerable<BitmapFrame>> DecodeAsync(string inputFilePath)
Parameters
Type Name Description
System.String inputFilePath

The input file path from which to decode.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<BitmapFrame>>

A task that represents the asynchronous decoding operation.

Remarks

Only Graphics Interchange Format(GIF) codec returns more than one frame.

http://tizen.org/privilege/mediastorage is needed if inputFilePath is relevant to the media storage.
http://tizen.org/privilege/externalstorage is needed if inputFilePath is relevant to the external storage.

Exceptions
Type Condition
System.ArgumentNullException

inputFilePath is null.

System.ArgumentException

inputFilePath is an empty string.
-or-
inputFilePath is not a image file.

System.IO.FileNotFoundException

inputFilePath does not exists.

UnauthorizedAccessException

The caller does not have required permission to access the path.

FileFormatException

The format of inputFilePath is not InputFormat.

ObjectDisposedException

The ImageDecoder has already been disposed of.

API Level: 4
View Source

Dispose()

Releases all resources used by the ImageDecoder.

Declaration
C#
Copy
public void Dispose()
API Level: 4
View Source

Dispose(Boolean)

Releases the unmanaged resources used by the ImageDecoder.

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

true to release both managed and unmanaged resources; false to release only unmanaged resources.

API Level: 4
View Source

SetColorSpace(ColorSpace)

Sets the color-space to decode into. The default is Rgba8888.

Declaration
C#
Copy
public void SetColorSpace(ColorSpace colorSpace)
Parameters
Type Name Description
ColorSpace colorSpace

The value indicating color-space to decode into.

Exceptions
Type Condition
System.ArgumentException

colorSpace is invalid.

System.NotSupportedException

colorSpace is not supported by the decoder.

API Level: 4

Implements

System.IDisposable