}
static inline void *
+evas_common_convert_agry88_to_argb8888(const void *data, int w, int h, int stride, Eina_Bool has_alpha)
+{
+ const DATA16 *src, *end;
+ DATA32 *ret, *dst;
+
+ src = data;
+ end = src + ((stride >> 1) * h);
+ ret = malloc(w * h * sizeof(DATA32));
+ dst = ret;
+
+ if (has_alpha)
+ {
+ for (; src < end; src++, dst++)
+ {
+ int c = (*src) & 0xFF;
+ *dst = ARGB_JOIN((*src >> 8), c, c, c);
+ }
+ }
+ else
+ {
+ for (; src < end; src++, dst++)
+ {
+ int c = (*src) & 0xFF;
+ *dst = ARGB_JOIN(0xFF, c, c, c);
+ }
+ }
+
+ return ret;
+}
+
+void *
+evas_common_convert_agry88_to(const void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace)
+{
+ switch (cspace) {
+ case EVAS_COLORSPACE_ARGB8888:
+ return evas_common_convert_agry88_to_argb8888(data, w, h, stride, has_alpha);
+ default:
+ return NULL;
+ }
+}
+
+static inline void *
+evas_common_convert_gry8_to_argb8888(const void *data, int w, int h, int stride, Eina_Bool has_alpha)
+{
+ const DATA8 *src, *end;
+ DATA32 *ret, *dst;
+
+ src = data;
+ end = src + (stride * h);
+ ret = malloc(w * h * sizeof(DATA32));
+ dst = ret;
+
+ if (has_alpha)
+ {
+ for (; src < end; src++, dst++)
+ {
+ int c = (*src) & 0xFF;
+ *dst = ARGB_JOIN(c, c, c, c);
+ }
+ }
+ else
+ {
+ for (; src < end; src++, dst++)
+ {
+ int c = (*src) & 0xFF;
+ *dst = ARGB_JOIN(0xFF, c, c, c);
+ }
+ }
+
+ return ret;
+}
+
+void *
+evas_common_convert_gry8_to(const void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace)
+{
+ switch (cspace) {
+ case EVAS_COLORSPACE_ARGB8888:
+ return evas_common_convert_gry8_to_argb8888(data, w, h, stride, has_alpha);
+ default:
+ return NULL;
+ }
+}
+
+static inline void *
evas_common_convert_argb8888_to_a8(void *data, int w, int h, int stride, Eina_Bool has_alpha)
{
uint32_t *src, *end;
return ret;
}
-
-
EAPI void *
evas_common_convert_argb8888_to(void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace)
{
EAPI void *evas_common_convert_yuv_422_601_to (void *data, int w, int h, Evas_Colorspace cspace);
EAPI void *evas_common_convert_yuv_420_601_to (void *data, int w, int h, Evas_Colorspace cspace);
EAPI void *evas_common_convert_yuv_420T_601_to(void *data, int w, int h, Evas_Colorspace cspace);
+void *evas_common_convert_agry88_to(const void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace);
+void *evas_common_convert_gry8_to(const void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace);
#endif /* _EVAS_CONVERT_COLORSPACE_H */
switch (im->cs.space)
{
case EVAS_COLORSPACE_ARGB8888:
+ case EVAS_COLORSPACE_AGRY88:
+ case EVAS_COLORSPACE_GRY8:
if ((!im->im) || (image_data != im->im->image.data))
{
im2 = eng_image_new_from_data(data, im->w, im->h, image_data,
evas_gl_common_image_dirty(im, 0, 0, 0, 0);
break;
default:
- abort();
- break;
+ ERR("colorspace %d is not supported here", im->cs.space);
+ return NULL;
}
return im;
}