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

📄 rotate_ti_ialg.c

📁 TI公司的算法标准 Framework5的源代码
💻 C
字号:
/*
 *  Copyright 2002 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) RF5_IEK 2.00.02 12-11-02 (swat-c19)" */
/*
 *  ======== rotate_ti_ialg.c ========
 *  Implementation of the ROTATE_TI.h interface; TI's implementation 
 *  of the IROTATE interface. 
 */
#pragma CODE_SECTION(ROTATE_TI_alloc, ".text:algAlloc")
#pragma CODE_SECTION(ROTATE_TI_free, ".text:algFree")
#pragma CODE_SECTION(ROTATE_TI_initObj, ".text:algInit")
#pragma CODE_SECTION(ROTATE_TI_numAlloc, ".text:algNumAlloc")
 
#include <std.h>

#include "irotate.h"
#include "rotate_ti.h"
#include "rotate_ti_priv.h"

#define OBJECT  0
#define NUMBUFS 1


/*
 *  ======== ROTATE_TI_alloc ========
 *  Return a table of memory descriptors that describe the memory needed 
 *  to construct a ROTATE_TI_Obj structure.
 */
Int ROTATE_TI_alloc(const IALG_Params *rotateParams, IALG_Fxns **fxns, 
                    IALG_MemRec memTab[])
{
    const IROTATE_Params *params = (Void *)rotateParams;
    
    if (params == NULL) 
    {
        params = &IROTATE_PARAMS;       /* set default parameters */
    }

    /* Request memory for ROTATE object */
    memTab[OBJECT].size       = sizeof(ROTATE_TI_Obj);
    memTab[OBJECT].alignment  = 4;
    memTab[OBJECT].space      = IALG_EXTERNAL;
    memTab[OBJECT].attrs      = IALG_PERSIST;
        
    return (NUMBUFS);
}

/*
 *  ======== ROTATE_TI_free ========
 *  Return a table of memory pointers that should be freed.  Note
 *  that this should include *all* memory requested in the 
 *  ROTATE_TI_alloc operation above.
 */
Int ROTATE_TI_free(IALG_Handle handle, IALG_MemRec memTab[])
{
    ROTATE_TI_Obj *rotate = (Void *)handle;
    
    ROTATE_TI_alloc(NULL, NULL, memTab);
      
    memTab[OBJECT].base = rotate;
     
    return (NUMBUFS);
}

/*  ======== ROTATE_TI_initObj ========
 *  Initialize the memory allocated for our instance.
 */
Int ROTATE_TI_initObj(IALG_Handle handle, const IALG_MemRec memTab[], 
                      IALG_Handle p, const IALG_Params *rotateParams)
{
    ROTATE_TI_Obj *rotate = (Void *)handle;
    const IROTATE_Params *params = (Void *)rotateParams;

    if (params == NULL) 
    {
        params = &IROTATE_PARAMS;  /* set default parameters */
    }

    rotate->reverseImage = params->reverseImage;
    return (IALG_EOK);
}

/*  ======== ROTATE_TI_numAlloc ========
 *  Returns the number of records needed for the MEM tab by the client.
 */
Int ROTATE_TI_numAlloc()
{
    return(NUMBUFS);
}


⌨️ 快捷键说明

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