summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/evas/Evas_Loader.h149
1 files changed, 46 insertions, 103 deletions
diff --git a/src/lib/evas/Evas_Loader.h b/src/lib/evas/Evas_Loader.h
index ceddef57e9..ab2fd134c5 100644
--- a/src/lib/evas/Evas_Loader.h
+++ b/src/lib/evas/Evas_Loader.h
@@ -37,6 +37,7 @@
37#define _EVAS_LOADER_H 37#define _EVAS_LOADER_H
38 38
39#include "Eina.h" 39#include "Eina.h"
40#include "Emile.h"
40 41
41#ifdef EAPI 42#ifdef EAPI
42# undef EAPI 43# undef EAPI
@@ -116,119 +117,61 @@ struct _Evas_Module
116 unsigned char loaded : 1; 117 unsigned char loaded : 1;
117}; 118};
118 119
119typedef struct _Evas_Image_Load_Opts Evas_Image_Load_Opts; 120typedef Emile_Image_Load_Opts Evas_Image_Load_Opts;
120typedef struct _Evas_Image_Animated Evas_Image_Animated; 121typedef Emile_Image_Animated Evas_Image_Animated;
121typedef struct _Evas_Image_Property Evas_Image_Property; 122typedef Emile_Image_Property Evas_Image_Property;
123
122typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func; 124typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func;
123 125
124typedef enum _Evas_Load_Error 126typedef Emile_Image_Load_Error Evas_Load_Error;
125{
126 EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */
127 EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */
128 EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */
129 EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission denied to an existing file (or path) */
130 EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */
131 EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */
132 EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */
133} Evas_Load_Error; /**< Evas image load error codes one can get - see evas_load_error_str() too. */
134
135typedef enum _Evas_Image_Animated_Loop_Hint
136{
137 EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
138 EVAS_IMAGE_ANIMATED_HINT_LOOP = 1, /**< Image's animation mode is loop like 1->2->3->1->2->3 */
139 EVAS_IMAGE_ANIMATED_HINT_PINGPONG = 2 /**< Image's animation mode is pingpong like 1->2->3->2->1-> ... */
140} Evas_Image_Animated_Loop_Hint;
141 127
142typedef enum _Evas_Image_Scale_Hint 128#define EVAS_LOAD_ERROR_NONE EMILE_IMAGE_LOAD_ERROR_NONE
143{ 129#define EVAS_LOAD_ERROR_GENERIC EMILE_IMAGE_LOAD_ERROR_GENERIC
144 EVAS_IMAGE_SCALE_HINT_NONE = 0, /**< No scale hint at all */ 130#define EVAS_LOAD_ERROR_DOES_NOT_EXIST EMILE_IMAGE_LOAD_ERROR_DOES_NOT_EXIST
145 EVAS_IMAGE_SCALE_HINT_DYNAMIC = 1, /**< Image is being re-scaled over time, thus turning scaling cache @b off for its data */ 131#define EVAS_LOAD_ERROR_PERMISSION_DENIED EMILE_IMAGE_LOAD_ERROR_PERMISSION_DENIED
146 EVAS_IMAGE_SCALE_HINT_STATIC = 2 /**< Image is not being re-scaled over time, thus turning scaling cache @b on for its data */ 132#define EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED EMILE_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED
147} Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */ 133#define EVAS_LOAD_ERROR_CORRUPT_FILE EMILE_IMAGE_LOAD_ERROR_CORRUPT_FILE
134#define EVAS_LOAD_ERROR_UNKNOWN_FORMAT EMILE_IMAGE_LOAD_ERROR_UNKNOWN_FORMAT
135
136typedef Emile_Image_Animated_Loop_Hint Evas_Image_Animated_Loop_Hint;
137
138#define EVAS_IMAGE_ANIMATED_HINT_NONE EMILE_IMAGE_ANIMATED_HINT_NONE
139#define EVAS_IMAGE_ANIMATED_HINT_LOOP EMILE_IMAGE_ANIMATED_HINT_LOOP
140#define EVAS_IMAGE_ANIMATED_HINT_PINGPONG EMILE_IMAGE_ANIMATED_HINT_PINGPONG
141
142typedef Emile_Image_Scale_Hint Evas_Image_Scale_Hint; /**< How an image's data is to be treated by Evas, with regard to scaling cache */
143
144#define EVAS_IMAGE_SCALE_HINT_NONE EMILE_IMAGE_SCALE_HINT_NONE
145#define EVAS_IMAGE_SCALE_HINT_DYNAMIC EMILE_IMAGE_SCALE_HINT_DYNAMIC
146#define EVAS_IMAGE_SCALE_HINT_STATIC EMILE_IMAGE_SCALE_HINT_STATIC
148 147
149/** 148/**
150 * Colorspaces for pixel data supported by Evas 149 * Colorspaces for pixel data supported by Evas
151 * @ingroup Evas_Object_Image 150 * @ingroup Evas_Object_Image
152 */ 151 */
153typedef enum _Evas_Colorspace 152typedef Emile_Colorspace Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
154{ 153
155 EVAS_COLORSPACE_ARGB8888, /**< ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */ 154#define EVAS_COLORSPACE_ARGB8888 EMILE_COLORSPACE_ARGB8888
156 /* these are not currently supported - but planned for the future */ 155#define EVAS_COLORSPACE_YCBCR422P601_PL EMILE_COLORSPACE_YCBCR422P601_PL
157 EVAS_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */ 156#define EVAS_COLORSPACE_YCBCR422P709_PL EMILE_COLORSPACE_YCBCR422P709_PL
158 EVAS_COLORSPACE_YCBCR422P709_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */ 157#define EVAS_COLORSPACE_RGB565_A5P EMILE_COLORSPACE_RGB565_A5P
159 EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */ 158#define EVAS_COLORSPACE_GRY8 EMILE_COLORSPACE_GRY8
160 EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */ 159#define EVAS_COLORSPACE_YCBCR422601_PL EMILE_COLORSPACE_YCBCR422601_PL
161 EVAS_COLORSPACE_YCBCR422601_PL, /**< YCbCr 4:2:2, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */ 160#define EVAS_COLORSPACE_YCBCR420NV12601_PL EMILE_COLORSPACE_YCBCR420NV12601_PL
162 EVAS_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */ 161#define EVAS_COLORSPACE_YCBCR420TM12601_PL EMILE_COLORSPACE_YCBCR420TM12601_PL
163 EVAS_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */ 162#define EVAS_COLORSPACE_AGRY88 EMILE_COLORSPACE_AGRY88
164 EVAS_COLORSPACE_AGRY88, /**< AY 8bits Alpha and 8bits Grey, accessed 1 16bits at a time */
165 // ETC1/2 support 163 // ETC1/2 support
166 EVAS_COLORSPACE_ETC1, /**< OpenGL ETC1 encoding of RGB texture (4 bit per pixel) @since 1.10 */ 164#define EVAS_COLORSPACE_ETC1 EMILE_COLORSPACE_ETC1
167 EVAS_COLORSPACE_RGB8_ETC2, /**< OpenGL GL_COMPRESSED_RGB8_ETC2 texture compression format (4 bit per pixel) @since 1.10 */ 165#define EVAS_COLORSPACE_RGB8_ETC2 EMILE_COLORSPACE_RGB8_ETC2
168 EVAS_COLORSPACE_RGBA8_ETC2_EAC, /**< OpenGL GL_COMPRESSED_RGBA8_ETC2_EAC texture compression format, supports alpha (8 bit per pixel) @since 1.10 */ 166#define EVAS_COLORSPACE_RGBA8_ETC2_EAC EMILE_COLORSPACE_RGBA8_ETC2_EAC
169 EVAS_COLORSPACE_ETC1_ALPHA, /**< ETC1 with alpha support using two planes: ETC1 RGB and ETC1 grey for alpha @since 1.11 */ 167#define EVAS_COLORSPACE_ETC1_ALPHA EMILE_COLORSPACE_ETC1_ALPHA
170 // S3TC support 168 // S3TC support
171 EVAS_COLORSPACE_RGB_S3TC_DXT1, /**< OpenGL COMPRESSED_RGB_S3TC_DXT1_EXT format with RGB only. @since 1.11 */ 169#define EVAS_COLORSPACE_RGB_S3TC_DXT1 EMILE_COLORSPACE_RGB_S3TC_DXT1
172 EVAS_COLORSPACE_RGBA_S3TC_DXT1, /**< OpenGL COMPRESSED_RGBA_S3TC_DXT1_EXT format with RGBA punchthrough. @since 1.11 */ 170#define EVAS_COLORSPACE_RGBA_S3TC_DXT1 EMILE_COLORSPACE_RGBA_S3TC_DXT1
173 EVAS_COLORSPACE_RGBA_S3TC_DXT2, /**< DirectDraw DXT2 format with premultiplied RGBA. Not supported by OpenGL itself. @since 1.11 */ 171#define EVAS_COLORSPACE_RGBA_S3TC_DXT2 EMILE_COLORSPACE_RGBA_S3TC_DXT2
174 EVAS_COLORSPACE_RGBA_S3TC_DXT3, /**< OpenGL COMPRESSED_RGBA_S3TC_DXT3_EXT format with RGBA. @since 1.11 */ 172#define EVAS_COLORSPACE_RGBA_S3TC_DXT3 EMILE_COLORSPACE_RGBA_S3TC_DXT3
175 EVAS_COLORSPACE_RGBA_S3TC_DXT4, /**< DirectDraw DXT4 format with premultiplied RGBA. Not supported by OpenGL itself. @since 1.11 */ 173#define EVAS_COLORSPACE_RGBA_S3TC_DXT4 EMILE_COLORSPACE_RGBA_S3TC_DXT4
176 EVAS_COLORSPACE_RGBA_S3TC_DXT5, /**< OpenGL COMPRESSED_RGBA_S3TC_DXT5_EXT format with RGBA. @since 1.11 */ 174#define EVAS_COLORSPACE_RGBA_S3TC_DXT5 EMILE_COLORSPACE_RGBA_S3TC_DXT5
177} Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
178
179struct _Evas_Image_Property
180{
181 unsigned int w;
182 unsigned int h;
183
184 unsigned char scale;
185
186 Eina_Bool rotated;
187 Eina_Bool alpha;
188 Eina_Bool premul;
189 Eina_Bool alpha_sparse;
190
191 const Evas_Colorspace *cspaces; /**< Specify the color space handled by the loader @since 1.10 */
192 Evas_Colorspace cspace; /**< Specify the color space handle by the engine @since 1.10 */
193
194 struct {
195 unsigned char l, r, t, b; /**< Specify the dimensions of duplicated pixels borders for OpenGL compressed textures, set by the loader. @since 1.11 */
196 } borders;
197
198 Eina_Bool flipped;
199};
200
201struct _Evas_Image_Animated
202{
203 Eina_List *frames;
204
205 Evas_Image_Animated_Loop_Hint loop_hint;
206
207 int frame_count;
208 int loop_count;
209 int cur_frame;
210
211 Eina_Bool animated;
212};
213
214struct _Evas_Image_Load_Opts
215{
216 struct {
217 unsigned int x, y, w, h;
218 } region;
219 struct {
220 int src_x, src_y, src_w, src_h;
221 int dst_w, dst_h;
222 int smooth;
223 Evas_Image_Scale_Hint scale_hint;
224 } scale_load;
225 double dpi; // if > 0.0 use this
226 unsigned int w, h; // if > 0 use this
227 unsigned int degree;//if>0 there is some info related with rotation
228 int scale_down_by; // if > 1 then use this
229
230 Eina_Bool orientation; // if EINA_TRUE => should honor orientation information provided by file (like jpeg exif info)
231};
232 175
233struct _Evas_Image_Load_Func 176struct _Evas_Image_Load_Func
234{ 177{