public void apply ( ) { // see if the distortion class needs to be created again if ( distorter == null ) { Class typeOut = output . getImageType ( ) . getImageClass ( ) ; switch ( input . getImageType ( ) . getFamily ( ) ) { case GRAY : distorter = FactoryDistort . distortSB ( cached , ( InterpolatePixelS ) interp , typeOut ) ; break ; case PLANAR : distorter = FactoryDistort . distortPL ( cached , ( InterpolatePixelS ) interp , typeOut ) ; break ; case INTERLEAVED : distorter = FactoryDistort . distortIL ( cached , ( InterpolatePixelMB ) interp , output . getImageType ( ) ) ; break ; default : throw new IllegalArgumentException ( "Unsupported image type" ) ; } } distorter . setModel ( outputToInput ) ; distorter . apply ( input , output ) ; }
Applies the distortion .