summaryrefslogtreecommitdiff
path: root/misc/xine-logoconv.c
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-03-28 12:44:37 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-03-28 12:44:37 +0000
commit12ee56f278ece1d6e2e5a00ccb48ba94abb6addb (patch)
tree0afa8544764be5529fb821e7028d932897e73e32 /misc/xine-logoconv.c
parent4f0b8ee4cbf756e650af38472cd0f45b50978d2b (diff)
downloadxine-lib-12ee56f278ece1d6e2e5a00ccb48ba94abb6addb.tar.gz
xine-lib-12ee56f278ece1d6e2e5a00ccb48ba94abb6addb.tar.bz2
Ability to change logo at run-time. Fix endianness in xine-logoconv, build
and install it by default. CVS patchset: 1642 CVS date: 2002/03/28 12:44:37
Diffstat (limited to 'misc/xine-logoconv.c')
-rw-r--r--misc/xine-logoconv.c23
1 files changed, 17 insertions, 6 deletions
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);
}