Tizen Native API
Edje Perspective

This group discusses functions that deal with 3D projection of a 2D object.

Remarks:
Perspective is a graphical tool that makes objects represented in the 2D format look like they have a 3D appearance.

Edje allows us to use perspective on any edje object. This group of functions deals with the use of perspective, by creating and configuring a perspective object that must be set to an edje object or a canvas, affecting all the objects inside that has no particular perspective set already.

Functions

Edje_Perspectiveedje_perspective_new (Evas *e)
 Creates a new perspective in the given canvas.
void edje_perspective_free (Edje_Perspective *ps)
 Deletes the given perspective object.
void edje_perspective_set (Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc)
 Setsup the transform for this perspective object.
void edje_perspective_global_set (Edje_Perspective *ps, Eina_Bool global)
 Sets this perspective object to be global for its canvas.
Eina_Bool edje_perspective_global_get (const Edje_Perspective *ps)
 Gets whether the given perspective object is global.
const Edje_Perspectiveedje_evas_global_perspective_get (const Evas *e)
 Gets the global perspective object set for this canvas.
void edje_object_perspective_set (Evas_Object *obj, Edje_Perspective *ps)
 Sets the given perspective object on this edje object.
const Edje_Perspectiveedje_object_perspective_get (const Evas_Object *obj)
 Gets the current perspective used on this edje object.

Typedefs

typedef struct _Edje_Perspective Edje_Perspective
 perspective info for maps inside edje objects

Function Documentation

Gets the global perspective object set for this canvas.

This function returns the perspective object that is set as global with edje_perspective_global_set().

Since :
2.3.1
Parameters:
[in]eThe given canvas (Evas)
Returns:
The perspective object set as global for this canvas, otherwise NULL if there is no global perspective set and on errors
See also:
edje_perspective_global_set()
edje_perspective_global_get()

Gets the current perspective used on this edje object.

Since :
2.3.1
Parameters:
[in]objThe given edje object
Returns:
The perspective object being used on this edje object, otherwise NULL if there is no object set and on errors
See also:
edje_object_perspective_set()

Sets the given perspective object on this edje object.

This makes the given perspective object the default perspective for this edje object.

There can only be one perspective object per edje object, and if a previous one is set, it is removed and the new perspective object is used.

An Edje perspective only affects a part if it doesn't point to another part to be used as a perspective.

Since :
2.3.1
Parameters:
[in]objThe edje object on the perspective that is set
[in]psThe perspective object that is used
See also:
edje_object_perspective_new()
edje_object_perspective_get()
edje_perspective_set()

Deletes the given perspective object.

This function deletes the perspective object. If the perspective effect is being applied to any edje object or part, this effect won't be applied anymore.

Since :
2.3.1
Parameters:
[in]psA valid perspective object, otherwise NULL
See also:
edje_perspective_new()

Gets whether the given perspective object is global.

Since :
2.3.1
Parameters:
[in]psThe given perspective object
Returns:
EINA_TRUE if this perspective object is global, otherwise EINA_FALSE
See also:
edje_perspective_global_set()

Sets this perspective object to be global for its canvas.

Since :
2.3.1
Remarks:
The canvas for which this perspective object is being set as global is the one given as an argument upon object creation (the evas parameter of the function edje_perspective_new(evas) ).

There can only be one global perspective object set per canvas, and if a perspective object is set to global when there is already another global perspective set, the old one is set as non-global.

A global perspective just affects a part, if its edje object doesn't have a perspective object set to it and if the part doesn't point to another part to be used as a perspective.

Parameters:
[in]psThe given perspective object
[in]globalIf EINA_TRUE the perspective should be global, otherwise EINA_FALSE
See also:
edje_object_perspective_set()
edje_perspective_global_get()
edje_perspective_new()

Creates a new perspective in the given canvas.

This function creates a perspective object that can be set on an edje object, or can be set globally to all edje objects on this canvas.

Parameters:
[in]eThe given canvas (Evas)
Returns:
An Edje Perspective object for this canvas, otherwise NULL on errors
See also:
edje_perspective_set()
edje_perspective_free()
Since :
2.3.1

Setsup the transform for this perspective object.

This sets the parameters of the perspective transformation. X, Y, and Z values are used. The px and py points specify the "infinite distance" point in the 3D conversion (where all lines converge like when artists draw 3D by hand). The z0 value specifies the z value at which there is a 1:1 mapping between spatial coordinates and screen coordinates. Any points on this z value do not have their X and Y values modified in the transform. Those further away (Z value higher) shrink into the distance, and those less than this value expand and become bigger. The foc value determines the "focal length" of the camera. This is in reality the distance between the camera lens plane itself (at or closer than this, rendering results are undefined) and the "z0" z value. This allows for some "depth" control and foc must be greater than 0.

Since :
2.3.1
Parameters:
[in]psThe perspective object
[in]pxThe X coordinate of the perspective distance
[in]pyThe Y coordinate of the perspective distance
[in]z0The "0" z plane value
[in]focThe focal distance