I experienced some interpolation problems with (bilinear)
AffineTransformOp.
Here is a code sample that demonstrates the problem:

class Main extends JFrame
{
        public static void main( String args[] ) {
                new Main() ;

                WritableRaster  src =
                Raster.createInterleavedRaster(
                        DataBuffer.TYPE_BYTE, 2, 1, 1, null ) ;

                src.setSample( 0, 0, 0, 0 ) ;
                src.setSample( 1, 0, 0, 2 ) ;

                AffineTransform t = new AffineTransform() ;
                t.scale( 5.0, 1.0 ) ;

                AffineTransformOp
                op = new AffineTransformOp(
                        t, AffineTransformOp.TYPE_BILINEAR ) ;

                WritableRaster  dst = op.filter( src, null ) ;

                for( int i=0 ; i<10 ; i++ )
                {
                        System.out.print( dst.getSample( i, 0, 0 ) ) ;
                        System.out.print( " " ) ;
                }
                System.out.println( "" ) ;

                System.exit( 0 ) ;
        }
}

I was expecting something like "0 0 0 1 1 1 1 2 2 2",
and the result was "0 0 0 0 0 1 1 1 2 2" !

The result is not symmetrical !

Can You give me some explanation ?

Regards.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to