Logo Search packages:      
Sourcecode: blender version File versions  Download package

int img_get_alpha_info ( const AVPicture src,
int  pix_fmt,
int  width,
int  height 
)

Tell if an image really has transparent alpha values.

Returns:
ored mask of FF_ALPHA_xxx constants

Definition at line 2323 of file imgconvert.c.

References PIX_FMT_PAL8, PIX_FMT_RGB555, and PIX_FMT_RGBA32.

{
    PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
    int ret;

    pf = &pix_fmt_info[pix_fmt];
    /* no alpha can be represented in format */
    if (!pf->is_alpha)
        return 0;
    switch(pix_fmt) {
    case PIX_FMT_RGBA32:
        ret = get_alpha_info_rgba32(src, width, height);
        break;
    case PIX_FMT_RGB555:
        ret = get_alpha_info_rgb555(src, width, height);
        break;
    case PIX_FMT_PAL8:
        ret = get_alpha_info_pal8(src, width, height);
        break;
    default:
        /* we do not know, so everything is indicated */
        ret = FF_ALPHA_TRANSP | FF_ALPHA_SEMI_TRANSP;
        break;
    }
    return ret;
}


Generated by  Doxygen 1.6.0   Back to index