app/src/main/jni/ImageTool.cpp
int CImageTool::SetHorLineToWhite ( DSCC_BYTE *p, int x, int y, int w )
{
    int i ;
    DSCC_BYTE mask[8] = {128,64,32,16,8,4,2,1} ;
    p +=  x/8 ;
    if ( x%8 > 0 )
    {
        for ( i=x%8 ; i<8 && w>0 ; i++, w-- )
            *p &= ~mask[i] ;
        p++ ;
    }
    while ( w >= 8 )
    {
        *p++ = 0 ;
        w -= 8 ;
    }
    for ( i=0 ; i<w ; i++ )
        *p &= ~mask[i] ;

    return 0 ;
}
/********************************************************************************
/*	Name:		SetHorLineToWhite
/*	Funcation:	Set all pixels on a horizontal line to white, for binary image
/*
/********************************************************************************/
SetHorLineToWhite
Funcation:      Set all pixels on a horizontal line to white, for binary image
SetHorLineToWhite Funcation : Set all pixels on a horizontal line to white for binary image
int CImageTool::SetHorLineToWhite ( DSCC_BYTE *p, int x, int y, int w )
{
    int i ;
    DSCC_BYTE mask[8] = {128,64,32,16,8,4,2,1} ;
    p +=  x/8 ;
    if ( x%8 > 0 )
    {
        for ( i=x%8 ; i<8 && w>0 ; i++, w-- )
            *p &= ~mask[i] ;
        p++ ;
    }
    while ( w >= 8 )
    {
        *p++ = 0 ;
        w -= 8 ;
    }
    for ( i=0 ; i<w ; i++ )
        *p &= ~mask[i] ;
    return 0 ;
}
int CImageTool :: SetHorLineToWhite ( DSCC_BYTE * p , int x , int y , int w ) { int i ; DSCC_BYTE mask [ 8 ] = { 128 , 64 , 32 , 16 , 8 , 4 , 2 , 1 } ; p += x / 8 ; if ( x % 8 > 0 ) { for ( i = x % 8 ; i < 8 && w > 0 ; i ++ , w -- ) * p &= ~ mask [ i ] ; p ++ ; } while ( w >= 8 ) { * p ++ = 0 ; w -= 8 ; } for ( i = 0 ; i < w ; i ++ ) * p &= ~ mask [ i ] ; return 0 ; }
Name:           SetHorLineToWhite
Funcation:      Set all pixels on a horizontal line to white, for binary image
Name : SetHorLineToWhite Funcation : Set all pixels on a horizontal line to white for binary image