Home | History | Annotate | Download | only in b_FDSDK
      1 /*
      2  * Copyright (C) 2008 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef btk_SDK_EM_H
     18 #define btk_SDK_EM_H
     19 
     20 #ifdef __cplusplus
     21 extern "C" {
     22 #endif
     23 
     24 /**
     25  *  Visual Sensing SDK
     26  *  SDK Context object
     27  */
     28 
     29 /* ---- includes ----------------------------------------------------------- */
     30 
     31 #include "Types.h"
     32 
     33 /* ---- related objects  --------------------------------------------------- */
     34 
     35 /** SDK context object */
     36 struct btk_SDK;
     37 
     38 /* ---- typedefs ----------------------------------------------------------- */
     39 
     40 /** handle for SDK context */
     41 typedef struct btk_SDK* btk_HSDK;
     42 
     43 /** malloc function pointer */
     44 typedef void* ( *btk_fpMalloc )( u32 sizeA );
     45 
     46 /** free function pointer */
     47 typedef void ( *btk_fpFree )( void* memPtrA );
     48 
     49 /** error handler function pointer */
     50 typedef void ( *btk_fpError )( btk_HSDK hsdkA );
     51 
     52 /** SDK creation parameters */
     53 typedef struct
     54 {
     55 	/** (optional) handler to error-handler function */
     56 	btk_fpError  fpError;
     57 
     58 	/** handler to malloc function */
     59 	btk_fpMalloc fpMalloc;
     60 
     61 	/** handler to free function */
     62 	btk_fpFree   fpFree;
     63 
     64 	/** pointer to preallocated exclusive (=persistent) memory (alternative to fpMalloc) */
     65 	void* pExMem;
     66 
     67 	/** size of external memory */
     68 	u32 sizeExMem;
     69 
     70 	/** pointer to preallocated shared memory (alternative to fpMalloc) */
     71 	void* pShMem;
     72 
     73 	/** size of external memory */
     74 	u32 sizeShMem;
     75 
     76 	/** pointer to 0-terminated license key string */
     77 	const char* licenseKey;
     78 
     79 	/** maximum image witdh used */
     80 	u32 maxImageWidth;
     81 
     82 	/** maximum image height used */
     83 	u32 maxImageHeight;
     84 
     85 } btk_SDKCreateParam;
     86 
     87 /* ---- constants ---------------------------------------------------------- */
     88 
     89 /* ---- functions ---------------------------------------------------------- */
     90 
     91 /** returns default SDK parameters */
     92 btk_DECLSPEC
     93 btk_SDKCreateParam btk_SDK_defaultParam( void );
     94 
     95 /** creates an SDK context using dynamic memory management */
     96 btk_DECLSPEC
     97 btk_Status btk_SDK_create( const btk_SDKCreateParam* pCreateParamA,
     98 						   btk_HSDK* hpsdkA );
     99 
    100 /** closes an SDK context */
    101 btk_DECLSPEC
    102 btk_Status btk_SDK_close( btk_HSDK hsdkA );
    103 
    104 /** returns last occurred error and removes it from the error stack */
    105 btk_DECLSPEC
    106 btk_Error btk_SDK_getError( btk_HSDK hsdkA,
    107 						    char* msgBufA,
    108 							u32 msgBufSizeA );
    109 
    110 /** returns amount of allocated exclusive memory in bytes */
    111 btk_DECLSPEC
    112 u32 btk_SDK_exAllocSize( btk_HSDK hsdkA );
    113 
    114 /** returns amount of allocated shared memory in bytes */
    115 btk_DECLSPEC
    116 u32 btk_SDK_shAllocSize( btk_HSDK hsdkA );
    117 
    118 /** returns total amount of allocated memory in bytes */
    119 btk_DECLSPEC
    120 u32 btk_SDK_allocSize( btk_HSDK hsdkA );
    121 
    122 #ifdef __cplusplus
    123 }
    124 #endif
    125 
    126 #endif /* btk_SDK_EM_H */
    127