• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MLIB_IMAGE_CHECK函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MLIB_IMAGE_CHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ MLIB_IMAGE_CHECK函数的具体用法?C++ MLIB_IMAGE_CHECK怎么用?C++ MLIB_IMAGE_CHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MLIB_IMAGE_CHECK函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: __mlib_ImageGridWarp_Fp

mlib_status
__mlib_ImageGridWarp_Fp(
    mlib_image *dst,
    const mlib_image *src,
    const mlib_f32 *xWarpPos,
    const mlib_f32 *yWarpPos,
    mlib_d64 postShiftX,
    mlib_d64 postShiftY,
    mlib_s32 xStart,
    mlib_s32 xStep,
    mlib_s32 xNumCells,
    mlib_s32 yStart,
    mlib_s32 yStep,
    mlib_s32 yNumCells,
    mlib_filter filter,
    mlib_edge edge)
{
	mlib_type type;

	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);

	type = mlib_ImageGetType(dst);

	if (type != MLIB_FLOAT && type != MLIB_DOUBLE) {
		return (MLIB_FAILURE);
	}

	return mlib_ImageGridWarp_alltypes(dst, src, xWarpPos, yWarpPos,
	    postShiftX, postShiftY,
	    xStart, xStep, xNumCells, yStart, yStep, yNumCells, filter, edge);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:32,代码来源:mlib_ImageGridWarp_Fp.c


示例2: __mlib_ImageSubsampleAverage_ty_Fp

