Tizen Native API
|
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_Perspective * | edje_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_Perspective * | edje_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_Perspective * | edje_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
const Edje_Perspective* edje_evas_global_perspective_get | ( | const Evas * | e | ) |
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] e The 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
const Edje_Perspective* edje_object_perspective_get | ( | const Evas_Object * | obj | ) |
Gets the current perspective used on this edje object.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The 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()
void edje_object_perspective_set | ( | Evas_Object * | obj, |
Edje_Perspective * | ps | ||
) |
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] obj The edje object on the perspective that is set [in] ps The perspective object that is used
- See also:
- edje_object_perspective_new()
- edje_object_perspective_get()
- edje_perspective_set()
void edje_perspective_free | ( | Edje_Perspective * | ps | ) |
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] ps A valid perspective object, otherwise NULL
- See also:
- edje_perspective_new()
Eina_Bool edje_perspective_global_get | ( | const Edje_Perspective * | ps | ) |
Gets whether the given perspective object is global.
- Since :
- 2.3.1
- Parameters:
-
[in] ps The given perspective object
- Returns:
- EINA_TRUE if this perspective object is global, otherwise EINA_FALSE
- See also:
- edje_perspective_global_set()
void edje_perspective_global_set | ( | Edje_Perspective * | ps, |
Eina_Bool | global | ||
) |
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] ps The given perspective object [in] global If EINA_TRUE the perspective should be global, otherwise EINA_FALSE
Edje_Perspective* edje_perspective_new | ( | Evas * | e | ) |
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] e The given canvas (Evas)
- Returns:
- An Edje Perspective object for this canvas, otherwise
NULL
on errors
- Since :
- 2.3.1
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.
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] ps The perspective object [in] px The X coordinate of the perspective distance [in] py The Y coordinate of the perspective distance [in] z0 The "0" z plane value [in] foc The focal distance