os/graphics/graphicscomposition/openwfcompositionengine/common/include/owftypes.h
First public contribution.
1 /* Copyright (c) 2009 The Khronos Group Inc.
2 * Portions copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and/or associated documentation files (the
6 * "Materials"), to deal in the Materials without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Materials, and to
9 * permit persons to whom the Materials are furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Materials.
15 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27 #include "KHR/khrplatform.h"
33 typedef khronos_int8_t OWFint8;
34 typedef khronos_int16_t OWFint16;
35 typedef khronos_int32_t OWFint32;
36 typedef khronos_int32_t OWFint;
37 typedef khronos_uint8_t OWFuint8;
38 typedef khronos_uint16_t OWFuint16;
39 typedef khronos_uint32_t OWFuint32;
40 typedef khronos_uint32_t OWFuint;
41 typedef khronos_float_t OWFfloat;
43 typedef khronos_utime_nanoseconds_t OWFtime;
45 typedef OWFuint32 OWFHandle;
47 #define OWF_FOREVER (0xFFFFFFFFFFFFFFFFull)
48 #define OWF_INVALID_HANDLE ((OWFHandle)0)
51 /* Used for Function Prototypes */
52 /*! \brief OWF_API_CALL definition can be used to restrict
53 * visibility of symbols
66 /* supported external image formats */
68 OWF_IMAGE_NOT_SUPPORTED = 0,
69 OWF_IMAGE_ARGB8888 = 0x8888,
70 OWF_IMAGE_XRGB8888 = 0xf888,
71 OWF_IMAGE_RGB888 = 0x888,
72 OWF_IMAGE_RGB565 = 0x565,
73 OWF_IMAGE_L32 = 0xA32,
74 OWF_IMAGE_L16 = 0xA16,
77 OWF_IMAGE_ARGB_INTERNAL = 0x666 /* OWFpixel rep */
81 OWF_FALSE = KHR_BOOLEAN_FALSE,
82 OWF_TRUE = KHR_BOOLEAN_TRUE
86 OWF_PIXEL_FORMAT pixelFormat;
88 OWFboolean premultiplied;
89 OWFint rowPadding; /* row alignment, in bytes */
100 #define MIN(a,b) ((a)<(b)?(a):(b))
101 #define MAX(a,b) ((a)>(b)?(a):(b))
102 #define CLAMP(x,a,b) MAX(a,MIN(x,b))
103 #define INRANGE(x,a,b) ((x) >= (a) && (x) <= (b))
105 typedef void* OWF_MUTEX;
106 typedef void* OWF_SEMAPHORE;
108 typedef struct OWF_NODE_
111 struct OWF_NODE_* next;
114 typedef OWFint (*NODECMPFUNC)(void*, void*);
115 typedef OWFint (*NODEITERFUNC)(void*, void*);
117 typedef OWFHandle OWFNativeStreamType;
118 typedef OWFint OWFNativeStreamBuffer;
121 * Events emitted by native streams.
127 } OWF_DEFAULT_EVENT_PARAM;
129 #define ALPHA_MASK 0xFF000000
130 #define RED_MASK 0xFF0000
131 #define GREEN_MASK 0xFF00
132 #define BLUE_MASK 0xFF
134 /*! Native stream callback function type */
135 typedef void (*OWFStreamCallback)( OWFNativeStreamType,
142 OWFStreamCallback callback;
144 } OWFStreamCallbackData;
146 #define OWF_SUPPORTED_DEVICE_ID 1
147 #define OWF_RESERVED_BAD_SCREEN_NUMBER (-1)
153 #endif /* _OWFTYPES_H_ */