summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile.am17
-rw-r--r--misc/xine-lib.spec.in1
-rw-r--r--misc/xine-logoconv.c23
3 files changed, 32 insertions, 9 deletions
diff --git a/misc/Makefile.am b/misc/Makefile.am
index f207b204a..73dfd9844 100644
--- a/misc/Makefile.am
+++ b/misc/Makefile.am
@@ -2,13 +2,24 @@ SUBDIRS = fonts
EXTRA_DIST = autogen.sh upload.pl SlackBuild.in SlackBuild build_rpms.sh \
xine-lib.spec.in xine-lib.spec \
- xine_logo.png xine_logo.zyuy2 xine-fontconv.c xine-logoconv.c
-
-bin_SCRIPTS = xine-config
+ xine_logo.png xine_logo.zyuy2 xine-fontconv.c
datadir = $(XINE_SKINDIR)
data_DATA = xine_logo.png xine_logo.zyuy2
+bin_SCRIPTS = xine-config
+
+if HAVE_IMLIB
+logoconv = xine-logoconv
+endif
+
+bin_PROGRAMS = $(logoconv)
+
+CFLAGS = $(IMLIB_CFLAGS)
+xine_logoconv_SOURCES = xine-logoconv.c
+xine_logoconv_LDADD = $(IMLIB_LIBS)
+
+
debug:
install-debug: install
diff --git a/misc/xine-lib.spec.in b/misc/xine-lib.spec.in
index ab8bc10d1..81ba69005 100644
--- a/misc/xine-lib.spec.in
+++ b/misc/xine-lib.spec.in
@@ -276,6 +276,7 @@ rm -rf $RPM_BUILD_ROOT
%{prefix}/lib/xine/plugins/xineplug_vo_out_xshm.la
%{prefix}/lib/xine/plugins/xineplug_vo_out_xshm.so
# lib, logo and fonts.
+@HAVE_IMLIB_TRUE@%{prefix}/bin/xine-logoconv
%{prefix}/lib/libxine*.la
%{prefix}/lib/libxine*.so*
%{prefix}/share/xine/skins/xine_logo.png
diff --git a/misc/xine-logoconv.c b/misc/xine-logoconv.c
index 20f4a0a4b..a59471239 100644
--- a/misc/xine-logoconv.c
+++ b/misc/xine-logoconv.c
@@ -35,6 +35,9 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -97,11 +100,19 @@ static void save_image (char *oldname, ImlibImage *img) {
double y, u, v;
unsigned char cy,cu,cv;
+#ifdef WORDS_BIGENDIAN
r = img->rgb_data[(px+py*w)*3];
g = img->rgb_data[(px+py*w)*3+1];
b = img->rgb_data[(px+py*w)*3+2];
+#else
+ r = img->rgb_data[(px+py*w)*3+2];
+ g = img->rgb_data[(px+py*w)*3+1];
+ b = img->rgb_data[(px+py*w)*3];
+#endif
- y = LUMARED*r + LUMAGREEN*g + LUMABLUE*b;
+ y = (LUMARED*r) + (LUMAGREEN*g) + (LUMABLUE*b);
+ // u = (b-y) / (2 - 2*LUMABLUE);
+ // v = (r-y) / (2 - 2*LUMABLUE);
u = (b-y) / (2 - 2*LUMABLUE);
v = (r-y) / (2 - 2*LUMABLUE);
@@ -128,9 +139,9 @@ static void save_image (char *oldname, ImlibImage *img) {
int main(int argc, char *argv[]) {
- Display *display;
- ImlibData *imlib_data;
- ImlibImage *img;
+ Display *display;
+ ImlibData *imlib_data;
+ ImlibImage *img;
if (argc != 2) {
printf ("usage: %s foo.png\n", argv[0]);
@@ -141,8 +152,8 @@ int main(int argc, char *argv[]) {
printf ("failed to open X11 display\n");
exit (1);
}
-
- if (!(imlib_data = Imlib_init (display))) {
+
+ if (!(imlib_data = Imlib_init(display))) {
printf ("failed to initialize imlib\n");
exit(1);
}