changeset 767:372042df5c77

Added support for flipped BGR/RGB via -flip cmdline switch.
author atmosfear
date Fri, 11 May 2001 14:41:47 +0000
parents 479f753a66ae
children 9ba4dd7015d2
files libvo/vo_x11.c
diffstat 1 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_x11.c	Fri May 11 14:40:19 2001 +0000
+++ b/libvo/vo_x11.c	Fri May 11 14:41:47 2001 +0000
@@ -89,6 +89,8 @@
 static int gXErrorFlag;
 static int CompletionType=-1;
 
+static int Flip_Flag;
+
 static void InstallXErrorHandler()
 {
         //XSetErrorHandler( HandleXError );
@@ -111,9 +113,10 @@
   int e=vo_x11_check_events(mDisplay);
 }
 
-static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d_height,uint32_t fullscreen,char *title,uint32_t format )
+static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d_height,uint32_t flags,char *title,uint32_t format )
 {
  int screen;
+ int fullscreen=0;
  int interval, prefer_blank, allow_exp, nothing;
  unsigned int fg,bg;
  char *hello=( title == NULL ) ? "X11 render" : title;
@@ -148,6 +151,9 @@
  hint.y=0;
  hint.width=image_width;
  hint.height=image_height;
+ 
+ if( flags&0x01 ) fullscreen = 1;
+ if( flags&0x08 ) Flip_Flag = 1;
 
 #ifdef HAVE_XF86VM
  if (fullscreen) {
@@ -434,6 +440,7 @@
   }
   else
    {
+    int i;
     int sbpp=( ( image_format&0xFF )+7 )/8;
     int dbpp=( bpp+7 )/8;
     char *d=ImageData;
@@ -490,7 +497,19 @@
       }
       else
 #endif
-       { memcpy( d,s,sbpp*image_width*image_height ); }
+       {
+        if( Flip_Flag )
+         {
+          s+=sbpp*image_width*image_height;
+	  for( i=0;i < image_height;i++ )
+           {
+	    s-=sbpp*image_width;
+	    memcpy( d,s,sbpp*image_width );
+	    d+=sbpp*image_width;
+	   }
+         }
+        else memcpy( d,s,sbpp*image_width*image_height );
+       }
    }
    else
     {