mirror of https://github.com/mpv-player/mpv
bpp != depth
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4187 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
358a7092d6
commit
491a353915
11
mp_image.h
11
mp_image.h
|
@ -13,9 +13,14 @@
|
||||||
// set if it's swapped plane/byteorder
|
// set if it's swapped plane/byteorder
|
||||||
#define MP_IMGFLAG_SWAPPED 0x40
|
#define MP_IMGFLAG_SWAPPED 0x40
|
||||||
|
|
||||||
|
#define MP_IMGTYPE_EXPORT 0
|
||||||
|
#define MP_IMGTYPE_STATIC 1
|
||||||
|
#define MP_IMGTYPE_TEMP 2
|
||||||
|
|
||||||
typedef struct mp_image_s {
|
typedef struct mp_image_s {
|
||||||
unsigned short flags;
|
unsigned short flags;
|
||||||
unsigned short bpp;
|
unsigned char type;
|
||||||
|
unsigned char bpp; // bits/pixel. NOT depth! for RGB it will be n*8
|
||||||
unsigned int imgfmt;
|
unsigned int imgfmt;
|
||||||
int width,height; // stored dimensions
|
int width,height; // stored dimensions
|
||||||
int x,y,w,h; // visible dimensions
|
int x,y,w,h; // visible dimensions
|
||||||
|
@ -30,11 +35,11 @@ static inline void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){
|
||||||
mpi->flags&=~(MP_IMGFLAG_PLANAR|MP_IMGFLAG_YUV|MP_IMGFLAG_SWAPPED);
|
mpi->flags&=~(MP_IMGFLAG_PLANAR|MP_IMGFLAG_YUV|MP_IMGFLAG_SWAPPED);
|
||||||
mpi->out_fmt=out_fmt;
|
mpi->out_fmt=out_fmt;
|
||||||
if( (out_fmt&IMGFMT_RGB_MASK) == IMGFMT_RGB ){
|
if( (out_fmt&IMGFMT_RGB_MASK) == IMGFMT_RGB ){
|
||||||
mpi->bpp=out_fmt&255;
|
mpi->bpp=((out_fmt&255)+7)&(~7);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( (out_fmt&IMGFMT_BGR_MASK) == IMGFMT_BGR ){
|
if( (out_fmt&IMGFMT_BGR_MASK) == IMGFMT_BGR ){
|
||||||
mpi->bpp=out_fmt&255;
|
mpi->bpp=((out_fmt&255)+7)&(~7);
|
||||||
mpi->flags|=MP_IMGFLAG_SWAPPED;
|
mpi->flags|=MP_IMGFLAG_SWAPPED;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue