Revision 0469baf1 libavcodec/imgconvert_template.h

View differences:

libavcodec/imgconvert_template.h
814 814

  
815 815
#endif /* defined(FMT_RGB24) || defined(FMT_RGBA32) */
816 816
        
817
#ifdef RGBA_IN
818

  
819
static int glue(get_alpha_info_, RGB_NAME)(AVPicture *src, int width, int height)
820
{
821
    const unsigned char *p;
822
    int src_wrap, ret, x, y;
823
    unsigned int r, g, b, a;
824

  
825
    p = src->data[0];
826
    src_wrap = src->linesize[0] - BPP * width;
827
    ret = 0;
828
    for(y=0;y<height;y++) {
829
        for(x=0;x<width;x++) {
830
            RGBA_IN(r, g, b, a, p);
831
            if (a == 0x00) {
832
                ret |= FF_ALPHA_TRANSP;
833
            } else if (a != 0xff) {
834
                ret |= FF_ALPHA_SEMI_TRANSP;
835
            }
836
            p += BPP;
837
        }
838
        p += src_wrap;
839
    }
840
    return ret;
841
}
842

  
843
#endif /* RGBA_IN */
844

  
817 845
#undef RGB_IN
818 846
#undef RGBA_IN
819 847
#undef RGB_OUT

Also available in: Unified diff