mlib_status
__mlib_ImageSubsampleAverage_ty_Fp(
    mlib_image *dst,
    const mlib_image *src,
    mlib_d64 xscale,
    mlib_d64 yscale,
    mlib_s32 ybegin)
{
	mlib_type type;

	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_TYPE_EQUAL(src, dst);
	MLIB_IMAGE_CHAN_EQUAL(src, dst);

	if (!(xscale > 0 && xscale <= 1 && yscale > 0 && yscale <= 1)) {
		return (MLIB_FAILURE);
	}

	type = mlib_ImageGetType(dst);

	switch (type) {
	case MLIB_FLOAT:
		return mlib_ImageSubsampleAverage_F32_main(dst, src, xscale,
		    yscale, ybegin);
	case MLIB_DOUBLE:
		return mlib_ImageSubsampleAverage_D64_main(dst, src, xscale,
		    yscale, ybegin);
	default:
		break;
	}

	return (MLIB_FAILURE);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:34,代码来源:mlib_ImageSubsampleAverage_Fp.c


示例3: __mlib_ImageDiv_Fp

mlib_status
__mlib_ImageDiv_Fp(
    mlib_image *dst,
    const mlib_image *src1,
    const mlib_image *src2)
{
	mlib_type type = mlib_ImageGetType(dst);

	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_CHECK(src1);
	MLIB_IMAGE_CHECK(src2);
	MLIB_IMAGE_FULL_EQUAL(dst, src1);
	MLIB_IMAGE_FULL_EQUAL(dst, src2);

	switch (type) {
	case MLIB_FLOAT:
		mlib_ImageDiv_Fp_F32(dst, src1, src2);
		return (MLIB_SUCCESS);

	case MLIB_DOUBLE:
		mlib_ImageDiv_Fp_D64(dst, src1, src2);
		return (MLIB_SUCCESS);

	default:
		return (MLIB_FAILURE);
	}
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:27,代码来源:mlib_ImageDiv_Fp.c


示例4: __mlib_ImageDivConstShift

mlib_status
__mlib_ImageDivConstShift(
    mlib_image *dst,
    const mlib_image *src,
    const mlib_s32 *consts,
    mlib_s32 shift)
{
	mlib_d64 dalpha[4], dbeta[4], dshift;
	mlib_s32 nchan, k;

	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_FULL_EQUAL(dst, src);
	nchan = mlib_ImageGetChannels(dst);

	if (shift < 0 || shift > 31)
		return (MLIB_OUTOFRANGE);

	dshift = (1u << shift);
	for (k = 0; k < nchan; k++) {
		dalpha[k] =
		    (consts[k] == 0) ? 2.0 * MLIB_S32_MAX : dshift / consts[k];
		dbeta[k] = 0;
	}

	return (__mlib_ImageScale2(dst, src, dalpha, dbeta));
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:27,代码来源:mlib_ImageDivConstShift.c


示例5: __mlib_ImageNotAnd

mlib_status
__mlib_ImageNotAnd(
    mlib_image *dst,
    const mlib_image *src1,
    const mlib_image *src2)
{
    MLIB_IMAGE_CHECK(src1);
    MLIB_IMAGE_CHECK(src2);
    MLIB_IMAGE_CHECK(dst);

    if ((mlib_ImageGetType(src1) == MLIB_BYTE) ||
            (mlib_ImageGetType(src1) == MLIB_SHORT) ||
            (mlib_ImageGetType(src1) == MLIB_USHORT) ||
            mlib_ImageGetType(src1) == MLIB_INT) {

        return (mlib_v_ImageLogic(dst, src1, src2));

    } else if (mlib_ImageGetType(src1) == MLIB_BIT) {

        if ((mlib_ImageGetBitOffset(src1) ==
                mlib_ImageGetBitOffset(dst)) &&
                (mlib_ImageGetBitOffset(src2) ==
                 mlib_ImageGetBitOffset(dst))) {
            return (mlib_v_ImageNotAnd_Bit(dst, src1, src2));
        } else {
            return (mlib_ImageNotAnd_Bit(dst, src1, src2));
        }

    } else
        return (MLIB_FAILURE);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:31,代码来源:mlib_v_ImageNotAnd.c


示例6: __mlib_ImageConstNotOr

mlib_status
__mlib_ImageConstNotOr(
    mlib_image *dst,
    const mlib_image *src,
    const mlib_s32 *c)
{
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);

	if ((mlib_ImageGetType(src) == MLIB_BYTE) ||
	    (mlib_ImageGetType(src) == MLIB_SHORT) ||
	    (mlib_ImageGetType(src) == MLIB_USHORT) ||
	    mlib_ImageGetType(src) == MLIB_INT) {

		return (mlib_v_ImageConstLogic(dst, src, c));

	} else if (mlib_ImageGetType(src) == MLIB_BIT) {

		if (mlib_ImageGetBitOffset(src) ==
		    mlib_ImageGetBitOffset(dst)) {
			return (mlib_v_ImageConstNotOr_Bit(dst, src, c));
		} else {
			return (mlib_ImageConstNotOr_Bit(dst, src, c));
		}

	} else
		return (MLIB_FAILURE);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:28,代码来源:mlib_v_ImageConstNotOr.c


示例7: __mlib_ImageSub

mlib_status
__mlib_ImageSub(
    mlib_image *dst,
    const mlib_image *src1,
    const mlib_image *src2)
{
	mlib_type dtype;

	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_CHECK(src1);
	MLIB_IMAGE_FULL_EQUAL(dst, src1);

	if (src2) {
/*  inplace -> NULL here (U16 case @ UltraIII needs it  */
		MLIB_IMAGE_CHECK(src2);
		MLIB_IMAGE_FULL_EQUAL(dst, src2);
	}

	dtype = mlib_ImageGetType(dst);

	if (dtype == MLIB_BYTE)
		return (mlib_v_ImageSub_U8(dst, src1, src2));
	else if (dtype == MLIB_SHORT)
		return (mlib_v_ImageSub_S16(dst, src1, src2));
	else if (dtype == MLIB_USHORT)
		return (mlib_v_ImageSub_U16(dst, src1, src2));
	else if (dtype == MLIB_INT)
		return (mlib_v_ImageSub_S32(dst, src1, src2));
	else
		return (MLIB_FAILURE);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:31,代码来源:mlib_v_ImageSub.c


示例8: __mlib_ImageCopy

mlib_status
__mlib_ImageCopy(
    mlib_image *dst,
    const mlib_image *src)
{
	mlib_s32 s_offset, d_offset, width, height;
	mlib_s32 size, s_stride, d_stride;
	mlib_u8 *sa, *da;
	mlib_s32 j;

	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_TYPE_EQUAL(src, dst);
	MLIB_IMAGE_CHAN_EQUAL(src, dst);
	MLIB_IMAGE_SIZE_EQUAL(src, dst);

	switch (mlib_ImageGetType(dst)) {
	case MLIB_BIT:

		sa = (mlib_u8 *)mlib_ImageGetData(src);
		da = (mlib_u8 *)mlib_ImageGetData(dst);

		width = mlib_ImageGetWidth(src) * mlib_ImageGetChannels(src);
		height = mlib_ImageGetHeight(src);

		if (!mlib_ImageIsNotOneDvector(src) &&
		    !mlib_ImageIsNotOneDvector(dst)) {
			size = height * (width >> 3);
			mlib_ImageCopy_na(sa, da, size);
		} else {
开发者ID:Aries85,项目名称:mediaLib,代码行数:30,代码来源:mlib_m_ImageCopy.c


示例9: __mlib_ImageColorConvert1_Fp

mlib_status
__mlib_ImageColorConvert1_Fp(
    mlib_image *dst,
    const mlib_image *src,
    const mlib_d64 *fmat)
{
	mlib_s32 slb, dlb, xsize, ysize;
	mlib_type dtype;
	void *sa, *da;

	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_FULL_EQUAL(dst, src);
	MLIB_IMAGE_HAVE_CHAN(dst, 3);

	if (fmat == NULL)
		return (MLIB_NULLPOINTER);

	dtype = mlib_ImageGetType(dst);
	xsize = mlib_ImageGetWidth(dst);
	ysize = mlib_ImageGetHeight(dst);
	slb = mlib_ImageGetStride(src);
	dlb = mlib_ImageGetStride(dst);
	sa = mlib_ImageGetData(src);
	da = mlib_ImageGetData(dst);

	if (dtype == MLIB_FLOAT) {
		return mlib_ImageColorConvert1_F32(sa, slb / 4,
		    da, dlb / 4, xsize, ysize, fmat);
	} else if (dtype == MLIB_DOUBLE) {
		return mlib_ImageColorConvert1_D64(sa, slb / 8,
		    da, dlb / 8, xsize, ysize, fmat);
	} else
		return (MLIB_FAILURE);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:35,代码来源:mlib_s_ImageColorConvert_Fp.c


示例10: __mlib_ImageColorRGB2HSL_Fp

mlib_status
__mlib_ImageColorRGB2HSL_Fp(
    mlib_image *dst,
    const mlib_image *src)
{
/*  check for obvious errors  */
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_TYPE_EQUAL(dst, src);
	MLIB_IMAGE_CHAN_EQUAL(dst, src);
	MLIB_IMAGE_HAVE_CHAN(dst, 3);

	switch (mlib_ImageGetType(dst)) {
	case MLIB_FLOAT:
		mlib_ImageColorRGB2HSL_Fp_F32(dst, src);
		break;
	case MLIB_DOUBLE:
		mlib_ImageColorRGB2HSL_Fp_D64(dst, src);
		break;
/*  discard any other data types  */
	default:
		return (MLIB_FAILURE);
	}

	return (MLIB_SUCCESS);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:26,代码来源:mlib_ImageColorRGB2HSL_Fp.c


示例11: __mlib_ImageFlipY_Fp

mlib_status
__mlib_ImageFlipY_Fp(
    mlib_image *dst,
    const mlib_image *src)
{
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_TYPE_EQUAL(src, dst);
	MLIB_IMAGE_CHAN_EQUAL(src, dst);

	switch (mlib_ImageGetType(src)) {
	case MLIB_FLOAT:
		switch (mlib_ImageGetChannels(src)) {
		case 1:
			mlib_ImageFlipY_S32_1(dst, src);
			break;
		case 2:
			mlib_ImageFlipY_S32_2(dst, src);
			break;
		case 3:
			mlib_ImageFlipY_S32_3(dst, src);
			break;
		case 4:
			mlib_ImageFlipY_S32_4(dst, src);
			break;
		default:
			return (MLIB_FAILURE);
		}

		break;

	case MLIB_DOUBLE:
		switch (mlib_ImageGetChannels(src)) {
		case 1:
			mlib_ImageFlipY_S32_2(dst, src);
			break;
		case 2:
			mlib_ImageFlipY_S32_4(dst, src);
			break;
		case 3:
			mlib_ImageFlipY_D64_3(dst, src);
			break;
		case 4:
			mlib_ImageFlipY_D64_4(dst, src);
			break;
		default:
			return (MLIB_FAILURE);
		}

		break;

	default:
		return (MLIB_FAILURE);
	}

	return (MLIB_SUCCESS);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:57,代码来源:mlib_ImageFlipY_Fp.c


示例12: __mlib_ImageConstMulShift

mlib_status
__mlib_ImageConstMulShift(
    mlib_image *dst,
    const mlib_image *src,
    const mlib_s32 *consts,
    mlib_s32 shift)
{
	mlib_type type;
	void *psrc, *pdst;
	mlib_s32 slb, dlb, xsize, ysize, nchan;
	mlib_s32 beta[4] = { 0, 0, 0, 0 };
	mlib_d64 dalpha[4], dbeta[4], dshift;
	mlib_s32 k;

	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_FULL_EQUAL(dst, src);

	MLIB_IMAGE_GET_ALL_PARAMS(dst, type, nchan, xsize, ysize, dlb, pdst);
	slb = mlib_ImageGetStride(src);
	psrc = mlib_ImageGetData(src);

	if (shift < 0 || shift > 31)
		return (MLIB_OUTOFRANGE);

/* branch to ImageScale if possible */

	if (type == MLIB_BYTE || type == MLIB_SHORT || type == MLIB_USHORT) {
		if (__mlib_ImageScale(dst, src, consts, beta,
		    shift) == MLIB_SUCCESS)
			return (MLIB_SUCCESS);
	}

	dshift = 1.0 / (1u << shift);
	for (k = 0; k < nchan; k++) {
		dalpha[k] = consts[k] * dshift;
		dbeta[k] = 0;
	}

	if (type == MLIB_BYTE) {

		return (mlib_ImageScale2_U8(dst, src, dalpha, dbeta));
	} else if (type == MLIB_SHORT) {

		return (mlib_ImageScale2_S16(dst, src, dalpha, dbeta));
	} else if (type == MLIB_USHORT) {

		return (mlib_ImageScale2_U16(dst, src, dalpha, dbeta));
	} else if (type == MLIB_INT) {

		return mlib_ImageDConstMul_S32(pdst, psrc, xsize, ysize, nchan,
		    slb / 4, dlb / 4, dalpha);
	}

	return (MLIB_FAILURE);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:56,代码来源:mlib_ImageConstMulShift.c


示例13: __mlib_ImageXor

mlib_status __mlib_ImageXor(mlib_image *dst,
                            mlib_image *src1,
                            mlib_image *src2)
{
  MLIB_IMAGE_CHECK(src1);
  MLIB_IMAGE_CHECK(src2);
  MLIB_IMAGE_CHECK(dst);

  return mlib_v_ImageLogic(dst, src1, src2);
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:10,代码来源:mlib_v_ImageXor.c


示例14: __mlib_ImageColorXYZ2RGB

mlib_status
__mlib_ImageColorXYZ2RGB(
    mlib_image *dst,
    const mlib_image *src)
{
/* CIE XYZ to Rec709 RGB with D64 White Point */
	mlib_d64 fmat[9] = { 3.240479, -1.537150, -0.498535,
		-0.969256, 1.875992, 0.041566,
		0.055648, -0.204043, 1.057311
	};
	mlib_s32 slb, dlb, xsize, ysize;
	mlib_type dtype;
	mlib_u8 *psrc, *pdst;
	mlib_s32 j;

	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_FULL_EQUAL(dst, src);

	dtype = mlib_ImageGetType(dst);
	xsize = mlib_ImageGetWidth(dst);
	ysize = mlib_ImageGetHeight(dst);
	dlb = mlib_ImageGetStride(dst);
	pdst = (void *)mlib_ImageGetData(dst);

	slb = mlib_ImageGetStride(src);
	psrc = mlib_ImageGetData(src);

	if (dtype == MLIB_BYTE) {

		for (j = 0; j < ysize; j++) {
			mlib_u8 *ps = psrc,
			    *pd = pdst, *pend = pdst + 3 * xsize;

#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
			for (; pd < pend; pd += 3) {
				MLIB_CONVERT_U8_1(pd, ps);
				ps += 3;
			}

			psrc += slb;
			pdst += dlb;
		}

		return (MLIB_SUCCESS);

	} else {

		return (__mlib_ImageColorConvert1(dst, src, fmat));
	}
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:53,代码来源:mlib_c_ImageColorXYZ2RGB.c


示例15: __mlib_ImageSqrShift

mlib_status
__mlib_ImageSqrShift(
    mlib_image *dst,
    const mlib_image *src,
    mlib_s32 shift)
{
	mlib_type dtype;

	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_FULL_EQUAL(dst, src);

	dtype = mlib_ImageGetType(dst);

	if (dtype == MLIB_BYTE) {
		if ((shift < 4) || (shift > 11)) {
			return (MLIB_OUTOFRANGE);
		}
	}

	if (dtype == MLIB_SHORT) {
		if ((shift < 1) || (shift > 16)) {
			return (MLIB_OUTOFRANGE);
		}
	}

	if (dtype == MLIB_INT) {
		if ((shift < -1023) || (shift > 1022)) {
			return (MLIB_OUTOFRANGE);
		}
	}

	if (dtype == MLIB_BYTE) {

		return (mlib_c_ImageSqrShift_U8(dst, src, shift));
	} else {

		void *sa = mlib_ImageGetData(src);
		void *da = mlib_ImageGetData(dst);
		mlib_s32 slb = mlib_ImageGetStride(src);
		mlib_s32 dlb = mlib_ImageGetStride(dst);
		mlib_s32 nchan = mlib_ImageGetChannels(src);
		mlib_s32 xsize = mlib_ImageGetWidth(src) * nchan;
		mlib_s32 ysize = mlib_ImageGetHeight(src);

		if (dtype == MLIB_SHORT) {

			mlib_c_ImageSqrShift_S16((mlib_s16 *)sa, (slb >> 1),
			    (mlib_s16 *)da, (dlb >> 1), xsize, ysize, shift);
			return (MLIB_SUCCESS);
		} else if (dtype == MLIB_USHORT) {
开发者ID:Aries85,项目名称:mediaLib,代码行数:51,代码来源:mlib_c_ImageSqrShift.c


示例16: __mlib_ImageScale

mlib_status
__mlib_ImageScale(
    mlib_image *dst,
    const mlib_image *src,
    const mlib_s32 *alpha,
    const mlib_s32 *beta,
    mlib_s32 shift)
{
	mlib_type stype, dtype;
	mlib_s32 k, nchan;
	mlib_d64 dshift, dalpha[4], dbeta[4];

	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_SIZE_EQUAL(dst, src);
	MLIB_IMAGE_CHAN_EQUAL(dst, src);

	if (alpha == NULL)
		return (MLIB_FAILURE);
	if (beta == NULL)
		return (MLIB_FAILURE);
	if (shift < 0 || shift > 31)
		return (MLIB_OUTOFRANGE);

	stype = mlib_ImageGetType(src);
	dtype = mlib_ImageGetType(dst);
	nchan = mlib_ImageGetChannels(dst);

	if (mlib_ImageScale_CheckForVIS(alpha, beta, shift, stype, dtype,
	    nchan) < -1) {
		return (MLIB_OUTOFRANGE);
	}

	dshift = 1.0 / (1u << shift);
	for (k = 0; k < nchan; k++) {
		dalpha[k] = alpha[k] * dshift;
		dbeta[k] = beta[k];
	}

	if (stype == MLIB_BYTE)
		return (mlib_ImageScale2_U8(dst, src, dalpha, dbeta));
	if (stype == MLIB_SHORT)
		return (mlib_ImageScale2_S16(dst, src, dalpha, dbeta));
	if (stype == MLIB_USHORT)
		return (mlib_ImageScale2_U16(dst, src, dalpha, dbeta));
	if (stype == MLIB_INT)
		return (mlib_ImageScale2_S32(dst, src, dalpha, dbeta));

	return (MLIB_FAILURE);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:50,代码来源:mlib_c_ImageScale.c


示例17: __mlib_ImageConstNotOr

mlib_status
__mlib_ImageConstNotOr(
    mlib_image *dst,
    const mlib_image *src,
    const mlib_s32 *c)
{
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);

	if (mlib_ImageGetType(src) == MLIB_BIT) {
		return (mlib_ImageConstNotOr_Bit(dst, src, c));
	}

	return (mlib_m_ImageConstLogic(dst, src, c));
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:15,代码来源:mlib_m_ImageConstNotOr.c


示例18: __mlib_ImageMinimum_Fp

mlib_status
__mlib_ImageMinimum_Fp(
    mlib_d64 *min,
    const mlib_image *img)
{
/* check for obvious errors */
	MLIB_IMAGE_CHECK(img);

	if (min == NULL)
		return (MLIB_NULLPOINTER);

	switch (mlib_ImageGetType(img)) {
	case MLIB_FLOAT:

		if (mlib_ImageGetChannels(img) == 3)
			mlib_ImageMinimum_F32_3(img, min);
		else
			mlib_ImageMinimum_F32_124(img, min);
		break;

	case MLIB_DOUBLE:

		if (mlib_ImageGetChannels(img) == 3)
			mlib_ImageMinimum_D64_3(img, min);
		else
			mlib_ImageMinimum_D64_124(img, min);
		break;

	default:
		return (MLIB_FAILURE);
	}

	return (MLIB_SUCCESS);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:34,代码来源:mlib_s_ImageMinimum_Fp.c


示例19: __mlib_ImageCopyMask_Fp

mlib_status
__mlib_ImageCopyMask_Fp(
    mlib_image *dst,
    const mlib_image *src,
    const mlib_image *mask,
    const mlib_d64 *thresh)
{
	mlib_type dtype;
	mlib_s32 slb, mlb, dlb, xsize, ysize, nchan;
	void *sa, *ma, *da;

	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);
	MLIB_IMAGE_CHECK(mask);

	MLIB_IMAGE_TYPE_EQUAL(src, dst);
	MLIB_IMAGE_TYPE_EQUAL(mask, dst);

	MLIB_IMAGE_CHAN_EQUAL(src, dst);
	MLIB_IMAGE_CHAN_EQUAL(mask, dst);

	MLIB_IMAGE_SIZE_EQUAL(src, dst);
	MLIB_IMAGE_SIZE_EQUAL(mask, dst);

	dtype = mlib_ImageGetType(dst);
	nchan = mlib_ImageGetChannels(dst);
	xsize = mlib_ImageGetWidth(dst);
	ysize = mlib_ImageGetHeight(dst);
	slb = mlib_ImageGetStride(src);
	mlb = mlib_ImageGetStride(mask);
	dlb = mlib_ImageGetStride(dst);
	sa = mlib_ImageGetData(src);
	ma = mlib_ImageGetData(mask);
	da = mlib_ImageGetData(dst);

	if (dtype == MLIB_FLOAT) {
		mlib_ImageCopyMask_Fp_f32(sa, slb, ma, mlb, da, dlb, xsize,
		    ysize, nchan, thresh);
		return (MLIB_SUCCESS);
	} else if (dtype == MLIB_DOUBLE) {
		mlib_ImageCopyMask_Fp_d64(sa, slb, ma, mlb, da, dlb, xsize,
		    ysize, nchan, thresh);
		return (MLIB_SUCCESS);
	} else
		return (MLIB_FAILURE);
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:46,代码来源:mlib_s_ImageCopyMask_Fp.c


示例20: __mlib_ImageConstAndNot

mlib_status
__mlib_ImageConstAndNot(
    mlib_image *dst,
    const mlib_image *src,
    const mlib_s32 *c)
{
	MLIB_IMAGE_CHECK(src);
	MLIB_IMAGE_CHECK(dst);

#ifdef _NO_LONGLONG

	if ((mlib_ImageGetType(src) == MLIB_BYTE) ||
	    (mlib_ImageGetType(src) == MLIB_SHORT) ||
	    (mlib_ImageGetType(src) == MLIB_USHORT)) {

		return (mlib_c_ImageConstLogic(dst, src, c));

	} else if (mlib_ImageGetType(src) == MLIB_BIT) {

		return (mlib_ImageConstAndNot_Bit(dst, src, c));

	} else if (mlib_ImageGetType(src) == MLIB_INT) {

		return (mlib_c_ImageConstLogic_S32(dst, src, c));

	} else
		return (MLIB_FAILURE);

#else /* _NO_LONGLONG */

	if ((mlib_ImageGetType(src) == MLIB_BYTE) ||
	    (mlib_ImageGetType(src) == MLIB_SHORT) ||
	    (mlib_ImageGetType(src) == MLIB_USHORT) ||
	    mlib_ImageGetType(src) == MLIB_INT) {

		return (mlib_c_ImageConstLogic(dst, src, c));

	} else if (mlib_ImageGetType(src) == MLIB_BIT) {

		return (mlib_ImageConstAndNot_Bit(dst, src, c));

	} else
		return (MLIB_FAILURE);
#endif /* _NO_LONGLONG */
}
开发者ID:Aries85,项目名称:mediaLib,代码行数:45,代码来源:mlib_c_ImageConstAndNot.c



注:本文中的MLIB_IMAGE_CHECK函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MLSLSerialWriteSingle函数代码示例发布时间:2022-05-30
下一篇:
C++ MK_TRACE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap