Lines Matching refs:ptrA
45 struct bbf_Scanner* ptrA, in bbf_Scanner_alloc() argument
55 uint32 proL = ptrA->maxRadiusE; in bbf_Scanner_alloc()
59 uint32 woL = ptrA->maxImageWidthE; in bbf_Scanner_alloc()
60 uint32 hoL = ptrA->maxImageHeightE; in bbf_Scanner_alloc()
63 uint32 xwoL = woL + ( ptrA->borderWidthE << 1 ); in bbf_Scanner_alloc()
64 uint32 xhoL = hoL + ( ptrA->borderHeightE << 1 ); in bbf_Scanner_alloc()
67 bbs_UInt16Arr_create( cpA, &ptrA->workImageE, ( ( woL >> 1 ) + ( woL & 1 ) ) * hoL, mspL ); in bbf_Scanner_alloc()
69 bbs_UInt16Arr_fill( cpA, &ptrA->workImageE, 0 ); in bbf_Scanner_alloc()
72 …bim_UInt32Image_create( cpA, &ptrA->bitImageE, xwoL, ( xhoL >> 5 ) + ( ( ( xhoL & 0x1F ) != 0 ) ? … in bbf_Scanner_alloc()
74 bim_UInt32Image_setAllPixels( cpA, &ptrA->bitImageE, 0, 0 ); in bbf_Scanner_alloc()
77 bbs_UInt32Arr_create( cpA, &ptrA->patchBufferE, ptrA->bitImageE.widthE, mspL ); in bbf_Scanner_alloc()
79 bbs_UInt32Arr_fill( cpA, &ptrA->patchBufferE, 0 ); in bbf_Scanner_alloc()
82 bbs_UInt16Arr_create( cpA, &ptrA->lineBufE, woL + ( woL & 1 ), sspL ); in bbf_Scanner_alloc()
85 bim_UInt32Image_create( cpA, &ptrA->satE, woL + pwoL, pwoL + 1, sspL ); in bbf_Scanner_alloc()
88 bbs_UInt32Arr_create( cpA, &ptrA->idxArrE, ptrA->bufferSizeE, mspL ); in bbf_Scanner_alloc()
89 bbs_Int32Arr_create( cpA, &ptrA->actArrE, ptrA->bufferSizeE, mspL ); in bbf_Scanner_alloc()
91 bbs_Int32Arr_create( cpA, &ptrA->outArrE, ptrA->bufferSizeE >> 1, espL ); in bbf_Scanner_alloc()
97 void bbf_Scanner_downscale( struct bbs_Context* cpA, struct bbf_Scanner* ptrA ) in bbf_Scanner_downscale() argument
99 uint32 w0L = ptrA->workWidthE; in bbf_Scanner_downscale()
100 uint32 h0L = ptrA->workHeightE; in bbf_Scanner_downscale()
104 uint16* arrL = ptrA->workImageE.arrPtrE; in bbf_Scanner_downscale()
129 ptrA->workWidthE = w1L; in bbf_Scanner_downscale()
130 ptrA->workHeightE = h1L; in bbf_Scanner_downscale()
131 ptrA->scaleExpE++; in bbf_Scanner_downscale()
140 void bbf_Scanner_copyImage( struct bbs_Context* cpA, struct bbf_Scanner* ptrA, const void* imagePtr… in bbf_Scanner_copyImage() argument
144 if( imageWidthA > ptrA->maxImageWidthE || imageHeightA > ptrA->maxImageHeightE ) in bbf_Scanner_copyImage()
147 fNameL, imageWidthA, imageHeightA, ptrA->maxImageWidthE, ptrA->maxImageHeightE ); in bbf_Scanner_copyImage()
155 uint16* dstL = ptrA->workImageE.arrPtrE; in bbf_Scanner_copyImage()
156 ptrA->workWidthE = imageWidthA; in bbf_Scanner_copyImage()
157 ptrA->workHeightE = imageHeightA; in bbf_Scanner_copyImage()
158 for( iL = 0; iL < ptrA->workHeightE; iL++ ) in bbf_Scanner_copyImage()
160 for( jL = ptrA->workWidthE >> 1; jL > 0; jL-- ) in bbf_Scanner_copyImage()
167 if( ptrA->workWidthE & 1 ) *dstL++ = *srcL++; in bbf_Scanner_copyImage()
174 uint16* dstL = ptrA->workImageE.arrPtrE; in bbf_Scanner_copyImage()
187 ptrA->workWidthE = roiPtrA->x2E - roiPtrA->x1E; in bbf_Scanner_copyImage()
188 ptrA->workHeightE = roiPtrA->y2E - roiPtrA->y1E; in bbf_Scanner_copyImage()
189 for( iL = 0; iL < ptrA->workHeightE; iL++ ) in bbf_Scanner_copyImage()
191 for( jL = ptrA->workWidthE >> 1; jL > 0; jL-- ) in bbf_Scanner_copyImage()
198 if( ptrA->workWidthE & 1 ) *dstL++ = *srcL++; in bbf_Scanner_copyImage()
200 srcL += imageWidthA - ptrA->workWidthE; in bbf_Scanner_copyImage()
208 void bbf_Scanner_createBitImage( struct bbs_Context* cpA, struct bbf_Scanner* ptrA ) in bbf_Scanner_createBitImage() argument
234 proL = ptrA->bitParamE.outerRadiusE; in bbf_Scanner_createBitImage()
235 priL = ptrA->bitParamE.innerRadiusE; in bbf_Scanner_createBitImage()
239 if( ptrA->borderHeightE >= 32 ) in bbf_Scanner_createBitImage()
252 wiL = ptrA->workWidthE; in bbf_Scanner_createBitImage()
253 hiL = ptrA->workHeightE; in bbf_Scanner_createBitImage()
257 stepL = ptrA->scaleE >> ( ptrA->scaleExpE + 4 ); in bbf_Scanner_createBitImage()
273 xwoL = woL + ( ptrA->borderWidthE << 1 ); in bbf_Scanner_createBitImage()
274 xhoL = hoL + ( ptrA->borderHeightE << 1 ); in bbf_Scanner_createBitImage()
276 ptrA->currentWidthE = xwoL; in bbf_Scanner_createBitImage()
277 ptrA->currentHeightE = xhoL; in bbf_Scanner_createBitImage()
280 …bim_UInt32Image_size( cpA, &ptrA->bitImageE, xwoL, ( xhoL >> 5 ) + ( ( ( xhoL & 0x1F ) != 0 ) ? 1 … in bbf_Scanner_createBitImage()
281 bim_UInt32Image_setAllPixels( cpA, &ptrA->bitImageE, 0, 0 ); in bbf_Scanner_createBitImage()
283 bitMaskL = ( uint32 )1 << ptrA->borderHeightE; in bbf_Scanner_createBitImage()
284 bitRowL = ( uint32* )ptrA->bitImageE.arrE.arrPtrE + ptrA->borderWidthE; in bbf_Scanner_createBitImage()
292 bim_UInt32Image_size( cpA, &ptrA->satE, wsL, hsL ); in bbf_Scanner_createBitImage()
294 satL = ptrA->satE.arrE.arrPtrE; in bbf_Scanner_createBitImage()
297 lBufL = ptrA->lineBufE.arrPtrE; in bbf_Scanner_createBitImage()
321 const uint16* arr0L = ptrA->workImageE.arrPtrE + ypL * wi2L; in bbf_Scanner_createBitImage()
407 void bbf_Scanner_initPatchBuffer( struct bbs_Context* cpA, struct bbf_Scanner* ptrA ) in bbf_Scanner_initPatchBuffer() argument
409 bbs_UInt32Arr_size( cpA, &ptrA->patchBufferE, ptrA->bitImageE.widthE ); in bbf_Scanner_initPatchBuffer()
410 bbs_memcpy32( ptrA->patchBufferE.arrPtrE, ptrA->bitImageE.arrE.arrPtrE, ptrA->bitImageE.widthE ); in bbf_Scanner_initPatchBuffer()
424 struct bbf_Scanner* ptrA ) in bbf_Scanner_init() argument
426 ptrA->scaleExpE = 0; in bbf_Scanner_init()
427 ptrA->scaleE = 0; in bbf_Scanner_init()
428 ptrA->xE = 0; in bbf_Scanner_init()
429 ptrA->yE = 0; in bbf_Scanner_init()
430 ptrA->effMaxScaleE = 0; in bbf_Scanner_init()
431 ptrA->currentWidthE = 0; in bbf_Scanner_init()
432 ptrA->currentHeightE = 0; in bbf_Scanner_init()
433 ptrA->workWidthE = 0; in bbf_Scanner_init()
434 ptrA->workHeightE = 0; in bbf_Scanner_init()
435 bbf_BitParam_init( cpA, &ptrA->bitParamE ); in bbf_Scanner_init()
436 bbs_UInt16Arr_init( cpA, &ptrA->workImageE ); in bbf_Scanner_init()
437 bim_UInt32Image_init( cpA, &ptrA->satE ); in bbf_Scanner_init()
438 bim_UInt32Image_init( cpA, &ptrA->bitImageE ); in bbf_Scanner_init()
439 bbs_UInt32Arr_init( cpA, &ptrA->patchBufferE ); in bbf_Scanner_init()
440 bbs_UInt16Arr_init( cpA, &ptrA->lineBufE ); in bbf_Scanner_init()
442 bbs_UInt32Arr_init( cpA, &ptrA->idxArrE ); in bbf_Scanner_init()
443 bbs_Int32Arr_init( cpA, &ptrA->actArrE ); in bbf_Scanner_init()
444 bbs_Int32Arr_init( cpA, &ptrA->outArrE ); in bbf_Scanner_init()
445 ptrA->outCountE = 0; in bbf_Scanner_init()
446 ptrA->intCountE = 0; in bbf_Scanner_init()
447 ptrA->bufferSizeE = 1024; in bbf_Scanner_init()
449 ptrA->maxImageWidthE = 0; in bbf_Scanner_init()
450 ptrA->maxImageHeightE = 0; in bbf_Scanner_init()
451 ptrA->maxRadiusE = 0; in bbf_Scanner_init()
452 ptrA->patchWidthE = 0; in bbf_Scanner_init()
453 ptrA->patchHeightE = 0; in bbf_Scanner_init()
454 ptrA->minScaleE = 0; in bbf_Scanner_init()
455 ptrA->maxScaleE = 0; in bbf_Scanner_init()
456 ptrA->scaleStepE = 0; in bbf_Scanner_init()
457 ptrA->borderWidthE = 0; in bbf_Scanner_init()
458 ptrA->borderHeightE = 0; in bbf_Scanner_init()
464 struct bbf_Scanner* ptrA ) in bbf_Scanner_exit() argument
466 ptrA->scaleExpE = 0; in bbf_Scanner_exit()
467 ptrA->scaleE = 0; in bbf_Scanner_exit()
468 ptrA->xE = 0; in bbf_Scanner_exit()
469 ptrA->yE = 0; in bbf_Scanner_exit()
470 ptrA->effMaxScaleE = 0; in bbf_Scanner_exit()
471 ptrA->currentWidthE = 0; in bbf_Scanner_exit()
472 ptrA->currentHeightE = 0; in bbf_Scanner_exit()
473 ptrA->workWidthE = 0; in bbf_Scanner_exit()
474 ptrA->workHeightE = 0; in bbf_Scanner_exit()
475 bbf_BitParam_exit( cpA, &ptrA->bitParamE ); in bbf_Scanner_exit()
476 bbs_UInt16Arr_exit( cpA, &ptrA->workImageE ); in bbf_Scanner_exit()
477 bim_UInt32Image_exit( cpA, &ptrA->satE ); in bbf_Scanner_exit()
478 bim_UInt32Image_exit( cpA, &ptrA->bitImageE ); in bbf_Scanner_exit()
479 bbs_UInt32Arr_exit( cpA, &ptrA->patchBufferE ); in bbf_Scanner_exit()
480 bbs_UInt16Arr_exit( cpA, &ptrA->lineBufE ); in bbf_Scanner_exit()
482 bbs_UInt32Arr_exit( cpA, &ptrA->idxArrE ); in bbf_Scanner_exit()
483 bbs_Int32Arr_exit( cpA, &ptrA->actArrE ); in bbf_Scanner_exit()
484 bbs_Int32Arr_exit( cpA, &ptrA->outArrE ); in bbf_Scanner_exit()
485 ptrA->outCountE = 0; in bbf_Scanner_exit()
486 ptrA->intCountE = 0; in bbf_Scanner_exit()
487 ptrA->bufferSizeE = 1024; in bbf_Scanner_exit()
489 ptrA->maxImageWidthE = 0; in bbf_Scanner_exit()
490 ptrA->maxImageHeightE = 0; in bbf_Scanner_exit()
491 ptrA->maxRadiusE = 0; in bbf_Scanner_exit()
492 ptrA->patchWidthE = 0; in bbf_Scanner_exit()
493 ptrA->patchHeightE = 0; in bbf_Scanner_exit()
494 ptrA->minScaleE = 0; in bbf_Scanner_exit()
495 ptrA->maxScaleE = 0; in bbf_Scanner_exit()
496 ptrA->scaleStepE = 0; in bbf_Scanner_exit()
497 ptrA->borderWidthE = 0; in bbf_Scanner_exit()
498 ptrA->borderHeightE = 0; in bbf_Scanner_exit()
512 struct bbf_Scanner* ptrA, in bbf_Scanner_copy() argument
515 ptrA->scaleExpE = srcPtrA->scaleExpE; in bbf_Scanner_copy()
516 ptrA->scaleE = srcPtrA->scaleE; in bbf_Scanner_copy()
517 ptrA->xE = srcPtrA->xE; in bbf_Scanner_copy()
518 ptrA->yE = srcPtrA->yE; in bbf_Scanner_copy()
519 ptrA->effMaxScaleE = srcPtrA->effMaxScaleE; in bbf_Scanner_copy()
520 ptrA->currentWidthE = srcPtrA->currentWidthE; in bbf_Scanner_copy()
521 ptrA->currentHeightE = srcPtrA->currentHeightE; in bbf_Scanner_copy()
522 ptrA->workWidthE = srcPtrA->workWidthE; in bbf_Scanner_copy()
523 ptrA->workHeightE = srcPtrA->workHeightE; in bbf_Scanner_copy()
525 bbf_BitParam_copy( cpA, &ptrA->bitParamE, &srcPtrA->bitParamE ); in bbf_Scanner_copy()
526 bbs_UInt16Arr_copy( cpA, &ptrA->workImageE, &srcPtrA->workImageE ); in bbf_Scanner_copy()
527 bim_UInt32Image_copy( cpA, &ptrA->satE, &srcPtrA->satE ); in bbf_Scanner_copy()
528 bim_UInt32Image_copy( cpA, &ptrA->bitImageE, &srcPtrA->bitImageE ); in bbf_Scanner_copy()
529 bbs_UInt32Arr_copy( cpA, &ptrA->patchBufferE, &srcPtrA->patchBufferE ); in bbf_Scanner_copy()
530 bbs_UInt16Arr_copy( cpA, &ptrA->lineBufE, &srcPtrA->lineBufE ); in bbf_Scanner_copy()
532 ptrA->maxImageWidthE = srcPtrA->maxImageWidthE; in bbf_Scanner_copy()
533 ptrA->maxImageHeightE = srcPtrA->maxImageHeightE; in bbf_Scanner_copy()
534 ptrA->maxRadiusE = srcPtrA->maxRadiusE; in bbf_Scanner_copy()
535 ptrA->patchWidthE = srcPtrA->patchWidthE; in bbf_Scanner_copy()
536 ptrA->patchHeightE = srcPtrA->patchHeightE; in bbf_Scanner_copy()
537 ptrA->minScaleE = srcPtrA->minScaleE; in bbf_Scanner_copy()
538 ptrA->maxScaleE = srcPtrA->maxScaleE; in bbf_Scanner_copy()
539 ptrA->scaleStepE = srcPtrA->scaleStepE; in bbf_Scanner_copy()
540 ptrA->borderWidthE = srcPtrA->borderWidthE; in bbf_Scanner_copy()
541 ptrA->borderHeightE = srcPtrA->borderHeightE; in bbf_Scanner_copy()
547 const struct bbf_Scanner* ptrA, in bbf_Scanner_equal() argument
550 if( ptrA->maxImageWidthE != srcPtrA->maxImageWidthE ) return FALSE; in bbf_Scanner_equal()
551 if( ptrA->maxImageHeightE != srcPtrA->maxImageHeightE ) return FALSE; in bbf_Scanner_equal()
552 if( ptrA->maxRadiusE != srcPtrA->maxRadiusE ) return FALSE; in bbf_Scanner_equal()
553 if( ptrA->patchWidthE != srcPtrA->patchWidthE ) return FALSE; in bbf_Scanner_equal()
554 if( ptrA->patchHeightE != srcPtrA->patchHeightE ) return FALSE; in bbf_Scanner_equal()
555 if( ptrA->minScaleE != srcPtrA->minScaleE ) return FALSE; in bbf_Scanner_equal()
556 if( ptrA->maxScaleE != srcPtrA->maxScaleE ) return FALSE; in bbf_Scanner_equal()
557 if( ptrA->scaleStepE != srcPtrA->scaleStepE ) return FALSE; in bbf_Scanner_equal()
558 if( ptrA->borderWidthE != srcPtrA->borderWidthE ) return FALSE; in bbf_Scanner_equal()
559 if( ptrA->borderHeightE != srcPtrA->borderHeightE ) return FALSE; in bbf_Scanner_equal()
573 uint32 bbf_Scanner_positions( const struct bbf_Scanner* ptrA ) in bbf_Scanner_positions() argument
575 int32 wL = ( int32 )ptrA->currentWidthE - ptrA->patchWidthE; in bbf_Scanner_positions()
576 int32 hL = ( int32 )ptrA->currentHeightE - ptrA->patchHeightE; in bbf_Scanner_positions()
582 uint32 bbf_Scanner_scanIndex( const struct bbf_Scanner* ptrA ) in bbf_Scanner_scanIndex() argument
584 return ptrA->yE * ptrA->currentWidthE + ptrA->xE; in bbf_Scanner_scanIndex()
589 void bbf_Scanner_pos( const struct bbf_Scanner* ptrA, in bbf_Scanner_pos() argument
593 *xPtrA = ( int32 )( ptrA->xE - ptrA->borderWidthE ) * ( int32 )( ptrA->scaleE >> 4 ); in bbf_Scanner_pos()
596 *yPtrA = ( int32 )( ptrA->yE - ptrA->borderHeightE ) * ( int32 )( ptrA->scaleE >> 4 ); in bbf_Scanner_pos()
599 *scalePtrA = ptrA->scaleE; in bbf_Scanner_pos()
604 void bbf_Scanner_idxPos( const struct bbf_Scanner* ptrA, uint32 scanIndexA, in bbf_Scanner_idxPos() argument
607 int32 yL = scanIndexA / ptrA->currentWidthE; in bbf_Scanner_idxPos()
608 int32 xL = scanIndexA - ( yL * ptrA->currentWidthE ); in bbf_Scanner_idxPos()
611 *xPtrA = ( int32 )( xL - ptrA->borderWidthE ) * ( int32 )( ptrA->scaleE >> 4 ); in bbf_Scanner_idxPos()
614 *yPtrA = ( int32 )( yL - ptrA->borderHeightE ) * ( int32 )( ptrA->scaleE >> 4 ); in bbf_Scanner_idxPos()
616 *scalePtrA = ptrA->scaleE; in bbf_Scanner_idxPos()
630 struct bbf_Scanner* ptrA, in bbf_Scanner_create() argument
645 ptrA->maxImageWidthE = maxImageWidthA; in bbf_Scanner_create()
646 ptrA->maxImageHeightE = maxImageHeightA; in bbf_Scanner_create()
647 ptrA->maxRadiusE = maxRadiusA; in bbf_Scanner_create()
648 ptrA->patchWidthE = patchWidthA; in bbf_Scanner_create()
649 ptrA->patchHeightE = patchHeightA; in bbf_Scanner_create()
650 ptrA->minScaleE = minScaleA; in bbf_Scanner_create()
651 ptrA->maxScaleE = maxScaleA; in bbf_Scanner_create()
652 ptrA->scaleStepE = scaleStepA; in bbf_Scanner_create()
653 ptrA->borderWidthE = borderWidthA; in bbf_Scanner_create()
654 ptrA->borderHeightE = borderHeightA; in bbf_Scanner_create()
655 ptrA->bufferSizeE = bufferSizeA; in bbf_Scanner_create()
656 bbf_Scanner_alloc( cpA, ptrA, mtpA, maximizeSharedMemoryA ); in bbf_Scanner_create()
662 struct bbf_Scanner* ptrA, in bbf_Scanner_bitParam() argument
665 if( !bbf_BitParam_equal( cpA, &ptrA->bitParamE, bitParamPtrA ) ) in bbf_Scanner_bitParam()
667 bbf_BitParam_copy( cpA, &ptrA->bitParamE, bitParamPtrA ); in bbf_Scanner_bitParam()
668 bbf_Scanner_createBitImage( cpA, ptrA ); in bbf_Scanner_bitParam()
671 bbf_Scanner_resetScan( cpA, ptrA ); in bbf_Scanner_bitParam()
685 const struct bbf_Scanner* ptrA ) in bbf_Scanner_memSize() argument
689 memSizeL += bbs_SIZEOF16( ptrA->maxImageWidthE ); in bbf_Scanner_memSize()
690 memSizeL += bbs_SIZEOF16( ptrA->maxImageHeightE ); in bbf_Scanner_memSize()
691 memSizeL += bbs_SIZEOF16( ptrA->maxRadiusE ); in bbf_Scanner_memSize()
692 memSizeL += bbs_SIZEOF16( ptrA->patchWidthE ); in bbf_Scanner_memSize()
693 memSizeL += bbs_SIZEOF16( ptrA->patchHeightE ); in bbf_Scanner_memSize()
694 memSizeL += bbs_SIZEOF16( ptrA->minScaleE ); in bbf_Scanner_memSize()
695 memSizeL += bbs_SIZEOF16( ptrA->maxScaleE ); in bbf_Scanner_memSize()
696 memSizeL += bbs_SIZEOF16( ptrA->scaleStepE ); in bbf_Scanner_memSize()
697 memSizeL += bbs_SIZEOF16( ptrA->borderWidthE ); in bbf_Scanner_memSize()
698 memSizeL += bbs_SIZEOF16( ptrA->borderHeightE ); in bbf_Scanner_memSize()
705 const struct bbf_Scanner* ptrA, in bbf_Scanner_memWrite() argument
708 uint32 memSizeL = bbf_Scanner_memSize( cpA, ptrA ); in bbf_Scanner_memWrite()
711 memPtrA += bbs_memWrite32( &ptrA->maxImageWidthE, memPtrA ); in bbf_Scanner_memWrite()
712 memPtrA += bbs_memWrite32( &ptrA->maxImageHeightE, memPtrA ); in bbf_Scanner_memWrite()
713 memPtrA += bbs_memWrite32( &ptrA->maxRadiusE, memPtrA ); in bbf_Scanner_memWrite()
714 memPtrA += bbs_memWrite32( &ptrA->patchWidthE, memPtrA ); in bbf_Scanner_memWrite()
715 memPtrA += bbs_memWrite32( &ptrA->patchHeightE, memPtrA ); in bbf_Scanner_memWrite()
716 memPtrA += bbs_memWrite32( &ptrA->minScaleE, memPtrA ); in bbf_Scanner_memWrite()
717 memPtrA += bbs_memWrite32( &ptrA->maxScaleE, memPtrA ); in bbf_Scanner_memWrite()
718 memPtrA += bbs_memWrite32( &ptrA->scaleStepE, memPtrA ); in bbf_Scanner_memWrite()
719 memPtrA += bbs_memWrite32( &ptrA->borderWidthE, memPtrA ); in bbf_Scanner_memWrite()
720 memPtrA += bbs_memWrite32( &ptrA->borderHeightE, memPtrA ); in bbf_Scanner_memWrite()
727 struct bbf_Scanner* ptrA, in bbf_Scanner_memRead() argument
737 memPtrA += bbs_memRead32( &ptrA->maxImageWidthE, memPtrA ); in bbf_Scanner_memRead()
738 memPtrA += bbs_memRead32( &ptrA->maxImageHeightE, memPtrA ); in bbf_Scanner_memRead()
739 memPtrA += bbs_memRead32( &ptrA->maxRadiusE, memPtrA ); in bbf_Scanner_memRead()
740 memPtrA += bbs_memRead32( &ptrA->patchWidthE, memPtrA ); in bbf_Scanner_memRead()
741 memPtrA += bbs_memRead32( &ptrA->patchHeightE, memPtrA ); in bbf_Scanner_memRead()
742 memPtrA += bbs_memRead32( &ptrA->minScaleE, memPtrA ); in bbf_Scanner_memRead()
743 memPtrA += bbs_memRead32( &ptrA->maxScaleE, memPtrA ); in bbf_Scanner_memRead()
744 memPtrA += bbs_memRead32( &ptrA->scaleStepE, memPtrA ); in bbf_Scanner_memRead()
745 memPtrA += bbs_memRead32( &ptrA->borderWidthE, memPtrA ); in bbf_Scanner_memRead()
746 memPtrA += bbs_memRead32( &ptrA->borderHeightE, memPtrA ); in bbf_Scanner_memRead()
748 if( memSizeL != bbf_Scanner_memSize( cpA, ptrA ) ) in bbf_Scanner_memRead()
758 bbf_Scanner_alloc( cpA, ptrA, mtpA, FALSE ); in bbf_Scanner_memRead()
775 void bbf_Scanner_resetScan( struct bbs_Context* cpA, struct bbf_Scanner* ptrA ) in bbf_Scanner_resetScan() argument
777 ptrA->xE = 0; in bbf_Scanner_resetScan()
778 ptrA->yE = 0; in bbf_Scanner_resetScan()
779 bbf_Scanner_initPatchBuffer( cpA, ptrA ); in bbf_Scanner_resetScan()
784 void bbf_Scanner_assign( struct bbs_Context* cpA, struct bbf_Scanner* ptrA, in bbf_Scanner_assign() argument
792 bbf_Scanner_copyImage( cpA, ptrA, imagePtrA, imageWidthA, imageHeightA, roiPtrA ); in bbf_Scanner_assign()
794 ptrA->scaleE = ptrA->minScaleE; in bbf_Scanner_assign()
795 bbf_BitParam_copy( cpA, &ptrA->bitParamE, paramPtrA ); in bbf_Scanner_assign()
800 uint32 maxHScaleL = ( ptrA->workWidthE << 16 ) / ( ptrA->patchWidthE + 1 ); in bbf_Scanner_assign()
801 uint32 maxVScaleL = ( ptrA->workHeightE << 16 ) / ( ptrA->patchHeightE + 1 ); in bbf_Scanner_assign()
804 ptrA->effMaxScaleE = maxHScaleL < maxVScaleL ? ( maxHScaleL << 4 ) : ( maxVScaleL << 4 ); in bbf_Scanner_assign()
806 …if( ptrA->maxScaleE > 0 ) ptrA->effMaxScaleE = ptrA->effMaxScaleE < ptrA->maxScaleE ? ptrA->effMax… in bbf_Scanner_assign()
809 ptrA->scaleExpE = 0; in bbf_Scanner_assign()
812 …while( ptrA->scaleE > ( ( uint32 )( 2 << ptrA->scaleExpE ) << 20 ) ) bbf_Scanner_downscale( cpA, p… in bbf_Scanner_assign()
814 bbf_Scanner_createBitImage( cpA, ptrA ); in bbf_Scanner_assign()
815 bbf_Scanner_resetScan( cpA, ptrA ); in bbf_Scanner_assign()
820 flag bbf_Scanner_nextScale( struct bbs_Context* cpA, struct bbf_Scanner* ptrA ) in bbf_Scanner_nextScale() argument
822 …if( ptrA->scaleE + bbf_Scanner_scalePrd( ptrA->scaleE, ptrA->scaleStepE ) >= ptrA->effMaxScaleE ) … in bbf_Scanner_nextScale()
823 ptrA->scaleE += bbf_Scanner_scalePrd( ptrA->scaleE, ptrA->scaleStepE ); in bbf_Scanner_nextScale()
826 …while( ptrA->scaleE > ( ( uint32 )( 2 << ptrA->scaleExpE ) << 20 ) ) bbf_Scanner_downscale( cpA, p… in bbf_Scanner_nextScale()
828 bbf_Scanner_createBitImage( cpA, ptrA ); in bbf_Scanner_nextScale()
829 bbf_Scanner_resetScan( cpA, ptrA ); in bbf_Scanner_nextScale()
835 const uint32* bbf_Scanner_getPatch( const struct bbf_Scanner* ptrA ) in bbf_Scanner_getPatch() argument
837 return ptrA->patchBufferE.arrPtrE + ptrA->xE; in bbf_Scanner_getPatch()
842 flag bbf_Scanner_next( struct bbs_Context* cpA, struct bbf_Scanner* ptrA ) in bbf_Scanner_next() argument
844 if( ( ptrA->xE + 1 ) < ( int32 )( ptrA->currentWidthE - ptrA->patchWidthE ) ) in bbf_Scanner_next()
846 ptrA->xE++; in bbf_Scanner_next()
850 if( ( ptrA->yE + 1 ) >= ( int32 )( ptrA->currentHeightE - ptrA->patchHeightE ) ) return FALSE; in bbf_Scanner_next()
852 ptrA->xE = 0; in bbf_Scanner_next()
853 ptrA->yE++; in bbf_Scanner_next()
856 uint32 offL = ( ptrA->yE & 0x1F ); in bbf_Scanner_next()
857 uint32 rowL = ( ptrA->yE >> 5 ) + ( offL > 0 ? 1 : 0 ); in bbf_Scanner_next()
859 uint32 sizeL = ptrA->bitImageE.widthE; in bbf_Scanner_next()
860 uint32* dstL = ptrA->patchBufferE.arrPtrE; in bbf_Scanner_next()
863 if( rowL < ptrA->bitImageE.heightE ) in bbf_Scanner_next()
865 uint32* srcL = ( uint32* )ptrA->bitImageE.arrE.arrPtrE + rowL * sizeL; in bbf_Scanner_next()
887 void bbf_Scanner_goToXY( struct bbs_Context* cpA, struct bbf_Scanner* ptrA, int32 xA, int32 yA ) in bbf_Scanner_goToXY() argument
891 if( xA > ( int32 )( ptrA->currentWidthE - ptrA->patchWidthE ) ) in bbf_Scanner_goToXY()
897 ptrA->xE = xA; in bbf_Scanner_goToXY()
899 if( ptrA->yE == yA ) return; in bbf_Scanner_goToXY()
901 if( yA >= ( int32 )( ptrA->currentHeightE - ptrA->patchHeightE ) ) in bbf_Scanner_goToXY()
907 if( yA == ptrA->yE + 1 ) in bbf_Scanner_goToXY()
914 ptrA->yE = yA; in bbf_Scanner_goToXY()
915 offL = ( ptrA->yE & 0x1F ); in bbf_Scanner_goToXY()
916 rowL = ( ptrA->yE >> 5 ) + ( offL > 0 ? 1 : 0 ); in bbf_Scanner_goToXY()
918 sizeL = ptrA->bitImageE.widthE; in bbf_Scanner_goToXY()
919 dstL = ptrA->patchBufferE.arrPtrE; in bbf_Scanner_goToXY()
921 if( rowL < ptrA->bitImageE.heightE ) in bbf_Scanner_goToXY()
923 uint32* srcL = ptrA->bitImageE.arrE.arrPtrE + rowL * sizeL; in bbf_Scanner_goToXY()
946 ptrA->yE = yA; in bbf_Scanner_goToXY()
947 offL = ( ptrA->yE & 0x1F ); in bbf_Scanner_goToXY()
948 rowL = ( ptrA->yE >> 5 ) + ( offL > 0 ? 1 : 0 ); in bbf_Scanner_goToXY()
950 sizeL = ptrA->bitImageE.widthE; in bbf_Scanner_goToXY()
951 dstL = ptrA->patchBufferE.arrPtrE; in bbf_Scanner_goToXY()
953 if( rowL < ptrA->bitImageE.heightE ) in bbf_Scanner_goToXY()
957 uint32* src1L = ptrA->bitImageE.arrE.arrPtrE + rowL * sizeL; in bbf_Scanner_goToXY()
964 bbs_memcpy32( dstL, ptrA->bitImageE.arrE.arrPtrE + rowL * sizeL, sizeL ); in bbf_Scanner_goToXY()
969 uint32* srcL = ptrA->bitImageE.arrE.arrPtrE + ( rowL - 1 ) * sizeL; in bbf_Scanner_goToXY()
977 void bbf_Scanner_goToIndex( struct bbs_Context* cpA, struct bbf_Scanner* ptrA, uint32 scanIndexA ) in bbf_Scanner_goToIndex() argument
979 int32 yL = scanIndexA / ptrA->currentWidthE; in bbf_Scanner_goToIndex()
980 int32 xL = scanIndexA - yL * ptrA->currentWidthE; in bbf_Scanner_goToIndex()
981 bbf_Scanner_goToXY( cpA, ptrA, xL, yL ); in bbf_Scanner_goToIndex()
986 void bbf_Scanner_goToUls( struct bbs_Context* cpA, struct bbf_Scanner* ptrA, in bbf_Scanner_goToUls() argument
989 int32 xL = ( xA / ( int32 )( ptrA->scaleE >> 4 ) ) + ptrA->borderWidthE; in bbf_Scanner_goToUls()
990 int32 yL = ( yA / ( int32 )( ptrA->scaleE >> 4 ) ) + ptrA->borderHeightE; in bbf_Scanner_goToUls()
992 if( ptrA->scaleE != scaleA ) in bbf_Scanner_goToUls()
998 bbf_Scanner_goToXY( cpA, ptrA, xL, yL ); in bbf_Scanner_goToUls()
1004 void bbf_Scanner_resetOutPos( struct bbs_Context* cpA, struct bbf_Scanner* ptrA ) in bbf_Scanner_resetOutPos() argument
1006 ptrA->outCountE = 0; in bbf_Scanner_resetOutPos()
1012 void bbf_Scanner_resetIntPos( struct bbs_Context* cpA, struct bbf_Scanner* ptrA ) in bbf_Scanner_resetIntPos() argument
1014 ptrA->intCountE = 0; in bbf_Scanner_resetIntPos()
1021 struct bbf_Scanner* ptrA, in bbf_Scanner_addIntPos() argument
1025 if( ptrA->intCountE < ptrA->idxArrE.sizeE ) in bbf_Scanner_addIntPos()
1027 ptrA->idxArrE.arrPtrE[ ptrA->intCountE ] = idxA; in bbf_Scanner_addIntPos()
1028 ptrA->actArrE.arrPtrE[ ptrA->intCountE ] = actA; in bbf_Scanner_addIntPos()
1029 ptrA->intCountE++; in bbf_Scanner_addIntPos()
1039 int32* actArrL = ptrA->actArrE.arrPtrE; in bbf_Scanner_addIntPos()
1040 for( iL = 0; iL < ptrA->intCountE; iL++ ) in bbf_Scanner_addIntPos()
1051 ptrA->idxArrE.arrPtrE[ minIdxL ] = idxA; in bbf_Scanner_addIntPos()
1052 ptrA->actArrE.arrPtrE[ minIdxL ] = actA; in bbf_Scanner_addIntPos()
1061 struct bbf_Scanner* ptrA, in bbf_Scanner_addOutPos() argument
1067 if( ( ptrA->outCountE * 4 ) < ptrA->outArrE.sizeE ) in bbf_Scanner_addOutPos()
1069 ptrA->outArrE.arrPtrE[ ptrA->outCountE * 4 + 0 ] = xA; in bbf_Scanner_addOutPos()
1070 ptrA->outArrE.arrPtrE[ ptrA->outCountE * 4 + 1 ] = yA; in bbf_Scanner_addOutPos()
1071 ptrA->outArrE.arrPtrE[ ptrA->outCountE * 4 + 2 ] = scaleA; in bbf_Scanner_addOutPos()
1072 ptrA->outArrE.arrPtrE[ ptrA->outCountE * 4 + 3 ] = actA; in bbf_Scanner_addOutPos()
1073 ptrA->outCountE++; in bbf_Scanner_addOutPos()
1083 int32* outArrL = ptrA->outArrE.arrPtrE; in bbf_Scanner_addOutPos()
1084 for( iL = 0; iL < ptrA->outCountE; iL++ ) in bbf_Scanner_addOutPos()
1095 ptrA->idxArrE.arrPtrE[ minIdxL * 4 + 0 ] = xA; in bbf_Scanner_addOutPos()
1096 ptrA->idxArrE.arrPtrE[ minIdxL * 4 + 1 ] = yA; in bbf_Scanner_addOutPos()
1097 ptrA->idxArrE.arrPtrE[ minIdxL * 4 + 2 ] = scaleA; in bbf_Scanner_addOutPos()
1098 ptrA->idxArrE.arrPtrE[ minIdxL * 4 + 3 ] = actA; in bbf_Scanner_addOutPos()
1107 struct bbf_Scanner* ptrA, in bbf_Scanner_removeOutOverlaps() argument
1111 uint32 endIdxL = ptrA->outCountE; /* end index */ in bbf_Scanner_removeOutOverlaps()
1113 uint32 rw0L = ptrA->patchWidthE; in bbf_Scanner_removeOutOverlaps()
1114 uint32 rh0L = ptrA->patchHeightE; in bbf_Scanner_removeOutOverlaps()
1115 int32* outArrL = ptrA->outArrE.arrPtrE; in bbf_Scanner_removeOutOverlaps()
1117 if( overlapThrA >= 0x010000 ) return ptrA->outCountE; in bbf_Scanner_removeOutOverlaps()
1205 ptrA->outCountE = endIdxL; in bbf_Scanner_removeOutOverlaps()
1214 struct bbf_Scanner* ptrA, in bbf_Scanner_removeIntOverlaps() argument
1218 uint32 endIdxL = ptrA->intCountE; /* end index */ in bbf_Scanner_removeIntOverlaps()
1220 uint32 rw0L = ptrA->patchWidthE; in bbf_Scanner_removeIntOverlaps()
1221 uint32 rh0L = ptrA->patchHeightE; in bbf_Scanner_removeIntOverlaps()
1224 int32* actArrL = ptrA->actArrE.arrPtrE; in bbf_Scanner_removeIntOverlaps()
1225 uint32* idxArrL = ptrA->idxArrE.arrPtrE; in bbf_Scanner_removeIntOverlaps()
1227 if( overlapThrA >= 0x010000 ) return ptrA->intCountE; in bbf_Scanner_removeIntOverlaps()
1254 y1L = i1L / ptrA->currentWidthE; in bbf_Scanner_removeIntOverlaps()
1255 x1L = i1L - ( y1L * ptrA->currentWidthE ); in bbf_Scanner_removeIntOverlaps()
1263 int32 y2L = *i2pL / ptrA->currentWidthE; in bbf_Scanner_removeIntOverlaps()
1264 int32 x2L = *i2pL - ( y2L * ptrA->currentWidthE ); in bbf_Scanner_removeIntOverlaps()
1283 ptrA->intCountE = endIdxL; in bbf_Scanner_removeIntOverlaps()
1285 return ptrA->intCountE; in bbf_Scanner_removeIntOverlaps()