Subject: [E-devel] [evas] Add RGBA -> grayscale 64 entries palette conversion
This is needed for E-Ink devices outta there. Names of new files,
configure.ac variables and macros are awful, suggestions are welcome.
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@41825
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
## Convert to 32bpp RGB with rotation of 90
EVAS_CONVERT_ROT(32, RGB, 90)
+#######################################
+## Convert to 8bpp grayscale, 64-palette
+conv_8_grayscale_64="yes"
+AC_MSG_CHECKING(whether to build 8bpp grayscale 64-palette converter code)
+AC_ARG_ENABLE(convert-8-grayscale-64,
+ AC_HELP_STRING([--disable-convert-8-grayscale-64], [disable 8bpp grayscale 64-palette converter code]),
+ [
+ if test "$enableval" = "xyes"; then
+ AC_DEFINE(BUILD_CONVERT_8_GRAYSCALE_64, 1, [8bpp Grayscale 64-palette Converter Support])
+ conv_8_grayscale_64="yes"
+ else
+ conv_8_grayscale_64="no"
+ fi
+ ], [
+ if test "x$conv_8_grayscale_64" = "xyes"; then
+ AC_DEFINE(BUILD_CONVERT_8_GRAYSCALE_64, 1, [32bpp Grayscale 64-palette Converter Support])
+ fi
+ ]
+)
+AC_MSG_RESULT($conv_8_grayscale_64)
+
## valgrind
want_valgrind="no"
have_valgrind="no"
echo " 8bpp RGB 221............: $conv_8_rgb_221"
echo " 8bpp RGB 121............: $conv_8_rgb_121"
echo " 8bpp RGB 111............: $conv_8_rgb_111"
+echo " 8bpp Grayscale 64-pal...: $conv_8_grayscale_64"
# FIXME: add grayscale and B&W support
echo " 16bpp RGB 565...........: $conv_16_rgb_565"
echo " 16bpp BGR 565...........: $conv_16_bgr_565"
evas_convert_rgb_24.c \
evas_convert_rgb_32.c \
evas_convert_rgb_8.c \
+evas_convert_grypal_6.c \
evas_convert_yuv.c \
evas_cpu.c \
evas_draw_main.c \
evas_convert_gry_1.h \
evas_convert_gry_4.h \
evas_convert_gry_8.h \
+evas_convert_grypal_6.h \
evas_convert_main.h \
evas_convert_rgb_16.h \
evas_convert_rgb_24.h \
--- /dev/null
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
+#include "evas_common.h"
+#include "evas_convert_grypal_6.h"
+
+#ifdef BUILD_CONVERT_8_GRAYSCALE_64
+void evas_common_convert_rgba_to_8bpp_pal_gray64 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
+{
+ DATA32 *src_ptr;
+ DATA8 *dst_ptr;
+ int x, y;
+ DATA8 Y;
+
+ dst_ptr = dst;
+ CONVERT_LOOP_START_ROT_0();
+
+ /* RGB -> YUV conversion */
+ Y = ((R_VAL(src_ptr) * 76) +
+ (G_VAL(src_ptr) * 151) +
+ (B_VAL(src_ptr) * 29)) >> 10;
+ *dst_ptr = pal[Y];
+
+ CONVERT_LOOP_END_ROT_0();
+}
+#endif
--- /dev/null
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+
+#ifndef _EVAS_CONVERT_GRY_4_H
+#define _EVAS_CONVERT_GRY_4_H
+
+void evas_common_convert_rgba_to_8bpp_pal_gray64 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
+
+#endif /* _EVAS_CONVERT_GRY_4_H */
#include "evas_convert_rgb_16.h"
#include "evas_convert_rgb_24.h"
#include "evas_convert_rgb_32.h"
+#include "evas_convert_grypal_6.h"
#include "evas_convert_yuv.h"
#ifdef USE_DITHER_44
if (pal_mode == PAL_MODE_RGB111)
return evas_common_convert_rgba_to_8bpp_rgb_111_dith;
#endif
+#ifdef BUILD_CONVERT_8_GRAYSCALE_64
+ if (pal_mode == PAL_MODE_GRAY64)
+ return evas_common_convert_rgba_to_8bpp_pal_gray64;
+#endif
}
if (depth == 1)
{