changeset 2733:4dddb055d2cd

add prostproc/rgb2rgb
author pontscho
date Tue, 06 Nov 2001 12:32:27 +0000
parents ae79207a3055
children 4ce165aa0135
files Gui/mplayer/gtk/fs.h Gui/wm/ws.c Gui/wm/wsconv.c
diffstat 3 files changed, 51 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/fs.h	Tue Nov 06 11:22:40 2001 +0000
+++ b/Gui/mplayer/gtk/fs.h	Tue Nov 06 12:32:27 2001 +0000
@@ -263,6 +263,8 @@
  strcpy( gtkShMem->fs.filename,fsSelectedFile );
 printf( "----gtk---> directory: %s\n",fsSelectedDirectory );
 printf( "----gtk---> filename: %s\n",fsSelectedFile );
+printf( "----gtksm-> directory: %s\n",gtkShMem->fs.dir );
+printf( "----gtksm-> filename: %s\n",gtkShMem->fs.filename );
  item=fsTopList_items;
  while( item )
   {
--- a/Gui/wm/ws.c	Tue Nov 06 11:22:40 2001 +0000
+++ b/Gui/wm/ws.c	Tue Nov 06 12:32:27 2001 +0000
@@ -16,9 +16,12 @@
 #include <unistd.h>
 #include <errno.h>
 
+#include <inttypes.h>
+
 #include "ws.h"
 #include "wsconv.h"
 #include "../../config.h"
+#include "../../postproc/rgb2rgb.h"
 
 #include <X11/extensions/XShm.h>
 #ifdef HAVE_XSHAPE
@@ -227,34 +230,57 @@
 #endif
  initConverter();
  wsOutMask=wsGetOutMask();
+ #ifdef DEBUG
+  fprintf( stderr,"[ws] Initialized converter: " );
+ #endif
  switch ( wsOutMask )
   {
    case wsRGB32:
+     #ifdef DEBUG
+      fprintf( stderr,"rgb32 to rgb32\n" );
+     #endif
      wsConvFunc=BGR8880_to_RGB8880_c;
      break;
    case wsBGR32:
+     #ifdef DEBUG
+      fprintf( stderr,"rgb32 to bgr32\n" );
+     #endif
      wsConvFunc=BGR8880_to_BGR8880_c;
      break;
    case wsRGB24:
-     #ifdef xHAVE_MMX
-      wsConvFunc=BGR8880_to_RGB888_mmx;
-     #else
-      wsConvFunc=BGR8880_to_RGB888_c;
+     #ifdef DEBUG
+      fprintf( stderr,"rgb32 to rgb24\n" );
      #endif
+     wsConvFunc=rgb32to24;
      break;
    case wsBGR24:
+     #ifdef DEBUG
+      fprintf( stderr,"rgb32 to bgr24\n" );
+     #endif
      wsConvFunc=BGR8880_to_BGR888_c;
      break;
    case wsRGB16:
-     wsConvFunc=BGR8880_to_RGB565_c;
+     #ifdef DEBUG
+      fprintf( stderr,"rgb32 to rgb16\n" );
+     #endif
+     wsConvFunc=rgb32to16;
      break;
    case wsBGR16:
+     #ifdef DEBUG
+      fprintf( stderr,"rgb32 to bgr16\n" );
+     #endif
      wsConvFunc=BGR8880_to_BGR565_c;
      break;
    case wsRGB15:
-     wsConvFunc=BGR8880_to_RGB555_c;
+     #ifdef DEBUG
+      fprintf( stderr,"rgb32 to rgb15\n" );
+     #endif
+     wsConvFunc=rgb32to15;
      break;
    case wsBGR15:
+     #ifdef DEBUG
+      fprintf( stderr,"rgb32 to bgr15\n" );
+     #endif
      wsConvFunc=BGR8880_to_BGR555_c;
      break;
   }
@@ -784,7 +810,7 @@
 //    Put 'Image' to window.
 // ----------------------------------------------------------------------------------------------
 void wsConvert( wsTWindow * win,unsigned char * Image,unsigned int Size )
-{ if ( wsConvFunc ) wsConvFunc( Image,win->ImageData,win->xImage->width * win->xImage->height ); }
+{ if ( wsConvFunc ) wsConvFunc( Image,win->ImageData,win->xImage->width * win->xImage->height * 4 ); }
 
 void wsPutImage( wsTWindow * win )
 {
@@ -890,10 +916,10 @@
    case wsRGB24: color=( r << 16 ) + ( g << 8 ) + b;  break;
    case wsBGR32:
    case wsBGR24: color=( b << 16 ) + ( g << 8 ) + r;  break;
-   case wsRGB16: PACK_RGB16( r,g,b,color ); break;
-   case wsBGR16: PACK_RGB16( b,g,r,color ); break;
-   case wsRGB15: PACK_RGB15( r,g,b,color ); break;
-   case wsBGR15: PACK_RGB15( b,g,r,color ); break;
+   case wsRGB16: PACK_RGB16( b,g,r,color ); break;
+   case wsBGR16: PACK_RGB16( r,g,b,color ); break;
+   case wsRGB15: PACK_RGB15( b,g,r,color ); break;
+   case wsBGR15: PACK_RGB15( r,g,b,color ); break;
   }
  XSetWindowBackground( wsDisplay,win->WindowID,color );
 }
