sandbox/sandbox-common/src/main/java/com/twelvemonkeys/image/inv_cmap.c
static int
redloop()
{
    int detect;
    int r;
    int first;
    long txsqr = xsqr + xsqr;
    static long rxx;

    detect = 0;

    /* Basic loop up. */
    for ( r = rcenter, rdist = cdist, rxx = crinc,
	  rdp = cdp, rrgbp = crgbp, first = 1;
	  r < colormax;
	  r++, rdp += rstride, rrgbp += rstride,
	  rdist += rxx, rxx += txsqr, first = 0 )
    {
	if ( greenloop( first ) )
	    detect = 1;
	else if ( detect )
	    break;
    }

    /* Basic loop down. */
    for ( r = rcenter - 1, rxx = crinc - txsqr, rdist = cdist - rxx,
	  rdp = cdp - rstride, rrgbp = crgbp - rstride, first = 1;
	  r >= 0;
	  r--, rdp -= rstride, rrgbp -= rstride,
	  rxx -= txsqr, rdist -= rxx, first = 0 )
    {
	if ( greenloop( first ) )
	    detect = 1;
	else if ( detect )
	    break;
    }

    return detect;
}
/* redloop -- loop up and down from red center. */
- loop up and down from red center.
- loop up and down from red center .
static int
redloop()
{
    int detect;
    int r;
    int first;
    long txsqr = xsqr + xsqr;
    static long rxx;
    detect = 0;
    for ( r = rcenter, rdist = cdist, rxx = crinc,
	  rdp = cdp, rrgbp = crgbp, first = 1;
	  r < colormax;
	  r++, rdp += rstride, rrgbp += rstride,
	  rdist += rxx, rxx += txsqr, first = 0 )
    {
	if ( greenloop( first ) )
	    detect = 1;
	else if ( detect )
	    break;
    }
    for ( r = rcenter - 1, rxx = crinc - txsqr, rdist = cdist - rxx,
	  rdp = cdp - rstride, rrgbp = crgbp - rstride, first = 1;
	  r >= 0;
	  r--, rdp -= rstride, rrgbp -= rstride,
	  rxx -= txsqr, rdist -= rxx, first = 0 )
    {
	if ( greenloop( first ) )
	    detect = 1;
	else if ( detect )
	    break;
    }
    return detect;
}
static int redloop ( ) { int detect ; int r ; int first ; long txsqr = xsqr + xsqr ; static long rxx ; detect = 0 ; for ( r = rcenter , rdist = cdist , rxx = crinc , rdp = cdp , rrgbp = crgbp , first = 1 ; r < colormax ; r ++ , rdp += rstride , rrgbp += rstride , rdist += rxx , rxx += txsqr , first = 0 ) { if ( greenloop ( first ) ) detect = 1 ; else if ( detect ) break ; } for ( r = rcenter - 1 , rxx = crinc - txsqr , rdist = cdist - rxx , rdp = cdp - rstride , rrgbp = crgbp - rstride , first = 1 ; r >= 0 ; r -- , rdp -= rstride , rrgbp -= rstride , rxx -= txsqr , rdist -= rxx , first = 0 ) { if ( greenloop ( first ) ) detect = 1 ; else if ( detect ) break ; } return detect ; }
redloop -- loop up and down from red center.
redloop -- loop up and down from red center .
/* Basic loop up. */ /* Basic loop down. */