Tizen Native API

Used for displaying native images. More...

Inheritance diagram for Dali::NativeImageSource:
Dali::NativeImageInterface Dali::RefObject

Public Types

enum  ColorDepth
 When creating a native image the color depth has to be specified. More...

Public Member Functions

Any GetNativeImageSource ()
 Retrieve the internal native image.
bool GetPixels (std::vector< unsigned char > &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format &pixelFormat) const
 Get a copy of the pixels used by NativeImageSource.
bool EncodeToFile (const std::string &filename) const
 Convert the current pixel contents to either a JPEG or PNG format and write that to the filesytem.

Static Public Member Functions

static NativeImageSourcePtr New (unsigned int width, unsigned int height, ColorDepth depth)
 Create a new NativeImageSource.
static NativeImageSourcePtr New (Any nativeImageSource)
 Create a new NativeImageSource from an existing native image.

Detailed Description

Used for displaying native images.

The native image source can be created internally or externally by X11 or ECORE-X11.

Since :
2.4

Member Enumeration Documentation

When creating a native image the color depth has to be specified.

Since :
2.4
Enumerator:
COLOR_DEPTH_DEFAULT 

Uses the current X screen default depth (recommended)

Since :
2.4
COLOR_DEPTH_8 

8 bits per pixel

Since :
2.4
COLOR_DEPTH_16 

16 bits per pixel

Since :
2.4
COLOR_DEPTH_24 

24 bits per pixel

Since :
2.4
COLOR_DEPTH_32 

32 bits per pixel

Since :
2.4

Member Function Documentation

bool Dali::NativeImageSource::EncodeToFile ( const std::string &  filename) const

Convert the current pixel contents to either a JPEG or PNG format and write that to the filesytem.

Since :
2.4
Parameters:
[in]filenameIdentify the filesytem location at which to write the encoded image. The extension determines the encoding used. The two valid encoding are (".jpeg"|".jpg") and ".png".
Returns:
True if the pixels were written, and false otherwise.

Retrieve the internal native image.

Since :
2.4
Returns:
Any object containing the internal native image
bool Dali::NativeImageSource::GetPixels ( std::vector< unsigned char > &  pixbuf,
unsigned int &  width,
unsigned int &  height,
Pixel::Format pixelFormat 
) const

Get a copy of the pixels used by NativeImageSource.

This is only supported for 24 bit RGB and 32 bit RGBA internal formats (COLOR_DEPTH_24 and COLOR_DEPTH_32).

Since :
2.4
Parameters:
[out]pixbufa vector to store the pixels in
[out]widthThe width of image
[out]heightThe height of image
[out]pixelFormatpixel format used by image
Returns:
True if the pixels were gotten, and false otherwise.
static NativeImageSourcePtr Dali::NativeImageSource::New ( unsigned int  width,
unsigned int  height,
ColorDepth  depth 
) [static]

Create a new NativeImageSource.

Depending on hardware the width and height may have to be a power of two.

Since :
2.4
Parameters:
[in]widthThe width of the image
[in]heightThe height of the image
[in]depthcolor depth of the image
Returns:
A smart-pointer to a newly allocated image
static NativeImageSourcePtr Dali::NativeImageSource::New ( Any  nativeImageSource) [static]

Create a new NativeImageSource from an existing native image.

Since :
2.4
Parameters:
[in]nativeImageSourcemust be a X11 pixmap or a Ecore_X_Pixmap now.
Returns:
A smart-pointer to a newly allocated image