summaryrefslogtreecommitdiff
path: root/src/lib/evas/Evas_Common.h
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@free.fr>2014-05-10 12:00:34 +0200
committerCedric Bail <cedric.bail@free.fr>2014-05-10 12:04:12 +0200
commit4f1ace788942da3167a5076b60ac57c499190fb8 (patch)
tree89a06a2d8452b591342e760aedd38813e6a50441 /src/lib/evas/Evas_Common.h
parent2042bdf9221cb136bbb12308477633668bba5235 (diff)
evas: move the type and enum of Evas_3D into the unstable part of the API.
I am concerned that we do duplicate the color format of a texture insteed of reusing the colorspace enum from Evas (that already exist). I believe this is a side effect of not using Evas_GL_Image for texture. This let me think that I wont allow this API out of BETA until we reduce duplication by using Evas_GL_Image as it seems it will also impact the public API of Evas_3D.
Diffstat (limited to 'src/lib/evas/Evas_Common.h')
-rw-r--r--src/lib/evas/Evas_Common.h536
1 files changed, 0 insertions, 536 deletions
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 175aeee4da..e9abd7368b 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -5291,539 +5291,3 @@ EAPI const Eina_List *evas_font_path_global_list(void) EINA_WARN_UNUSED_R
5291 * @} 5291 * @}
5292 */ 5292 */
5293 5293
5294
5295 /**
5296 * @defgroup Evas_3D Evas 3D Extensions
5297 *
5298 * Evas extension to support 3D rendering.
5299 *
5300 * @ingroup Evas
5301 */
5302
5303/**
5304 * @page evas_3d_main Evas 3D
5305 *
5306 * @since 1.10
5307 *
5308 * @section toc Table of Contents
5309 *
5310 * @li @ref evas_3d_intro
5311 * @li @ref evas_3d_example
5312 *
5313 * @section evas_3d_intro Introduction
5314 *
5315 * Evas 3D is an extension to support 3D scene graph rendering into 2D Evas
5316 * canvas supporting typicall tree-based scene graph manipulation and other 3D
5317 * graphics rendering techniques.
5318 *
5319 * Evas 3D provides 3D objects which are used for describing 3D scene and APIs
5320 * to connect the scene with an evas image object so that the scene is rendered
5321 * on that image object.
5322 *
5323 * Contruction of a 3D scene is process of locating desired cameras, lights and
5324 * meshes in the scene. Typically the scene is structured with some hierarchical
5325 * data structure. Evas 3D support n-ary tree structure for describing the
5326 * scene. Node is used to build the tree representation of the scene. Other
5327 * objects, like camera, light and mesh can be located in the scene by being
5328 * contained in a node.
5329 *
5330 * Like other 3D graphics engine, Evas 3D support standard 3D rendering method
5331 * like flat shading, phong shading and normal map and other features like
5332 * texture mapping, triangle meshes.
5333 *
5334 * Besides all the traditional 3D rendering things, one of the key feature of
5335 * the Evas 3D is that it is able to use existing evas objects as textures
5336 * inside of the 3D scene. "Existing evas objects" means all the EFL widgets
5337 * and applications. By supporting this, it is easy to make 3D version of an
5338 * application without modifying the original source that much.
5339 *
5340 * Also, 3D scene can be located on the canvas naturally stacked with existing
5341 * evas objects. This can make it possible putting 3D things into existing 2D
5342 * application layouts.
5343 *
5344 * @section evas_3d_example Introductory Example
5345 *
5346 * @include evas-3d-cube.c
5347 */
5348
5349/**
5350 * @defgroup Evas_3D_Types Types & Enums
5351 * @ingroup Evas_3D
5352 *
5353 * Primitive type definitions and enumations.
5354 */
5355
5356/**
5357 * @defgroup Evas_3D_Object Generic 3D Object Descriptions
5358 * @ingroup Evas_3D
5359 *
5360 * Evas 3D object is a generic type of all evas 3D objects like scene, node,
5361 * camera, light, mesh, texture and material. Evas 3D object is basically
5362 * reference counted. Any successful function call on an object which make a
5363 * reference to an another object will increase the reference count. When the
5364 * reference count gets to 0, the object will be actually deleted.
5365 *
5366 * Any modifications are automatically propagated to other objects referencing
5367 * the modified objects. As a result, if the scene object is set to modified
5368 * state, all image objects having the scene as a rendering source are marked
5369 * as dirty, so that rendering will be updated at next frame. But all these
5370 * things are done internally, so feel free to forget about calling some kind
5371 * of update functions.
5372 */
5373
5374/**
5375 * @defgroup Evas_3D_Scene Scene Object
5376 * @ingroup Evas_3D
5377 *
5378 * A scene represents a captured image of a scene graph through its viewing
5379 * camera. A scene can be set to an image object to be displayed on the Evas
5380 * canvas by using evas_object_image_scene_set() function.
5381 */
5382
5383/**
5384 * @defgroup Evas_3D_Node Node Object
5385 * @ingroup Evas_3D
5386 *
5387 * A node is used for hierarchical construction of a scene graph. Evas 3D
5388 * provides n-ary tree structure for the scene graph construction. A node has
5389 * its position, orientation and scale. Other objects, like camera, light and
5390 * mesh can be contained in a node to be located in a 3D space.
5391 */
5392
5393/**
5394 * @defgroup Evas_3D_Camera Camera Object
5395 * @ingroup Evas_3D
5396 *
5397 * A camera object is used for taking a picture of a scene graph. A camera
5398 * object itself is just a set of properties on how the camera should take the
5399 * picture (like focus length and film size of the real world cameras). To be
5400 * able to take a shot of the scene, a camera should be located in the scene, so
5401 * that it has its viewing position and direction. It is done by containing the
5402 * camera on a node. If one wants to locate several cameras having same
5403 * properties, instead of creating multiple cameras, just create one camera and
5404 * multiple nodes containing the camera and locate them at each desired position
5405 * and direction. Just for convinience, use evas_3d_node_position_set() to move
5406 * the camera to desired position and use evas_3d_node_look_at_set() to adjust
5407 * the viewing direction of the camera.
5408 */
5409
5410/**
5411 * @defgroup Evas_3D_Light Light Object
5412 * @ingroup Evas_3D
5413 *
5414 * A light object represents a set of properties of a light source. Evas 3D
5415 * provides standard reflection model that of ambient, diffuse and specular
5416 * reflection model. Also, Evas 3D support 3 types of light model, directional,
5417 * point and spot light. Light position and direction is determined by the node
5418 * containing the light.
5419 */
5420
5421/**
5422 * @defgroup Evas_3D_Mesh Mesh Object
5423 * @ingroup Evas_3D
5424 *
5425 * A mesh object is a set of information on a visible geometrical object like
5426 * character model, terrain or other structures and entities. Evas 3D support
5427 * key-frame-based mesh animation, so a mesh can have multiple frames and each
5428 * frame has its own material and geometric data. Like other data objects, a
5429 * mesh can be located on a scene by being contained in a node. The mesh is
5430 * transformed from its modeling coordinate space into the node's coordinate
5431 * space. Also, the frame number is saved in the containing node. So, one can
5432 * locate multiple nodes having same mesh object with different animation frame
5433 * and transform. Unlike camera and light object, multiple meshes can be
5434 * contained in a single node.
5435 */
5436
5437/**
5438 * @defgroup Evas_3D_Texture Texture Object
5439 * @ingroup Evas_3D
5440 *
5441 * A texture object is an image represents material of surfaces. A texture can
5442 * be set to a slot of Evas_3D_Material by using evas_3d_material_texture_set()
5443 * function. The data of a texture can be loaded from memory, file and other
5444 * Evas_Object.
5445 */
5446
5447/**
5448 * @defgroup Evas_3D_Material Material Object
5449 * @ingroup Evas_3D
5450 *
5451 * A material object represents properties of surfaces. Evas 3D defines the
5452 * properties with 5 material attributes, ambient, diffuse, specular emission
5453 * and normal. Each attribute have its color value and texture map. Materials
5454 * are used to determine the color of mesh surfaces.
5455 */
5456
5457/**
5458 * @typedef Evas_Real
5459 *
5460 * Floating-point data type
5461 *
5462 * Evas 3D use its own floating-point type. Even though it's a standard IEEE
5463 * 754 floating-point type always use Evas_Real for the type safety. Double
5464 * precision and fixed-point types will be useful but it's not supported yet.
5465 *
5466 * @since 1.10
5467 * @ingroup Evas_3D_Types
5468 */
5469typedef double Evas_Real;
5470
5471
5472/**
5473 * @typedef Evas_3D_Object
5474 *
5475 * 3D Object object handle
5476 *
5477 * @since 1.10
5478 * @ingroup Evas_3D_Object
5479 */
5480typedef Eo Evas_3D_Object;
5481
5482/**
5483 * @typedef Evas_3D_Scene
5484 *
5485 * Scene object handle
5486 *
5487 * @since 1.10
5488 * @ingroup Evas_3D_Scene
5489 */
5490typedef Eo Evas_3D_Scene;
5491
5492/**
5493 * @typedef Evas_3D_Node
5494 *
5495 * Node object handle
5496 *
5497 * @since 1.10
5498 * @ingroup Evas_3D_Node
5499 */
5500typedef Eo Evas_3D_Node;
5501
5502/**
5503 * @typedef Evas_3D_Camera
5504 *
5505 * Camera object handle
5506 *
5507 * @since 1.10
5508 * @ingroup Evas_3D_Camera
5509 */
5510typedef Eo Evas_3D_Camera;
5511
5512/**
5513 * @typedef Evas_3D_Light
5514 *
5515 * Light object handle
5516 *
5517 * @since 1.10
5518 * @ingroup Evas_3D_Light
5519 */
5520typedef Eo Evas_3D_Light;
5521
5522/**
5523 * @typedef Evas_3D_Mesh
5524 *
5525 * Mesh object handle
5526 *
5527 * @since 1.10
5528 * @ingroup Evas_3D_Mesh
5529 */
5530typedef Eo Evas_3D_Mesh;
5531
5532/**
5533 * @typedef Evas_3D_Texture
5534 *
5535 * Texture object handle
5536 *
5537 * @since 1.10
5538 * @ingroup Evas_3D_Texture
5539 */
5540typedef Eo Evas_3D_Texture;
5541
5542/**
5543 * @typedef Evas_3D_Material
5544 *
5545 * Material object handle
5546 *
5547 * @since 1.10
5548 * @ingroup Evas_3D_Material
5549 */
5550typedef Eo Evas_3D_Material;
5551
5552/**
5553 * Type of 3D Object
5554 *
5555 * @since 1.10
5556 * @ingroup Evas_3D_Type
5557 */
5558typedef enum _Evas_3D_Object_Type
5559{
5560 EVAS_3D_OBJECT_TYPE_INVALID = 0,
5561 EVAS_3D_OBJECT_TYPE_SCENE,
5562 EVAS_3D_OBJECT_TYPE_NODE,
5563 EVAS_3D_OBJECT_TYPE_CAMERA,
5564 EVAS_3D_OBJECT_TYPE_LIGHT,
5565 EVAS_3D_OBJECT_TYPE_MODEL,
5566 EVAS_3D_OBJECT_TYPE_MESH,
5567 EVAS_3D_OBJECT_TYPE_TEXTURE,
5568 EVAS_3D_OBJECT_TYPE_MATERIAL,
5569} Evas_3D_Object_Type;
5570
5571/**
5572 * State of the Evas 3D
5573 *
5574 * @since 1.10
5575 * @ingroup Evas_3D_Type
5576 */
5577typedef enum _Evas_3D_State
5578{
5579 EVAS_3D_STATE_MAX = 16,
5580
5581 EVAS_3D_STATE_ANY = 0,
5582
5583 EVAS_3D_STATE_SCENE_ROOT_NODE = 1,
5584 EVAS_3D_STATE_SCENE_CAMERA_NODE,
5585 EVAS_3D_STATE_SCENE_BACKGROUND_COLOR,
5586 EVAS_3D_STATE_SCENE_SIZE,
5587
5588 EVAS_3D_STATE_TEXTURE_DATA = 1,
5589 EVAS_3D_STATE_TEXTURE_WRAP,
5590 EVAS_3D_STATE_TEXTURE_FILTER,
5591
5592 EVAS_3D_STATE_MATERIAL_ID = 1,
5593 EVAS_3D_STATE_MATERIAL_COLOR,
5594 EVAS_3D_STATE_MATERIAL_TEXTURE,
5595
5596 EVAS_3D_STATE_MESH_VERTEX_COUNT = 1,
5597 EVAS_3D_STATE_MESH_FRAME,
5598 EVAS_3D_STATE_MESH_MATERIAL,
5599 EVAS_3D_STATE_MESH_TRANSFORM,
5600 EVAS_3D_STATE_MESH_VERTEX_DATA,
5601 EVAS_3D_STATE_MESH_INDEX_DATA,
5602 EVAS_3D_STATE_MESH_VERTEX_ASSEMBLY,
5603 EVAS_3D_STATE_MESH_SHADE_MODE,
5604
5605 EVAS_3D_STATE_CAMERA_PROJECTION = 1,
5606
5607 EVAS_3D_STATE_LIGHT_AMBIENT = 1,
5608 EVAS_3D_STATE_LIGHT_DIFFUSE,
5609 EVAS_3D_STATE_LIGHT_SPECULAR,
5610 EVAS_3D_STATE_LIGHT_SPOT_DIR,
5611 EVAS_3D_STATE_LIGHT_SPOT_EXP,
5612 EVAS_3D_STATE_LIGHT_SPOT_CUTOFF,
5613 EVAS_3D_STATE_LIGHT_ATTENUATION,
5614
5615 EVAS_3D_STATE_NODE_TRANSFORM = 1,
5616 EVAS_3D_STATE_NODE_MESH_GEOMETRY,
5617 EVAS_3D_STATE_NODE_MESH_MATERIAL,
5618 EVAS_3D_STATE_NODE_MESH_FRAME,
5619 EVAS_3D_STATE_NODE_MESH_SHADE_MODE,
5620 EVAS_3D_STATE_NODE_MESH_MATERIAL_ID,
5621 EVAS_3D_STATE_NODE_LIGHT,
5622 EVAS_3D_STATE_NODE_CAMERA,
5623 EVAS_3D_STATE_NODE_PARENT,
5624 EVAS_3D_STATE_NODE_MEMBER,
5625} Evas_3D_State;
5626
5627/**
5628 * Transform space
5629 *
5630 * @since 1.10
5631 * @ingroup Evas_3D_Types
5632 */
5633typedef enum _Evas_3D_Space
5634{
5635 EVAS_3D_SPACE_LOCAL = 0, /**< Local coordinate space */
5636 EVAS_3D_SPACE_PARENT, /**< Parent coordinate space */
5637 EVAS_3D_SPACE_WORLD, /**< World coordinate space */
5638} Evas_3D_Space;
5639
5640/**
5641 * Types of a node
5642 *
5643 * @since 1.10
5644 * @ingroup Evas_3D_Types
5645 */
5646typedef enum _Evas_3D_Node_Type
5647{
5648 EVAS_3D_NODE_TYPE_NODE = 0, /**< Node with no items */
5649 EVAS_3D_NODE_TYPE_CAMERA, /**< Node which can contain camera object */
5650 EVAS_3D_NODE_TYPE_LIGHT, /**< Node which can contain light object */
5651 EVAS_3D_NODE_TYPE_MESH, /**< Node which can contain mesh objects */
5652} Evas_3D_Node_Type;
5653
5654/**
5655 * Vertex attribute IDs
5656 *
5657 * @since 1.10
5658 * @ingroup Evas_3D_Types
5659 */
5660typedef enum _Evas_3D_Vertex_Attrib
5661{
5662 EVAS_3D_VERTEX_POSITION = 0, /**< Vertex position */
5663 EVAS_3D_VERTEX_NORMAL, /**< Vertex normal */
5664 EVAS_3D_VERTEX_TANGENT, /**< Vertex tangent (for normal mapping) */
5665 EVAS_3D_VERTEX_COLOR, /**< Vertex color */
5666 EVAS_3D_VERTEX_TEXCOORD, /**< Vertex texture coordinate */
5667} Evas_3D_Vertex_Attrib;
5668
5669/**
5670 * Index formats
5671 *
5672 * @since 1.10
5673 * @ingroup Evas_3D_Types
5674 */
5675typedef enum _Evas_3D_Index_Format
5676{
5677 EVAS_3D_INDEX_FORMAT_NONE = 0, /**< Indexing is not used */
5678 EVAS_3D_INDEX_FORMAT_UNSIGNED_BYTE, /**< Index is of type unsigned byte */
5679 EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT /**< Index is of type unsigned short */
5680} Evas_3D_Index_Format;
5681
5682/**
5683 * Vertex assembly modes
5684 *
5685 * Vertex assembly represents how the vertices are organized into geometric
5686 * primitives.
5687 *
5688 * @since 1.10
5689 * @ingroup Evas_3D_Types
5690 */
5691typedef enum _Evas_3D_Vertex_Assembly
5692{
5693 /**< A vertex is rendered as a point */
5694 EVAS_3D_VERTEX_ASSEMBLY_POINTS = 0,
5695 /**< Two vertices are organized as a line */
5696 EVAS_3D_VERTEX_ASSEMBLY_LINES,
5697 /**< Vertices are organized as a connected line path */
5698 EVAS_3D_VERTEX_ASSEMBLY_LINE_STRIP,
5699 /**< Vertices are organized as a closed line path */
5700 EVAS_3D_VERTEX_ASSEMBLY_LINE_LOOP,
5701 /**< Three vertices are organized as a triangle */
5702 EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES,
5703 /**< Vertices are organized as connected triangles */
5704 EVAS_3D_VERTEX_ASSEMBLY_TRIANGLE_STRIP,
5705 /**< Vertices are organized as a triangle fan */
5706 EVAS_3D_VERTEX_ASSEMBLY_TRIANGLE_FAN,
5707} Evas_3D_Vertex_Assembly;
5708
5709/**
5710 * Color formats of pixel data
5711 *
5712 * @since 1.10
5713 * @ingroup Evas_3D_Types
5714 */
5715typedef enum _Evas_3D_Color_Format
5716{
5717 /**< Color contains full components, red, green, blue and alpha */
5718 EVAS_3D_COLOR_FORMAT_RGBA = 0,
5719 /**< Color contains only red, green and blue components */
5720 EVAS_3D_COLOR_FORMAT_RGB,
5721 /**< Color contains only alpha component */
5722 EVAS_3D_COLOR_FORMAT_ALPHA
5723} Evas_3D_Color_Format;
5724
5725/**
5726 * Pixel formats
5727 *
5728 * @since 1.10
5729 * @ingroup Evas_3D_Types
5730 */
5731typedef enum _Evas_3D_Pixel_Format
5732{
5733 /**< 8-bit pixel with single component */
5734 EVAS_3D_PIXEL_FORMAT_8 = 0,
5735 /**< 16-bit pixel with three components (5-6-5 bit) */
5736 EVAS_3D_PIXEL_FORMAT_565,
5737 /**< 24-bit pixel with three 8-bit components */
5738 EVAS_3D_PIXEL_FORMAT_888,
5739 /**< 32-bit pixel with four 8-bit components */
5740 EVAS_3D_PIXEL_FORMAT_8888,
5741 /**< 16-bit pixel with four 4-bit components */
5742 EVAS_3D_PIXEL_FORMAT_4444,
5743 /**< 16-bit pixel with four components (5-5-5-1 bit) */
5744 EVAS_3D_PIXEL_FORMAT_5551
5745} Evas_3D_Pixel_Format;
5746
5747/**
5748 * Wrap modes
5749 *
5750 * @since 1.10
5751 * @ingroup Evas_3D_Types
5752 */
5753typedef enum _Evas_3D_Wrap_Mode
5754{
5755 /**< Values will be clamped to be in range [min, max] */
5756 EVAS_3D_WRAP_MODE_CLAMP = 0,
5757 /**< Values will be repeated */
5758 EVAS_3D_WRAP_MODE_REPEAT,
5759 /**< Values will be repeated in a reflected manner */
5760 EVAS_3D_WRAP_MODE_REFLECT
5761} Evas_3D_Wrap_Mode;
5762
5763/**
5764 * Texture filters
5765 *
5766 * @since 1.10
5767 * @ingroup Evas_3D_Types
5768 */
5769typedef enum _Evas_3D_Texture_Filter
5770{
5771 /**< Samples nearest texel */
5772 EVAS_3D_TEXTURE_FILTER_NEAREST = 0,
5773 /**< Lineary interpolate nearby texels */
5774 EVAS_3D_TEXTURE_FILTER_LINEAR,
5775 /**< Nearest sampling mipmap */
5776 EVAS_3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
5777 /**< Nearest sampling mipmap and interpolate */
5778 EVAS_3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
5779 /**< Linear sampling in nearest mipmap */
5780 EVAS_3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
5781 /**< Linear sampling in mipmap and interpolate */
5782 EVAS_3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR
5783} Evas_3D_Texture_Filter;
5784
5785/**
5786 * Shade modes
5787 *
5788 * @since 1.10
5789 * @ingroup Evas_3D_Types
5790 */
5791typedef enum _Evas_3D_Shade_Mode
5792{
5793 /**< Shaded using vertex color attribute */
5794 EVAS_3D_SHADE_MODE_VERTEX_COLOR = 0,
5795 /**< Shaded using material diffuse term */
5796 EVAS_3D_SHADE_MODE_DIFFUSE,
5797 /**< Per-vertex flat lighting */
5798 EVAS_3D_SHADE_MODE_FLAT,
5799 /**< Per-pixel phong shading */
5800 EVAS_3D_SHADE_MODE_PHONG,
5801 /**< Per-pixel normal map shading */
5802 EVAS_3D_SHADE_MODE_NORMAL_MAP
5803} Evas_3D_Shade_Mode;
5804
5805/**
5806 * Material attributes
5807 *
5808 * @since 1.10
5809 * @ingroup Evas_3D_Types
5810 */
5811typedef enum _Evas_3D_Material_Attrib
5812{
5813 EVAS_3D_MATERIAL_AMBIENT = 0, /**< Ambient term */
5814 EVAS_3D_MATERIAL_DIFFUSE, /**< Diffuse term */
5815 EVAS_3D_MATERIAL_SPECULAR, /**< Specular term */
5816 EVAS_3D_MATERIAL_EMISSION, /**< Emission term */
5817 EVAS_3D_MATERIAL_NORMAL, /**< Normal map term */
5818} Evas_3D_Material_Attrib;
5819
5820/**
5821 * Mesh file type
5822 *
5823 * @since 1.10
5824 * @ingroup Evas_3D_Types
5825 */
5826typedef enum _Evas_3D_Mesh_File_Type
5827{
5828 EVAS_3D_MESH_FILE_TYPE_MD2 = 0, /**< Quake's MD2 mesh file format */
5829} Evas_3D_Mesh_File_Type;