mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 09:29:29 +00:00
bigendian fix by Colin Leroy <colin@colino.net>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6055 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
c00658414e
commit
3303b43ca4
17
Gui/bitmap.c
17
Gui/bitmap.c
@ -30,9 +30,16 @@ int conv24to32( txSample * bf )
|
||||
memset( bf->Image,0,bf->ImageSize );
|
||||
for ( c=0,i=0;i < (int)(bf->Width * bf->Height * 3); )
|
||||
{
|
||||
bf->Image[c++]=tmpImage[i++];
|
||||
bf->Image[c++]=tmpImage[i++];
|
||||
bf->Image[c++]=tmpImage[i++]; c++;
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
bf->Image[c++]=tmpImage[i++]; //red
|
||||
bf->Image[c++]=tmpImage[i++]; //green
|
||||
bf->Image[c++]=tmpImage[i++]; c++; //blue
|
||||
#else
|
||||
unsigned char t=tmpImage[i++];
|
||||
bf->Image[c++]=tmpImage[i++]; //green
|
||||
bf->Image[c++]=t; c++; //red
|
||||
bf->Image[c++]=tmpImage[i++]; //blue
|
||||
#endif
|
||||
}
|
||||
free( tmpImage );
|
||||
}
|
||||
@ -55,7 +62,11 @@ void bgr2rgb( txSample * bf )
|
||||
void Normalize( txSample * bf )
|
||||
{
|
||||
int i;
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0;
|
||||
#else
|
||||
for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i]=0;
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned char tmp[512];
|
||||
|
@ -30,9 +30,16 @@ int conv24to32( txSample * bf )
|
||||
memset( bf->Image,0,bf->ImageSize );
|
||||
for ( c=0,i=0;i < (int)(bf->Width * bf->Height * 3); )
|
||||
{
|
||||
bf->Image[c++]=tmpImage[i++];
|
||||
bf->Image[c++]=tmpImage[i++];
|
||||
bf->Image[c++]=tmpImage[i++]; c++;
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
bf->Image[c++]=tmpImage[i++]; //red
|
||||
bf->Image[c++]=tmpImage[i++]; //green
|
||||
bf->Image[c++]=tmpImage[i++]; c++; //blue
|
||||
#else
|
||||
unsigned char t=tmpImage[i++];
|
||||
bf->Image[c++]=tmpImage[i++]; //green
|
||||
bf->Image[c++]=t; c++; //red
|
||||
bf->Image[c++]=tmpImage[i++]; //blue
|
||||
#endif
|
||||
}
|
||||
free( tmpImage );
|
||||
}
|
||||
@ -55,7 +62,11 @@ void bgr2rgb( txSample * bf )
|
||||
void Normalize( txSample * bf )
|
||||
{
|
||||
int i;
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0;
|
||||
#else
|
||||
for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i]=0;
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned char tmp[512];
|
||||
|
Loading…
Reference in New Issue
Block a user