author | Jose Thachil<jose.thachil@cell-telecom.com> |
Wed, 12 May 2010 13:05:33 +0100 | |
branch | EGL_MERGE |
changeset 59 | 0fb7b31791c3 |
parent 57 | 2bf8a359aa2f |
child 88 | a5a3a8cb368e |
permissions | -rw-r--r-- |
57
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
1 |
#ifndef __RIDEFS_H |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
2 |
#define __RIDEFS_H |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
3 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
4 |
/*------------------------------------------------------------------------ |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
5 |
* |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
6 |
* OpenVG 1.1 Reference Implementation |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
7 |
* ----------------------------------- |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
8 |
* |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
9 |
* Copyright (c) 2007 The Khronos Group Inc. |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
10 |
* |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
11 |
* Permission is hereby granted, free of charge, to any person obtaining a |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
12 |
* copy of this software and /or associated documentation files |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
13 |
* (the "Materials "), to deal in the Materials without restriction, |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
14 |
* including without limitation the rights to use, copy, modify, merge, |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
15 |
* publish, distribute, sublicense, and/or sell copies of the Materials, |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
16 |
* and to permit persons to whom the Materials are furnished to do so, |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
17 |
* subject to the following conditions: |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
18 |
* |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
19 |
* The above copyright notice and this permission notice shall be included |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
20 |
* in all copies or substantial portions of the Materials. |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
21 |
* |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
22 |
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
23 |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
24 |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
25 |
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
26 |
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
27 |
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
28 |
* THE USE OR OTHER DEALINGS IN THE MATERIALS. |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
29 |
* |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
30 |
*//** |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
31 |
* \file |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
32 |
* \brief Platform- and compiler-dependent type and macro definitions. |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
33 |
* \note |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
34 |
*//*-------------------------------------------------------------------*/ |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
35 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
36 |
#include <float.h> |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
37 |
#include <math.h> |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
38 |
#include <assert.h> |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
39 |
#include <new> //for bad_alloc |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
40 |
#include <egl.h> |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
41 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
42 |
#ifdef USE_NEW_ELEAVE |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
43 |
//this is sometimes useful to include so that alloc fails ca be caught. |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
44 |
//I have found intermittent OOM (-4) problems when rasterizing the tiger image |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
45 |
#include <e32std.h> |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
46 |
#endif |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
47 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
48 |
namespace OpenVGRI |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
49 |
{ |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
50 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
51 |
//make for-clause scope c++ standard compliant on msvc |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
52 |
#if defined (_MSC_VER) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
53 |
# if !defined (for) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
54 |
__forceinline bool getFalse (void) { return false; } |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
55 |
# define for if(getFalse()); else for |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
56 |
# endif // for |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
57 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
58 |
#pragma warning(disable:4710) //disable function not inlined warning |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
59 |
#pragma warning(disable:4714) //disable function not __forceinlined warning |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
60 |
#endif // _MSC_VER |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
61 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
62 |
//======================================================================= |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
63 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
64 |
typedef int RIint32; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
65 |
typedef unsigned int RIuint32; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
66 |
typedef short RIint16; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
67 |
typedef unsigned short RIuint16; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
68 |
typedef signed char RIint8; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
69 |
typedef unsigned char RIuint8; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
70 |
typedef float RIfloat32; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
71 |
//TODO add compile-time assertions to guarantee the sizes |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
72 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
73 |
#if defined (_MSC_VER) // MSVC WIN32 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
74 |
# define RI_INLINE __forceinline |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
75 |
#elif defined __APPLE__ || defined (__GNUC__) || defined (__GCC32__) || (__SYMBIAN32__) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
76 |
# define RI_INLINE inline |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
77 |
#endif |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
78 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
79 |
/*!< Unsigned int that can hold a pointer to any type */ |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
80 |
/*!< Signed int that can hold a pointer to any type */ |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
81 |
#if defined (_MSC_VER) && (_MSC_VER >= 1300) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
82 |
typedef uintptr_t RIuintptr; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
83 |
typedef intptr_t RIintptr; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
84 |
#else |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
85 |
typedef unsigned long RIuintptr; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
86 |
typedef signed long RIintptr; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
87 |
#endif |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
88 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
89 |
#define RI_UINT32_MAX (0xffffffffu) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
90 |
#define RI_INT32_MAX (0x7fffffff) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
91 |
#define RI_INT32_MIN (-0x7fffffff-1) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
92 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
93 |
/* maximum mantissa is 23 */ |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
94 |
#define RI_MANTISSA_BITS 23 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
95 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
96 |
/* maximum exponent is 8 */ |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
97 |
#define RI_EXPONENT_BITS 8 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
98 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
99 |
typedef union |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
100 |
{ |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
101 |
RIfloat32 f; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
102 |
RIuint32 i; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
103 |
} RIfloatInt; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
104 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
105 |
RI_INLINE float getFloatMax() |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
106 |
{ |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
107 |
RIfloatInt v; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
108 |
v.i = (((1<<(RI_EXPONENT_BITS-1))-1+127) << 23) | (((1<<RI_MANTISSA_BITS)-1) << (23-RI_MANTISSA_BITS)); |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
109 |
return v.f; |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
110 |
} |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
111 |
#define RI_FLOAT_MAX getFloatMax() |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
112 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
113 |
#define RI_MAX_IMAGE_WIDTH 16384 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
114 |
#define RI_MAX_IMAGE_HEIGHT 16384 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
115 |
#define RI_MAX_IMAGE_PIXELS (RI_MAX_IMAGE_WIDTH*RI_MAX_IMAGE_HEIGHT) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
116 |
#define RI_MAX_IMAGE_BYTES (4*RI_MAX_IMAGE_WIDTH*RI_MAX_IMAGE_HEIGHT) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
117 |
#define RI_MAX_DASH_COUNT 256 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
118 |
#define RI_MAX_COLOR_RAMP_STOPS 256 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
119 |
#define RI_MAX_KERNEL_SIZE 256 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
120 |
#define RI_MAX_SEPARABLE_KERNEL_SIZE 256 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
121 |
#define RI_MAX_GAUSSIAN_STD_DEVIATION 16.0f |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
122 |
#define RI_MAX_SCISSOR_RECTANGLES 256 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
123 |
#define RI_MAX_EDGES 262144 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
124 |
#define RI_MAX_SAMPLES 32 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
125 |
#define RI_NUM_TESSELLATED_SEGMENTS 256 |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
126 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
127 |
#define RI_DEBUG |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
128 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
129 |
#ifdef RI_DEBUG |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
130 |
# define RI_ASSERT assert |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
131 |
#else |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
132 |
# define RI_ASSERT |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
133 |
#endif |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
134 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
135 |
#define RI_UNREF(X) ((void)(X)) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
136 |
#define RI_APIENTRY EXPORT_C |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
137 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
138 |
#ifdef USE_NEW_ELEAVE |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
139 |
#define RI_NEW(TYPE, PARAMS) (new(ELeave) TYPE PARAMS) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
140 |
#define RI_NEW_ARRAY(TYPE, ITEMS) (new(ELeave) TYPE[ITEMS]) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
141 |
#else |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
142 |
#define RI_NEW(TYPE, PARAMS) (new TYPE PARAMS) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
143 |
#define RI_NEW_ARRAY(TYPE, ITEMS) (new TYPE[ITEMS]) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
144 |
#endif |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
145 |
#define RI_DELETE(PARAMS) (delete (PARAMS)) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
146 |
#define RI_DELETE_ARRAY(PARAMS) (delete[] (PARAMS)) |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
147 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
148 |
bool isValidImageFormat(int format); |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
149 |
bool isValidImageFormat(EGLNativePixmapType f); |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
150 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
151 |
//======================================================================= |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
152 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
153 |
} //namespace OpenVGRI |
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
154 |
|
2bf8a359aa2f
Create EGL 1.4 implementation by merging eglrefimpl and EGL from sfopenvg
Jose Thachil<jose.thachil@cell-telecom.com>
parents:
diff
changeset
|
155 |
#endif /* __RIDEFS_H */ |