⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 omxipbm_mirror_u8_c1r.c

📁 The OpenMAX DL (Development Layer) APIs contain a comprehensive set of audio, video, signal processi
💻 C
字号:
/** * *  * File Name:  omxIPBM_Mirror_U8_C1R.c * OpenMAX DL: v1.0.2 * Revision:   10586 * Date:       Wednesday, March 5, 2008 *  * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. *  *  * * Description  : Image Geometric Transform - Mirror the image about the given axis. *                The source is in single-channel format and pixel domain, and *                the destination in single-channel format and pixel domain. * */#include "omxtypes.h"#include "armCOMM.h"#include "armOMX.h"#include "omxIP.h"/** * Function:  omxIPBM_Mirror_U8_C1R   (4.2.1.3.1) * * Description: * This function mirrors the source image pSrc about a horizontal or vertical  * axis or both, depending on the value of the parameter axis, and writes it  * to the destination image pDst.  * * Input Arguments: *    *   pSrc - pointer to the source buffer  *   srcStep - distance in bytes between the starts of consecutive lines in  *            the source image  *   dstStep - distance in bytes between the starts of consecutive lines in  *            the destination image  *   roiSize - size of the source and destination ROI in pixels.  *   axis - specifies the axis about which to mirror the image.  Must use one  *            of the following OMXIPRotation values:  *              - OMX_IP_FLIP_HORIZONTAL to mirror about the vertical axis  *              - OMX_IP_FLIP_VERTICAL to mirror about the horizontal axis  *              - OMX_IP_ROTATE180 to mirror about both horizontal and vertical axes  * * Output Arguments: *    *   pDst - pointer to the destination buffer  * * Return Value: *     *    OMX_Sts_NoErr - no errors detected  *    OMX_Sts_BadArgErr - bad arguments detected; at least one of the  *              following is true:  *    -   pSrc or pDst is NULL  *    -   srcStep or dstStep is less than or equal to zero  *    -   roiSize has a field with zero or negative value.  *    -   axis contains an illegal value  * */ OMXResult omxIPBM_Mirror_U8_C1R(        const OMX_U8 *pSrc,        OMX_INT srcStep,        OMX_U8 *pDst,        OMX_INT dstStep,        OMXSize roiSize,        OMXIPRotation axis       ){    OMX_S32 mirWidth    = roiSize.width;    OMX_S32 mirHeight   = roiSize.height;    OMX_INT i, j;    OMX_U8  *pCurDst;    const OMX_U8 *pCurSrc;    armRetArgErrIf(!pSrc, OMX_Sts_BadArgErr);    armRetArgErrIf(!pDst, OMX_Sts_BadArgErr);    armRetArgErrIf(srcStep <= 0, OMX_Sts_BadArgErr);    armRetArgErrIf(dstStep <= 0, OMX_Sts_BadArgErr);    armRetArgErrIf(roiSize.width <= 0, OMX_Sts_BadArgErr);    armRetArgErrIf(roiSize.height <= 0, OMX_Sts_BadArgErr);    armRetArgErrIf((axis != OMX_IP_FLIP_VERTICAL) && (axis != OMX_IP_FLIP_HORIZONTAL) && (axis != OMX_IP_ROTATE180), OMX_Sts_BadArgErr);    /*    -------------------------------------------------------------------------------    Mirroring about the Vertical axis always happens first and hence, pSrc and pDst     are never aliased. But for mirroring about the Horizontal axis, pSrc and pDst     can be aliased (if mirroring along both axes) or not aliased (if mirroring     along Horizontal axis only). Hence, these cases are handled separately.    -------------------------------------------------------------------------------    */        if((axis == OMX_IP_FLIP_HORIZONTAL) || (axis == OMX_IP_ROTATE180))    {        pCurSrc = pSrc;        pCurDst = pDst;                for(i = 0; i < mirHeight; i++, pCurSrc += srcStep, pCurDst += dstStep)        {            for(j = 0; j < mirWidth; j++)            {                pCurDst[j] = pCurSrc[mirWidth-j-1];            }        }    }        else if(axis == OMX_IP_FLIP_VERTICAL)    {        pCurSrc = pSrc;        pCurDst = pDst + (mirHeight-1) * dstStep;                for(i = 0; i < mirHeight; i++, pCurSrc += srcStep, pCurDst -= dstStep)        {            for(j = 0; j < mirWidth; j++)            {                pCurDst[j] = pCurSrc[j];            }        }    }        if(axis == OMX_IP_ROTATE180)    {        OMX_U8 *pNewSrc = pDst;        pCurDst         = pDst + (mirHeight-1) * dstStep;                for(i = 0; i < mirHeight/2; i++, pNewSrc += srcStep, pCurDst -= dstStep)        {            for(j = 0; j < mirWidth; j++)            {                armSwapElem((pNewSrc + j), (pCurDst + j), 1);            }        }    }        return OMX_Sts_NoErr;}/* End of file */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -