sourceRandomAccess.setPosition( currentPositions[ 0 ], dimIndex );
mapSingle( sourceRandomAccess, currentConverters[ 0 ] );
return;
}
final ARGBType bi = new ARGBType();
final RandomAccess< ARGBType > targetRandomAccess = target.randomAccess();
targetRandomAccess.setPosition( min[ 1 ], 1 );
while ( targetRandomAccess.getLongPosition( 1 ) <= max[ 1 ] )
{
sourceRandomAccess.setPosition( min[ 0 ], 0 );
targetRandomAccess.setPosition( min[ 0 ], 0 );
while ( targetRandomAccess.getLongPosition( 0 ) <= max[ 0 ] )
{
int aSum = 0, rSum = 0, gSum = 0, bSum = 0;
for ( int i = 0; i < size; i++ )
{
sourceRandomAccess.setPosition( currentPositions[ i ], dimIndex );
currentConverters[ i ].convert( sourceRandomAccess.get(), bi );
// accumulate converted result
final int value = bi.get();
final int a = ARGBType.alpha( value );
final int r = ARGBType.red( value );
final int g = ARGBType.green( value );
final int b = ARGBType.blue( value );
aSum += a;