Class ImageUtil

Definition

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

Provides utilities for images.

C#
Copy
public static class ImageUtil
Inheritance
System.Object
ImageUtil

Methods

View Source

CalculateBufferSize(Size, ColorSpace)

Calculates the size of the image buffer for the specified resolution and color-space.

Declaration
C#
Copy
[Obsolete("Please do not use! This will be deprecated in level 6.")] public static int CalculateBufferSize(Size resolution, ColorSpace colorSpace)
Parameters
Type Name Description
Size resolution

The resolution of the image.

ColorSpace colorSpace

ColorSpace of the image.

Returns
Type Description
System.Int32

The buffer size.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

width of resolution is less than or equal to zero.
-or-
height of resolution is less than or equal to zero.

System.ArgumentException

colorSpace is invalid.

API Level: 4
View Source

GetColor(Byte[], Size)

Extracts representative color from an image buffer.

Declaration
C#
Copy
public static Color GetColor(byte[] buffer, Size size)
Parameters
Type Name Description
Byte[] buffer

Raw image buffer.

Size size

Resolution of the image.

Returns
Type Description
Color

The representative color of the image.

Remarks

The image should be Rgb888.

Exceptions
Type Condition
System.ArgumentNullException

buffer is null.

System.ArgumentException

buffer is empty.

System.ArgumentOutOfRangeException

width of size is less than or equal to zero.
-or-
height of size is less than or equal to zero.

API Level: 4
View Source

GetSupportedColorSpaces(ImageFormat)

Retrieves supported colorspaces for a ImageFormat that represents formats for ImageEncoder and ImageDecoder.

Declaration
C#
Copy
public static IEnumerable<ColorSpace> GetSupportedColorSpaces(ImageFormat format)
Parameters
Type Name Description
ImageFormat format

The ImageFormat.

Returns
Type Description
System.Collections.Generic.IEnumerable<ColorSpace>

An IEnumerable of ColorSpace representing the supported color-spaces.

Exceptions
Type Condition
System.ArgumentException

format is invalid.

API Level: 4