@@ -907,10 +933,10 @@
    case wsRGB24: color=( r << 16 ) + ( g << 8 ) + b;  break;
    case wsBGR32:
    case wsBGR24: color=( b << 16 ) + ( g << 8 ) + r;  break;
-   case wsRGB16: PACK_RGB16( r,g,b,color ); break;
-   case wsBGR16: PACK_RGB16( b,g,r,color ); break;
-   case wsRGB15: PACK_RGB15( r,g,b,color ); break;
-   case wsBGR15: PACK_RGB15( b,g,r,color ); break;
+   case wsRGB16: PACK_RGB16( b,g,r,color ); break;
+   case wsBGR16: PACK_RGB16( r,g,b,color ); break;
+   case wsRGB15: PACK_RGB15( b,g,r,color ); break;
+   case wsBGR15: PACK_RGB15( r,g,b,color ); break;
   }
  XSetForeground( wsDisplay,win->wGC,color );
 }
--- a/Gui/wm/wsconv.c	Tue Nov 06 11:22:40 2001 +0000
+++ b/Gui/wm/wsconv.c	Tue Nov 06 12:32:27 2001 +0000
@@ -22,7 +22,7 @@
 {
  unsigned short pixel;
  int i;
- for(i = 0; i < num_pixels; i++)
+ for(i = 0; i < num_pixels / 4; i++)
   {
    PACK_RGB15(in_pixels[0],in_pixels[1],in_pixels[2],pixel);
    *(unsigned short*)out_pixels = pixel;
@@ -35,7 +35,7 @@
 {
  unsigned short pixel;
  int i;
- for(i = 0; i < num_pixels; i++)
+ for(i = 0; i < num_pixels / 4; i++)
   {
    PACK_RGB15(in_pixels[2],in_pixels[1],in_pixels[0],pixel);
    *(unsigned short*)out_pixels = pixel;
@@ -48,7 +48,7 @@
 {
  unsigned short pixel;
  int i;
- for(i = 0; i < num_pixels; i++)
+ for(i = 0; i < num_pixels / 4; i++)
   {
    PACK_RGB16(in_pixels[0],in_pixels[1],in_pixels[2],pixel);
    *(unsigned short*)out_pixels = pixel;
@@ -61,7 +61,7 @@
 {
  unsigned short pixel;
  int i;
- for(i = 0; i < num_pixels; i++)
+ for(i = 0; i < num_pixels / 4; i++)
   {
    PACK_RGB16(in_pixels[2],in_pixels[1],in_pixels[0],pixel);
    *(unsigned short*)out_pixels = pixel;
@@ -73,7 +73,7 @@
 void BGR8880_to_RGB888_c( unsigned char * in_pixels, unsigned char * out_pixels,int num_pixels )
 {
  int i;
- for(i = 0; i < num_pixels; i++)
+ for(i = 0; i < num_pixels / 4; i++)
   {
    COPY_RGB_24(in_pixels,out_pixels);
    in_pixels += 4;
@@ -84,7 +84,7 @@
 void BGR8880_to_BGR888_c( unsigned char * in_pixels, unsigned char * out_pixels,int num_pixels )
 {
  int i;
- for(i = 0; i < num_pixels; i++)
+ for(i = 0; i < num_pixels / 4; i++)
   {
    SWAP_RGB_24(in_pixels,out_pixels);
    in_pixels += 4;
@@ -95,7 +95,7 @@
 void BGR8880_to_BGR8880_c( unsigned char * in_pixels, unsigned char * out_pixels,int num_pixels )
 {
  int i;
- for(i = 0; i < num_pixels; i++)
+ for(i = 0; i < num_pixels / 4; i++)
   {
    SWAP_RGB_24(in_pixels,out_pixels);
    in_pixels += 4;
@@ -104,7 +104,7 @@
 }
 
 void BGR8880_to_RGB8880_c( unsigned char * in_pixels, unsigned char * out_pixels,int num_pixels )
-{ memcpy( out_pixels,in_pixels,num_pixels * 4 ); }
+{ memcpy( out_pixels,in_pixels,num_pixels ); }
 
 /*