Sample to operate omron HVC-P2 on GR-PEACH.

Dependencies:   AsciiFont

Information

Please see here for Japanese version.
日本語版はこちらを参照ください。

What is this ?

This is a sample that runs OMRON HVC-P2 with GR-PEACH. In this sample, you can try following among the functions of HVC-P2 : Human Body Detection, Face Detection, Age Estimation, Gender Estimation, Expression Estimation and Face Recognition.
Both GR-PEACH and HVC-P2 use Renesas RZ/A1H included ARM® Cortex™-A9 processor.

/media/uploads/dkato/hvcp2_demo_img3.jpg

HVC-P2 (Human Vision Components B5T-007001) is a human-sensing component that recognizes people. It is an integrated module that is built into other device and provides both the OKAO Vision's ten types of image sensing and a camera module.
For details, please refer to the following link.

In the HVCApi folder of this sample, the code of the following link destination Sample Code "SampleCode_rev.2.0.2" is used. (You can download from "Product Information" -> "Sample Code" in the middle of the following page.)
http://www.omron.com/ecb/products/mobile/hvc_p2/

Constitution

  1. HVC-P2 x 1
  2. USBA-microUSB conversion cable x 2
  3. USBA-microUSB conversion adapter x 1
  4. GR-PEACH x 1
  5. 4.3inc LCD shield x 1

/media/uploads/dkato/composition_hvcp2_demo.jpg

/media/uploads/dkato/composition_hvcp2_demo_2.jpg

Please close JP3 of GR-PEACH.
/media/uploads/RyoheiHagimoto/usb.jpg

How to use

It starts when connecting the power supply USB cable. At startup, all functions are turned off. By pressing the button on the right of the screen you can switch the function on / off.

  • Function ON : orange or green
  • Function OFF : blue or gray

Only the FACE button changes to "FACE (blue) -> FACE (orange) -> RECOGNITION (green)". When FACE (blue), following buttons are gray and can not be operated : AGE, GENDER and EXPRESSION.
"Response time" at the bottom left of the screen indicates "image processing + USB transfer time". It is not pure image processing time.

Register Data (Face Recognition)

Set the FACE button to RECOGNITION (green), and touch the screen with one person on the screen to register the face. In this sample, face registration will record up to 10 people. Delete the old registrant when registering after 11 people. Registration information is stored in the RAM on the HVC-P2 side. It is discarded by power off and reset.

/media/uploads/dkato/hvcp2_demo_img2.jpg

Change parameters

When you press Config icon at the bottom right of the screen, the parameter setting screen is displayed. You can change threshold value, detection size and face angle parameters.

/media/uploads/dkato/hvcp2_demo_config_icon.jpg
/media/uploads/dkato/hvcp2_demo_config.jpg

Change transfer image size

By pressing USER_BUTTON0 on the back of the board, the image transfer size switches in the order of "160 x 120 -> 320 x 240 -> no image".
/media/uploads/dkato/gr-peach_switch2.jpg

Committer:
dkato
Date:
Tue Sep 05 10:01:51 2017 +0000
Revision:
5:49a61433290a
Add HVC sensing result stabilizing library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 5:49a61433290a 1 /*---------------------------------------------------------------------------*/
dkato 5:49a61433290a 2 /* Copyright(C) 2017 OMRON Corporation */
dkato 5:49a61433290a 3 /* */
dkato 5:49a61433290a 4 /* Licensed under the Apache License, Version 2.0 (the "License"); */
dkato 5:49a61433290a 5 /* you may not use this file except in compliance with the License. */
dkato 5:49a61433290a 6 /* You may obtain a copy of the License at */
dkato 5:49a61433290a 7 /* */
dkato 5:49a61433290a 8 /* http://www.apache.org/licenses/LICENSE-2.0 */
dkato 5:49a61433290a 9 /* */
dkato 5:49a61433290a 10 /* Unless required by applicable law or agreed to in writing, software */
dkato 5:49a61433290a 11 /* distributed under the License is distributed on an "AS IS" BASIS, */
dkato 5:49a61433290a 12 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
dkato 5:49a61433290a 13 /* See the License for the specific language governing permissions and */
dkato 5:49a61433290a 14 /* limitations under the License. */
dkato 5:49a61433290a 15 /*---------------------------------------------------------------------------*/
dkato 5:49a61433290a 16
dkato 5:49a61433290a 17 #include "TrInterface.h"
dkato 5:49a61433290a 18 #include "STBTrAPI.h"
dkato 5:49a61433290a 19 /*Value range check*/
dkato 5:49a61433290a 20 #define ISVALID_RANGE( val , min , max ) ( ( (min) <= (val) ) && ( (val) <= (max) ) )
dkato 5:49a61433290a 21
dkato 5:49a61433290a 22 /*---------------------------------------------------------------------
dkato 5:49a61433290a 23 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 24 /*error check*/
dkato 5:49a61433290a 25 /*---------------------------------------------------------------------
dkato 5:49a61433290a 26 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 27 static STB_INT32 TrIsValidValue(
dkato 5:49a61433290a 28 const STB_INT32 nValue ,
dkato 5:49a61433290a 29 const STB_INT32 nLimitMin ,
dkato 5:49a61433290a 30 const STB_INT32 nLimitMax )
dkato 5:49a61433290a 31 {
dkato 5:49a61433290a 32 STB_INT32 nRet;
dkato 5:49a61433290a 33 for( nRet = STB_ERR_INVALIDPARAM; nRet != STB_NORMAL; nRet = STB_NORMAL ){
dkato 5:49a61433290a 34 if( ! ISVALID_RANGE( nValue , nLimitMin , nLimitMax ) ){ break; }
dkato 5:49a61433290a 35 }
dkato 5:49a61433290a 36 return nRet;
dkato 5:49a61433290a 37 }
dkato 5:49a61433290a 38 /*---------------------------------------------------------------------
dkato 5:49a61433290a 39 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 40 static STB_INT32 TrIsValidPointer( const VOID* pPointer )
dkato 5:49a61433290a 41 {
dkato 5:49a61433290a 42 STB_INT32 nRet;
dkato 5:49a61433290a 43 for( nRet = STB_ERR_INVALIDPARAM; nRet != STB_NORMAL; nRet = STB_NORMAL ){
dkato 5:49a61433290a 44 if( NULL == pPointer ){ break; }
dkato 5:49a61433290a 45 }
dkato 5:49a61433290a 46 return nRet;
dkato 5:49a61433290a 47 }
dkato 5:49a61433290a 48
dkato 5:49a61433290a 49 /*------------------------------------------------------------------------------------------------------------------*/
dkato 5:49a61433290a 50 /* TrCalcTrSize */
dkato 5:49a61433290a 51 /*------------------------------------------------------------------------------------------------------------------*/
dkato 5:49a61433290a 52 STB_UINT32 TrCalcTrSize ( const STBExecFlg *execFlg , STB_UINT32 nTraCntMax , STB_UINT32 nDetCntMax )
dkato 5:49a61433290a 53 {
dkato 5:49a61433290a 54 STB_UINT32 retVal ;
dkato 5:49a61433290a 55
dkato 5:49a61433290a 56 retVal = 0 ;
dkato 5:49a61433290a 57
dkato 5:49a61433290a 58 retVal += 100 ;///Margin : alignment
dkato 5:49a61433290a 59
dkato 5:49a61433290a 60
dkato 5:49a61433290a 61 retVal += sizeof( STB_TR_DET ); // stbTrDet
dkato 5:49a61433290a 62
dkato 5:49a61433290a 63 if( execFlg->bodyTr == STB_TRUE )
dkato 5:49a61433290a 64 {
dkato 5:49a61433290a 65 retVal += sizeof( ROI_SYS ) * STB_TR_BACK_MAX ;// bdRec
dkato 5:49a61433290a 66 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// bdRec[t].nDetID
dkato 5:49a61433290a 67 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// bdRec[t].nTraID
dkato 5:49a61433290a 68 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// bdRec[t].posX
dkato 5:49a61433290a 69 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// bdRec[t].posY
dkato 5:49a61433290a 70 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// bdRec[t].size
dkato 5:49a61433290a 71 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// bdRec[t].conf
dkato 5:49a61433290a 72 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// bdRec[t].retryN
dkato 5:49a61433290a 73 retVal += sizeof( ROI_DET ) * nDetCntMax ;// stbTrDet->bdDet
dkato 5:49a61433290a 74 retVal += sizeof( STB_TR_RES_BODYS) ;// resBodys
dkato 5:49a61433290a 75 retVal += sizeof( STB_TR_RES ) * nTraCntMax ;// resBodys->body
dkato 5:49a61433290a 76 }
dkato 5:49a61433290a 77 if( execFlg->faceTr == STB_TRUE )
dkato 5:49a61433290a 78 {
dkato 5:49a61433290a 79 retVal += sizeof( ROI_SYS ) * STB_TR_BACK_MAX ;// fcRec
dkato 5:49a61433290a 80 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// fcRec[t].nDetID
dkato 5:49a61433290a 81 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// fcRec[t].nTraID
dkato 5:49a61433290a 82 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// fcRec[t].posX
dkato 5:49a61433290a 83 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// fcRec[t].posY
dkato 5:49a61433290a 84 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// fcRec[t].size
dkato 5:49a61433290a 85 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// fcRec[t].conf
dkato 5:49a61433290a 86 retVal += sizeof( STB_INT32 ) * STB_TR_BACK_MAX * nTraCntMax ;// fcRec[t].retryN
dkato 5:49a61433290a 87 retVal += sizeof( ROI_DET ) * nDetCntMax ;// stbTrDet->fcDet
dkato 5:49a61433290a 88 retVal += sizeof( STB_TR_RES_FACES) ;// resFaces
dkato 5:49a61433290a 89 retVal += sizeof( STB_TR_RES ) * nTraCntMax ;// resFaces->face
dkato 5:49a61433290a 90 }
dkato 5:49a61433290a 91
dkato 5:49a61433290a 92 retVal += sizeof( STB_INT32 ) * nTraCntMax ; // wIdPreCur
dkato 5:49a61433290a 93 retVal += sizeof( STB_INT32 ) * nTraCntMax ; // wIdCurPre
dkato 5:49a61433290a 94 retVal += sizeof( STB_INT32 ) * nTraCntMax * nTraCntMax ; // wDstTbl
dkato 5:49a61433290a 95 retVal += sizeof( STBExecFlg ) ; // execFlg
dkato 5:49a61433290a 96
dkato 5:49a61433290a 97 retVal += ( sizeof( ROI_SYS ) );//wRoi
dkato 5:49a61433290a 98 retVal += ( sizeof( STB_INT32 ) * nTraCntMax );//wRoi->nDetID
dkato 5:49a61433290a 99 retVal += ( sizeof( STB_INT32 ) * nTraCntMax );//wRoi->nTraID
dkato 5:49a61433290a 100 retVal += ( sizeof( STB_INT32 ) * nTraCntMax );//wRoi->posX
dkato 5:49a61433290a 101 retVal += ( sizeof( STB_INT32 ) * nTraCntMax );//wRoi->posY
dkato 5:49a61433290a 102 retVal += ( sizeof( STB_INT32 ) * nTraCntMax );//wRoi->size
dkato 5:49a61433290a 103 retVal += ( sizeof( STB_INT32 ) * nTraCntMax );//wRoi->conf
dkato 5:49a61433290a 104 retVal += ( sizeof( STB_INT32 ) * nTraCntMax );//wRoi->retryN
dkato 5:49a61433290a 105
dkato 5:49a61433290a 106 return retVal;
dkato 5:49a61433290a 107 }
dkato 5:49a61433290a 108 /*------------------------------------------------------------------------------------------------------------------*/
dkato 5:49a61433290a 109 /* ShareTrSize */
dkato 5:49a61433290a 110 /*------------------------------------------------------------------------------------------------------------------*/
dkato 5:49a61433290a 111 void ShareTrSize ( TRHANDLE handle , const STBExecFlg* execFlg )
dkato 5:49a61433290a 112 {
dkato 5:49a61433290a 113 STB_UINT32 t ;
dkato 5:49a61433290a 114 STB_UINT32 nTraCntMax = handle->traCntMax ;
dkato 5:49a61433290a 115 STB_UINT32 nDetCntMax = handle->detCntMax ;
dkato 5:49a61433290a 116 STB_INT8 *stbPtr = handle->trPtr ;
dkato 5:49a61433290a 117
dkato 5:49a61433290a 118
dkato 5:49a61433290a 119
dkato 5:49a61433290a 120 handle->stbTrDet = ( STB_TR_DET*) stbPtr; stbPtr += ( sizeof( STB_TR_DET ) );
dkato 5:49a61433290a 121
dkato 5:49a61433290a 122 if( execFlg->bodyTr == STB_TRUE )
dkato 5:49a61433290a 123 {
dkato 5:49a61433290a 124 handle->bdRec = ( ROI_SYS* ) stbPtr; stbPtr += ( sizeof( ROI_SYS ) * STB_TR_BACK_MAX);
dkato 5:49a61433290a 125 for( t = 0 ; t < STB_TR_BACK_MAX ; t++ )
dkato 5:49a61433290a 126 {
dkato 5:49a61433290a 127 handle->bdRec[t].nDetID = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 128 handle->bdRec[t].nTraID = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 129 handle->bdRec[t].posX = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 130 handle->bdRec[t].posY = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 131 handle->bdRec[t].size = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 132 handle->bdRec[t].conf = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 133 handle->bdRec[t].retryN = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 134 }
dkato 5:49a61433290a 135 handle->stbTrDet->bdDet = ( ROI_DET* ) stbPtr; stbPtr += ( sizeof( ROI_DET ) * nDetCntMax );
dkato 5:49a61433290a 136 handle->resBodys = ( STB_TR_RES_BODYS* ) stbPtr; stbPtr += ( sizeof( STB_TR_RES_BODYS ) );
dkato 5:49a61433290a 137 handle->resBodys->body = ( STB_TR_RES*) stbPtr; stbPtr += ( sizeof( STB_TR_RES ) * nTraCntMax );
dkato 5:49a61433290a 138 }
dkato 5:49a61433290a 139
dkato 5:49a61433290a 140
dkato 5:49a61433290a 141 if( execFlg->faceTr == STB_TRUE )
dkato 5:49a61433290a 142 {
dkato 5:49a61433290a 143 handle->fcRec = ( ROI_SYS* ) stbPtr; stbPtr += ( sizeof( ROI_SYS ) * STB_TR_BACK_MAX );
dkato 5:49a61433290a 144 for( t = 0 ; t < STB_TR_BACK_MAX ; t++ )
dkato 5:49a61433290a 145 {
dkato 5:49a61433290a 146 handle->fcRec[t].nDetID = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 147 handle->fcRec[t].nTraID = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 148 handle->fcRec[t].posX = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 149 handle->fcRec[t].posY = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 150 handle->fcRec[t].size = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 151 handle->fcRec[t].conf = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 152 handle->fcRec[t].retryN = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 153 }
dkato 5:49a61433290a 154 handle->stbTrDet->fcDet = ( ROI_DET* ) stbPtr; stbPtr += ( sizeof( ROI_DET ) * nDetCntMax );
dkato 5:49a61433290a 155
dkato 5:49a61433290a 156 handle->resFaces = ( STB_TR_RES_FACES* ) stbPtr; stbPtr += ( sizeof( STB_TR_RES_FACES ) );
dkato 5:49a61433290a 157 handle->resFaces->face = ( STB_TR_RES*) stbPtr; stbPtr += ( sizeof( STB_TR_RES ) * nTraCntMax );
dkato 5:49a61433290a 158 }
dkato 5:49a61433290a 159
dkato 5:49a61433290a 160
dkato 5:49a61433290a 161 handle->wIdPreCur = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 162 handle->wIdCurPre = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 163 handle->wDstTbl = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax * nTraCntMax );
dkato 5:49a61433290a 164 handle->execFlg = ( STBExecFlg*) stbPtr; stbPtr += sizeof( STBExecFlg );
dkato 5:49a61433290a 165
dkato 5:49a61433290a 166 handle->wRoi = ( ROI_SYS* ) stbPtr; stbPtr += ( sizeof( ROI_SYS ) );
dkato 5:49a61433290a 167 handle->wRoi->nDetID= ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 168 handle->wRoi->nTraID= ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 169 handle->wRoi->posX = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 170 handle->wRoi->posY = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 171 handle->wRoi->size = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 172 handle->wRoi->conf = ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 173 handle->wRoi->retryN= ( STB_INT32* ) stbPtr; stbPtr += ( sizeof( STB_INT32 ) * nTraCntMax );
dkato 5:49a61433290a 174 }
dkato 5:49a61433290a 175 /*---------------------------------------------------------------------
dkato 5:49a61433290a 176 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 177 /*Create handle*/
dkato 5:49a61433290a 178 TRHANDLE TrCreateHandle( const STBExecFlg* execFlg ,const STB_INT32 nDetCntMax, const STB_INT32 nTraCntMax )
dkato 5:49a61433290a 179 {
dkato 5:49a61433290a 180
dkato 5:49a61433290a 181 TRHANDLE handle ;
dkato 5:49a61433290a 182 STB_INT32 i ,j ;
dkato 5:49a61433290a 183 STB_INT32 tmpVal ;
dkato 5:49a61433290a 184 STB_INT32 nRet ;
dkato 5:49a61433290a 185
dkato 5:49a61433290a 186 nRet = TrIsValidPointer(execFlg);
dkato 5:49a61433290a 187 if(nRet != STB_NORMAL)
dkato 5:49a61433290a 188 {
dkato 5:49a61433290a 189 return NULL;
dkato 5:49a61433290a 190 }
dkato 5:49a61433290a 191
dkato 5:49a61433290a 192 if( nDetCntMax < 1 || STB_TR_DET_CNT_MAX < nDetCntMax )
dkato 5:49a61433290a 193 {
dkato 5:49a61433290a 194 return NULL;
dkato 5:49a61433290a 195 }
dkato 5:49a61433290a 196 if( nTraCntMax < 1 || STB_TR_TRA_CNT_MAX < nTraCntMax )
dkato 5:49a61433290a 197 {
dkato 5:49a61433290a 198 return NULL;
dkato 5:49a61433290a 199 }
dkato 5:49a61433290a 200
dkato 5:49a61433290a 201 /*do handle's Malloc here*/
dkato 5:49a61433290a 202 handle = ( TRHANDLE )malloc( sizeof(*handle) );
dkato 5:49a61433290a 203 if(handle == NULL)
dkato 5:49a61433290a 204 {
dkato 5:49a61433290a 205 return NULL;
dkato 5:49a61433290a 206 }
dkato 5:49a61433290a 207
dkato 5:49a61433290a 208 handle->detCntMax = nDetCntMax ;
dkato 5:49a61433290a 209 handle->traCntMax = nTraCntMax ;
dkato 5:49a61433290a 210 handle->retryCnt = STB_TR_INI_RETRY ;
dkato 5:49a61433290a 211 handle->stedPos = STB_TR_INI_STEADINESS_SIZE ;//stabilization parameter(position)
dkato 5:49a61433290a 212 handle->stedSize = STB_TR_INI_STEADINESS_POS ;//stabilization parameter(size)
dkato 5:49a61433290a 213 handle->fcCntAcc = 0 ;
dkato 5:49a61433290a 214 handle->bdCntAcc = 0 ;
dkato 5:49a61433290a 215 handle->trPtr = NULL;
dkato 5:49a61433290a 216 handle->stbTrDet = NULL;
dkato 5:49a61433290a 217 handle->fcRec = NULL;
dkato 5:49a61433290a 218 handle->bdRec = NULL;
dkato 5:49a61433290a 219 handle->resFaces = NULL;
dkato 5:49a61433290a 220 handle->resBodys = NULL;
dkato 5:49a61433290a 221 handle->wIdPreCur = NULL;
dkato 5:49a61433290a 222 handle->wIdCurPre = NULL;
dkato 5:49a61433290a 223 handle->wDstTbl = NULL;
dkato 5:49a61433290a 224 handle->execFlg = NULL;
dkato 5:49a61433290a 225
dkato 5:49a61433290a 226 tmpVal = TrCalcTrSize ( execFlg ,nTraCntMax , nDetCntMax); /*calculate necessary amount in the TR handle*/
dkato 5:49a61433290a 227 handle->trPtr = NULL;
dkato 5:49a61433290a 228 handle->trPtr = ( STB_INT8 * )malloc( tmpVal ) ; /*keep necessary amount in the TR handle*/
dkato 5:49a61433290a 229 if( handle->trPtr == NULL )
dkato 5:49a61433290a 230 {
dkato 5:49a61433290a 231 free ( handle->trPtr );
dkato 5:49a61433290a 232 free ( handle );
dkato 5:49a61433290a 233 return NULL;
dkato 5:49a61433290a 234 }
dkato 5:49a61433290a 235 ShareTrSize ( handle , execFlg ); /*Malloc-area is allocated to things that need Malloc in TR handle*/
dkato 5:49a61433290a 236
dkato 5:49a61433290a 237 /*set initial value*/
dkato 5:49a61433290a 238 if( execFlg->faceTr == STB_TRUE )
dkato 5:49a61433290a 239 {
dkato 5:49a61433290a 240 for( i = 0 ; i < STB_TR_BACK_MAX ; i++)
dkato 5:49a61433290a 241 {
dkato 5:49a61433290a 242 handle->fcRec[i].cnt= 0;
dkato 5:49a61433290a 243 for( j = 0 ; j < handle->traCntMax ; j++)
dkato 5:49a61433290a 244 {
dkato 5:49a61433290a 245 handle->fcRec[i].nDetID [j] = -1;
dkato 5:49a61433290a 246 handle->fcRec[i].nTraID [j] = -1;
dkato 5:49a61433290a 247 handle->fcRec[i].posX [j] = 0;
dkato 5:49a61433290a 248 handle->fcRec[i].posY [j] = 0;
dkato 5:49a61433290a 249 handle->fcRec[i].size [j] = -1;
dkato 5:49a61433290a 250 handle->fcRec[i].retryN [j] = -1;
dkato 5:49a61433290a 251 handle->fcRec[i].conf [j] = -1;
dkato 5:49a61433290a 252 }
dkato 5:49a61433290a 253 }
dkato 5:49a61433290a 254 }
dkato 5:49a61433290a 255 if( execFlg->bodyTr == STB_TRUE )
dkato 5:49a61433290a 256 {
dkato 5:49a61433290a 257 for( i = 0 ; i < STB_TR_BACK_MAX ; i++)
dkato 5:49a61433290a 258 {
dkato 5:49a61433290a 259 handle->bdRec[i].cnt= 0;
dkato 5:49a61433290a 260 for( j = 0 ; j < handle->traCntMax ; j++)
dkato 5:49a61433290a 261 {
dkato 5:49a61433290a 262 handle->bdRec[i].nDetID [j] = -1;
dkato 5:49a61433290a 263 handle->bdRec[i].nTraID [j] = -1;
dkato 5:49a61433290a 264 handle->bdRec[i].posX [j] = 0;
dkato 5:49a61433290a 265 handle->bdRec[i].posY [j] = 0;
dkato 5:49a61433290a 266 handle->bdRec[i].size [j] = -1;
dkato 5:49a61433290a 267 handle->bdRec[i].retryN [j] = -1;
dkato 5:49a61433290a 268 handle->bdRec[i].conf [j] = -1;
dkato 5:49a61433290a 269 }
dkato 5:49a61433290a 270 }
dkato 5:49a61433290a 271 }
dkato 5:49a61433290a 272
dkato 5:49a61433290a 273
dkato 5:49a61433290a 274
dkato 5:49a61433290a 275 handle->execFlg->pet = execFlg->pet ;
dkato 5:49a61433290a 276 handle->execFlg->hand = execFlg->hand ;
dkato 5:49a61433290a 277 handle->execFlg->bodyTr = execFlg->bodyTr ;
dkato 5:49a61433290a 278 handle->execFlg->faceTr = execFlg->faceTr ;
dkato 5:49a61433290a 279 handle->execFlg->gen = execFlg->gen ;
dkato 5:49a61433290a 280 handle->execFlg->age = execFlg->age ;
dkato 5:49a61433290a 281 handle->execFlg->fr = execFlg->fr ;
dkato 5:49a61433290a 282 handle->execFlg->exp = execFlg->exp ;
dkato 5:49a61433290a 283 handle->execFlg->gaz = execFlg->gaz ;
dkato 5:49a61433290a 284 handle->execFlg->dir = execFlg->dir ;
dkato 5:49a61433290a 285 handle->execFlg->bli = execFlg->bli ;
dkato 5:49a61433290a 286
dkato 5:49a61433290a 287
dkato 5:49a61433290a 288 return handle;
dkato 5:49a61433290a 289 }
dkato 5:49a61433290a 290 /*---------------------------------------------------------------------
dkato 5:49a61433290a 291 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 292
dkato 5:49a61433290a 293 /*Delete handle*/
dkato 5:49a61433290a 294 STB_INT32 TrDeleteHandle(TRHANDLE handle)
dkato 5:49a61433290a 295 {
dkato 5:49a61433290a 296 STB_INT32 nRet;
dkato 5:49a61433290a 297
dkato 5:49a61433290a 298 /*NULL check*/
dkato 5:49a61433290a 299 nRet = TrIsValidPointer(handle);
dkato 5:49a61433290a 300 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 301 return STB_ERR_NOHANDLE;
dkato 5:49a61433290a 302 }
dkato 5:49a61433290a 303
dkato 5:49a61433290a 304 free ( handle->trPtr );
dkato 5:49a61433290a 305 free ( handle );
dkato 5:49a61433290a 306
dkato 5:49a61433290a 307 return STB_NORMAL;
dkato 5:49a61433290a 308 }
dkato 5:49a61433290a 309
dkato 5:49a61433290a 310 /*---------------------------------------------------------------------
dkato 5:49a61433290a 311 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 312 /*Set the result*/
dkato 5:49a61433290a 313 STB_INT32 TrSetDetect(TRHANDLE handle,const STB_TR_DET *stbTrDet){
dkato 5:49a61433290a 314 STB_INT32 nRet;
dkato 5:49a61433290a 315 STB_INT32 i;
dkato 5:49a61433290a 316
dkato 5:49a61433290a 317 /*NULL check*/
dkato 5:49a61433290a 318 nRet = TrIsValidPointer(handle);
dkato 5:49a61433290a 319 if(nRet != STB_NORMAL)
dkato 5:49a61433290a 320 {
dkato 5:49a61433290a 321 return STB_ERR_NOHANDLE;
dkato 5:49a61433290a 322 }
dkato 5:49a61433290a 323
dkato 5:49a61433290a 324 nRet = TrIsValidPointer(stbTrDet);
dkato 5:49a61433290a 325 if(nRet != STB_NORMAL)
dkato 5:49a61433290a 326 {
dkato 5:49a61433290a 327 return nRet;
dkato 5:49a61433290a 328 }
dkato 5:49a61433290a 329
dkato 5:49a61433290a 330 /*Input value check*/
dkato 5:49a61433290a 331 nRet = STB_TrIsValidValue ( stbTrDet ,handle->execFlg );
dkato 5:49a61433290a 332 if(nRet != STB_TRUE)
dkato 5:49a61433290a 333 {
dkato 5:49a61433290a 334 return STB_ERR_INVALIDPARAM;
dkato 5:49a61433290a 335 }
dkato 5:49a61433290a 336
dkato 5:49a61433290a 337 /*Set the received result to the handle (stbTrDet)*/
dkato 5:49a61433290a 338 /* Face */
dkato 5:49a61433290a 339 if( handle->execFlg->faceTr == STB_TRUE )
dkato 5:49a61433290a 340 {
dkato 5:49a61433290a 341 handle->stbTrDet->fcNum = stbTrDet->fcNum;
dkato 5:49a61433290a 342 for( i = 0 ; i < handle->stbTrDet->fcNum ; i++ )
dkato 5:49a61433290a 343 {
dkato 5:49a61433290a 344 handle->stbTrDet->fcDet[i].posX = stbTrDet->fcDet[i].posX;
dkato 5:49a61433290a 345 handle->stbTrDet->fcDet[i].posY = stbTrDet->fcDet[i].posY;
dkato 5:49a61433290a 346 handle->stbTrDet->fcDet[i].size = stbTrDet->fcDet[i].size;
dkato 5:49a61433290a 347 handle->stbTrDet->fcDet[i].conf = stbTrDet->fcDet[i].conf;
dkato 5:49a61433290a 348 }
dkato 5:49a61433290a 349 }else
dkato 5:49a61433290a 350 {
dkato 5:49a61433290a 351 handle->stbTrDet->fcNum = 0;
dkato 5:49a61433290a 352 }
dkato 5:49a61433290a 353
dkato 5:49a61433290a 354 /* Body */
dkato 5:49a61433290a 355 if( handle->execFlg->bodyTr == STB_TRUE )
dkato 5:49a61433290a 356 {
dkato 5:49a61433290a 357 handle->stbTrDet->bdNum = stbTrDet->bdNum;
dkato 5:49a61433290a 358 for( i = 0 ; i < handle->stbTrDet->bdNum ; i++ )
dkato 5:49a61433290a 359 {
dkato 5:49a61433290a 360 handle->stbTrDet->bdDet[i].posX = stbTrDet->bdDet[i].posX;
dkato 5:49a61433290a 361 handle->stbTrDet->bdDet[i].posY = stbTrDet->bdDet[i].posY;
dkato 5:49a61433290a 362 handle->stbTrDet->bdDet[i].size = stbTrDet->bdDet[i].size;
dkato 5:49a61433290a 363 handle->stbTrDet->bdDet[i].conf = stbTrDet->bdDet[i].conf;
dkato 5:49a61433290a 364 }
dkato 5:49a61433290a 365 }else
dkato 5:49a61433290a 366 {
dkato 5:49a61433290a 367 handle->stbTrDet->bdNum = 0;
dkato 5:49a61433290a 368 }
dkato 5:49a61433290a 369
dkato 5:49a61433290a 370
dkato 5:49a61433290a 371
dkato 5:49a61433290a 372 return STB_NORMAL;
dkato 5:49a61433290a 373 }
dkato 5:49a61433290a 374 /*---------------------------------------------------------------------
dkato 5:49a61433290a 375 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 376 /*Main process execution*/
dkato 5:49a61433290a 377 STB_INT32 TrExecute(TRHANDLE handle){
dkato 5:49a61433290a 378
dkato 5:49a61433290a 379 STB_INT32 nRet;
dkato 5:49a61433290a 380 /*NULL check*/
dkato 5:49a61433290a 381 nRet = TrIsValidPointer(handle);
dkato 5:49a61433290a 382 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 383 return STB_ERR_NOHANDLE;
dkato 5:49a61433290a 384 }
dkato 5:49a61433290a 385
dkato 5:49a61433290a 386 /*Main processing here*/
dkato 5:49a61433290a 387 nRet = StbTrExec ( handle );
dkato 5:49a61433290a 388
dkato 5:49a61433290a 389
dkato 5:49a61433290a 390 return STB_NORMAL;
dkato 5:49a61433290a 391 }
dkato 5:49a61433290a 392 /*---------------------------------------------------------------------
dkato 5:49a61433290a 393 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 394 /*Get-Function of results*/
dkato 5:49a61433290a 395 STB_INT32 TrGetResult(TRHANDLE handle,STB_TR_RES_FACES* fcResult,STB_TR_RES_BODYS* bdResult){
dkato 5:49a61433290a 396
dkato 5:49a61433290a 397 STB_INT32 nRet;
dkato 5:49a61433290a 398 STB_INT32 i;
dkato 5:49a61433290a 399
dkato 5:49a61433290a 400 /*NULL check*/
dkato 5:49a61433290a 401 nRet = TrIsValidPointer(handle);
dkato 5:49a61433290a 402 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 403 return STB_ERR_NOHANDLE;
dkato 5:49a61433290a 404 }
dkato 5:49a61433290a 405
dkato 5:49a61433290a 406 if( handle->execFlg->faceTr == STB_TRUE )
dkato 5:49a61433290a 407 {
dkato 5:49a61433290a 408 nRet = TrIsValidPointer(fcResult);
dkato 5:49a61433290a 409 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 410 return nRet;
dkato 5:49a61433290a 411 }
dkato 5:49a61433290a 412 }
dkato 5:49a61433290a 413 if( handle->execFlg->bodyTr == STB_TRUE )
dkato 5:49a61433290a 414 {
dkato 5:49a61433290a 415 nRet = TrIsValidPointer(bdResult);
dkato 5:49a61433290a 416 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 417 return nRet;
dkato 5:49a61433290a 418 }
dkato 5:49a61433290a 419 }
dkato 5:49a61433290a 420
dkato 5:49a61433290a 421 /*Get result from handle*/
dkato 5:49a61433290a 422
dkato 5:49a61433290a 423 /* Face */
dkato 5:49a61433290a 424 if( handle->execFlg->faceTr == STB_TRUE )
dkato 5:49a61433290a 425 {
dkato 5:49a61433290a 426 fcResult->cnt = handle->resFaces->cnt ;
dkato 5:49a61433290a 427 for( i = 0 ; i < handle->resFaces->cnt ; i++ )
dkato 5:49a61433290a 428 {
dkato 5:49a61433290a 429 fcResult->face[i].nDetID = handle->resFaces->face[i].nDetID ;
dkato 5:49a61433290a 430 fcResult->face[i].nTraID = handle->resFaces->face[i].nTraID ;
dkato 5:49a61433290a 431 fcResult->face[i].pos.x = handle->resFaces->face[i].pos.x ;
dkato 5:49a61433290a 432 fcResult->face[i].pos.y = handle->resFaces->face[i].pos.y ;
dkato 5:49a61433290a 433 fcResult->face[i].size = handle->resFaces->face[i].size ;
dkato 5:49a61433290a 434 fcResult->face[i].conf = handle->resFaces->face[i].conf ;
dkato 5:49a61433290a 435 }
dkato 5:49a61433290a 436 for( i = handle->resFaces->cnt ; i < handle->traCntMax ; i++ )
dkato 5:49a61433290a 437 {
dkato 5:49a61433290a 438 fcResult->face[i].nDetID = -1 ;
dkato 5:49a61433290a 439 fcResult->face[i].nTraID = -1 ;
dkato 5:49a61433290a 440 fcResult->face[i].pos.x = 0 ;
dkato 5:49a61433290a 441 fcResult->face[i].pos.y = 0 ;
dkato 5:49a61433290a 442 fcResult->face[i].size = -1 ;
dkato 5:49a61433290a 443 fcResult->face[i].conf = STB_CONF_NO_DATA ;
dkato 5:49a61433290a 444 }
dkato 5:49a61433290a 445 }
dkato 5:49a61433290a 446
dkato 5:49a61433290a 447 /* Body */
dkato 5:49a61433290a 448 if( handle->execFlg->bodyTr == STB_TRUE )
dkato 5:49a61433290a 449 {
dkato 5:49a61433290a 450 bdResult->cnt = handle->resBodys->cnt ;
dkato 5:49a61433290a 451 for( i = 0 ; i < handle->resBodys->cnt ; i++ )
dkato 5:49a61433290a 452 {
dkato 5:49a61433290a 453 bdResult->body[i].nDetID = handle->resBodys->body[i].nDetID ;
dkato 5:49a61433290a 454 bdResult->body[i].nTraID = handle->resBodys->body[i].nTraID ;
dkato 5:49a61433290a 455 bdResult->body[i].pos.x = handle->resBodys->body[i].pos.x ;
dkato 5:49a61433290a 456 bdResult->body[i].pos.y = handle->resBodys->body[i].pos.y ;
dkato 5:49a61433290a 457 bdResult->body[i].size = handle->resBodys->body[i].size ;
dkato 5:49a61433290a 458 bdResult->body[i].conf = handle->resBodys->body[i].conf ;
dkato 5:49a61433290a 459 }
dkato 5:49a61433290a 460 for( i = handle->resBodys->cnt ; i < handle->traCntMax ; i++ )
dkato 5:49a61433290a 461 {
dkato 5:49a61433290a 462 bdResult->body[i].nDetID = -1 ;
dkato 5:49a61433290a 463 bdResult->body[i].nTraID = -1 ;
dkato 5:49a61433290a 464 bdResult->body[i].pos.x = 0 ;
dkato 5:49a61433290a 465 bdResult->body[i].pos.y = 0 ;
dkato 5:49a61433290a 466 bdResult->body[i].size = -1 ;
dkato 5:49a61433290a 467 bdResult->body[i].conf = STB_CONF_NO_DATA ;
dkato 5:49a61433290a 468 }
dkato 5:49a61433290a 469 }
dkato 5:49a61433290a 470
dkato 5:49a61433290a 471 return STB_NORMAL;
dkato 5:49a61433290a 472 }
dkato 5:49a61433290a 473 /*---------------------------------------------------------------------
dkato 5:49a61433290a 474 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 475 /*Clear*/
dkato 5:49a61433290a 476 STB_INT32 TrClear(TRHANDLE handle){
dkato 5:49a61433290a 477
dkato 5:49a61433290a 478 STB_INT32 nRet;
dkato 5:49a61433290a 479 STB_INT32 i , j;
dkato 5:49a61433290a 480
dkato 5:49a61433290a 481
dkato 5:49a61433290a 482 /*NULL check*/
dkato 5:49a61433290a 483 nRet = TrIsValidPointer(handle);
dkato 5:49a61433290a 484 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 485 return STB_ERR_NOHANDLE;
dkato 5:49a61433290a 486 }
dkato 5:49a61433290a 487
dkato 5:49a61433290a 488
dkato 5:49a61433290a 489 if( handle->execFlg->faceTr == STB_TRUE )
dkato 5:49a61433290a 490 {
dkato 5:49a61433290a 491 for( i = 0 ; i < STB_TR_BACK_MAX ; i++)
dkato 5:49a61433290a 492 {
dkato 5:49a61433290a 493 handle->fcRec[i].cnt= 0;
dkato 5:49a61433290a 494 for( j = 0 ; j < handle->traCntMax ; j++)
dkato 5:49a61433290a 495 {
dkato 5:49a61433290a 496 handle->fcRec[i].nDetID [j] = -1;
dkato 5:49a61433290a 497 handle->fcRec[i].nTraID [j] = -1;
dkato 5:49a61433290a 498 handle->fcRec[i].posX [j] = 0 ;
dkato 5:49a61433290a 499 handle->fcRec[i].posY [j] = 0 ;
dkato 5:49a61433290a 500 handle->fcRec[i].size [j] = -1;
dkato 5:49a61433290a 501 handle->fcRec[i].retryN [j] = -1;
dkato 5:49a61433290a 502 handle->fcRec[i].conf [j] = -1;
dkato 5:49a61433290a 503 }
dkato 5:49a61433290a 504 }
dkato 5:49a61433290a 505 handle->fcCntAcc = 0;
dkato 5:49a61433290a 506 }
dkato 5:49a61433290a 507
dkato 5:49a61433290a 508 if( handle->execFlg->bodyTr == STB_TRUE )
dkato 5:49a61433290a 509 {
dkato 5:49a61433290a 510 for( i = 0 ; i < STB_TR_BACK_MAX ; i++)
dkato 5:49a61433290a 511 {
dkato 5:49a61433290a 512 handle->bdRec[i].cnt= 0;
dkato 5:49a61433290a 513 for( j = 0 ; j < handle->traCntMax ; j++)
dkato 5:49a61433290a 514 {
dkato 5:49a61433290a 515 handle->bdRec[i].nDetID [j] = -1;
dkato 5:49a61433290a 516 handle->bdRec[i].nTraID [j] = -1;
dkato 5:49a61433290a 517 handle->bdRec[i].posX [j] = 0 ;
dkato 5:49a61433290a 518 handle->bdRec[i].posY [j] = 0 ;
dkato 5:49a61433290a 519 handle->bdRec[i].size [j] = -1;
dkato 5:49a61433290a 520 handle->bdRec[i].retryN [j] = -1;
dkato 5:49a61433290a 521 handle->bdRec[i].conf [j] = -1;
dkato 5:49a61433290a 522 }
dkato 5:49a61433290a 523 }
dkato 5:49a61433290a 524 handle->bdCntAcc = 0;
dkato 5:49a61433290a 525 }
dkato 5:49a61433290a 526
dkato 5:49a61433290a 527 return STB_NORMAL;
dkato 5:49a61433290a 528 }
dkato 5:49a61433290a 529 /*---------------------------------------------------------------------
dkato 5:49a61433290a 530 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 531 /* */
dkato 5:49a61433290a 532 STB_INT32 TrSetRetryCount(TRHANDLE handle, STB_INT32 nRetryCount)
dkato 5:49a61433290a 533 {
dkato 5:49a61433290a 534 STB_INT32 nRet;
dkato 5:49a61433290a 535 nRet = TrIsValidPointer(handle);
dkato 5:49a61433290a 536 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 537 return STB_ERR_NOHANDLE;
dkato 5:49a61433290a 538 }
dkato 5:49a61433290a 539
dkato 5:49a61433290a 540 if( nRetryCount < STB_TR_MIN_RETRY || STB_TR_MAX_RETRY < nRetryCount)
dkato 5:49a61433290a 541 {
dkato 5:49a61433290a 542 return STB_ERR_INVALIDPARAM;
dkato 5:49a61433290a 543 }
dkato 5:49a61433290a 544
dkato 5:49a61433290a 545 handle->retryCnt = nRetryCount;
dkato 5:49a61433290a 546 return STB_NORMAL;
dkato 5:49a61433290a 547 }
dkato 5:49a61433290a 548 /*---------------------------------------------------------------------
dkato 5:49a61433290a 549 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 550 STB_INT32 TrGetRetryCount ( TRHANDLE handle , STB_INT32* nRetryCount )
dkato 5:49a61433290a 551 {
dkato 5:49a61433290a 552 STB_INT32 nRet;
dkato 5:49a61433290a 553 nRet = TrIsValidPointer(handle);
dkato 5:49a61433290a 554 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 555 return STB_ERR_NOHANDLE;
dkato 5:49a61433290a 556 }
dkato 5:49a61433290a 557 nRet = TrIsValidPointer(nRetryCount);
dkato 5:49a61433290a 558 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 559 return STB_ERR_INVALIDPARAM;
dkato 5:49a61433290a 560 }
dkato 5:49a61433290a 561
dkato 5:49a61433290a 562 *nRetryCount = handle->retryCnt ;
dkato 5:49a61433290a 563 return STB_NORMAL;
dkato 5:49a61433290a 564 }
dkato 5:49a61433290a 565 /*---------------------------------------------------------------------
dkato 5:49a61433290a 566 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 567 STB_INT32 TrSetStedinessParam ( TRHANDLE handle , STB_INT32 nStedinessPos , STB_INT32 nStedinessSize )
dkato 5:49a61433290a 568 {
dkato 5:49a61433290a 569 if( nStedinessPos < STB_TR_MIN_STEADINESS_POS || STB_TR_MAX_STEADINESS_POS < nStedinessPos)
dkato 5:49a61433290a 570 {
dkato 5:49a61433290a 571 return STB_ERR_INVALIDPARAM;
dkato 5:49a61433290a 572 }
dkato 5:49a61433290a 573 if( nStedinessSize < STB_TR_MIN_STEADINESS_SIZE || STB_TR_MAX_STEADINESS_SIZE < nStedinessSize)
dkato 5:49a61433290a 574 {
dkato 5:49a61433290a 575 return STB_ERR_INVALIDPARAM;
dkato 5:49a61433290a 576 }
dkato 5:49a61433290a 577 handle->stedPos = nStedinessPos;
dkato 5:49a61433290a 578 handle->stedSize = nStedinessSize;
dkato 5:49a61433290a 579 return STB_NORMAL;
dkato 5:49a61433290a 580 }
dkato 5:49a61433290a 581 /*---------------------------------------------------------------------
dkato 5:49a61433290a 582 ---------------------------------------------------------------------*/
dkato 5:49a61433290a 583 STB_INT32 TrGetStedinessParam ( TRHANDLE handle , STB_INT32* nStedinessPos , STB_INT32* nStedinessSize )
dkato 5:49a61433290a 584 {
dkato 5:49a61433290a 585 STB_INT32 nRet;
dkato 5:49a61433290a 586 nRet = TrIsValidPointer(handle);
dkato 5:49a61433290a 587 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 588 return STB_ERR_NOHANDLE;
dkato 5:49a61433290a 589 }
dkato 5:49a61433290a 590 nRet = TrIsValidPointer(nStedinessPos);
dkato 5:49a61433290a 591 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 592 return STB_ERR_INVALIDPARAM;
dkato 5:49a61433290a 593 }
dkato 5:49a61433290a 594 nRet = TrIsValidPointer(nStedinessSize);
dkato 5:49a61433290a 595 if(nRet != STB_NORMAL){
dkato 5:49a61433290a 596 return STB_ERR_INVALIDPARAM;
dkato 5:49a61433290a 597 }
dkato 5:49a61433290a 598 *nStedinessPos = handle->stedPos ;
dkato 5:49a61433290a 599 *nStedinessSize = handle->stedSize ;
dkato 5:49a61433290a 600 return STB_NORMAL;
dkato 5:49a61433290a 601 }
dkato 5:49a61433290a 602 /*---------------------------------------------------------------------
dkato 5:49a61433290a 603 ---------------------------------------------------------------------*/