add prostproc/rgb2rgb

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2734 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2001-11-06 12:32:27 +00:00
parent dfe91abaa2
commit f01615cba3
3 changed files with 51 additions and 23 deletions

View File

@ -263,6 +263,8 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
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 )
{

View File

@ -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 @@ if(mDisplay){
#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 @@ void wsDoExit( void )
// 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 @@ void wsSetBackgroundRGB( wsTWindow * win,int r,int g,int b )
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 @@ void wsSetForegroundRGB( wsTWindow * win,int r,int g,int b )
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 );
}

View File

@ -22,7 +22,7 @@ void BGR8880_to_RGB555_c( unsigned char * in_pixels, unsigned char * out_pixels,
{
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 @@ void BGR8880_to_BGR555_c( unsigned char * in_pixels, unsigned char * out_pixels,
{
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 @@ void BGR8880_to_RGB565_c( unsigned char * in_pixels, unsigned char * out_pixels,
{
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 @@ void BGR8880_to_BGR565_c( unsigned char * in_pixels, unsigned char * out_pixels,
{
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_BGR565_c( unsigned char * in_pixels, unsigned char * out_pixels,
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_RGB888_c( unsigned char * in_pixels, unsigned char * out_pixels,
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_BGR888_c( unsigned char * in_pixels, unsigned char * out_pixels,
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_BGR8880_c( unsigned char * in_pixels, unsigned char * out_pixels
}
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 ); }
/*