rga 格式转换到buffer指定位置

#define imcvtcolorEX(src, dst, sfmt, dfmt, nposX,nposY, ...) \
    ({ \
        IM_STATUS ret = IM_STATUS_SUCCESS; \
        int args[] = {__VA_ARGS__}; \
        int argc = sizeof(args)/sizeof(int); \
        if (argc == 0) { \
            ret = imcvtcolorEX_t(src, dst, sfmt, dfmt, nposX,nposY,IM_COLOR_SPACE_DEFAULT, 1); \
        } else if (argc == 1){ \
            ret = imcvtcolorEX_t(src, dst, sfmt, dfmt, nposX,nposY, args[0], 1); \
        } else if (argc == 2){ \
            ret = imcvtcolorEX_t(src, dst, sfmt, dfmt, nposX,nposY, args[0], args[1]); \
        } else { \
            ret = IM_STATUS_INVALID_PARAM; \
            printf("invalid parameter\n"); \
        } \
        ret; \
    })

IM_API IM_STATUS imcvtcolorEX_t(rga_buffer_t src, rga_buffer_t dst, int sfmt, int dfmt, int nposX,int nposY, int mode, int sync);
IM_API IM_STATUS imcvtcolorEX_t(rga_buffer_t src, rga_buffer_t dst, int sfmt, int dfmt, int nposX,int nposY, int mode, int sync){
    int usage = 0;
    IM_STATUS ret = IM_STATUS_NOERROR;

    rga_buffer_t pat;

    im_rect srect;
    im_rect drect;
    im_rect prect;

    empty_structure(NULL, NULL, &pat, &srect, &drect, &prect);

    src.format = sfmt;
    dst.format = dfmt;

    dst.color_space_mode = mode;

    if (sync == 0)
        usage |= IM_SYNC;


	srect.x = 0 ;
    srect.y = 0;
	srect.width = src.width ;
    srect.height = src.height;
    drect.x = nposX;
    drect.y = nposY;
    drect.width = dst.width;
    drect.height = dst.height;

    ret = improcess(src, dst, pat, srect, drect, prect, usage);

    return ret;
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

sunxiaopengsun

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值