@ Override public void initialize ( int width , int height ) { // see if it has already been initialized if ( bottomWidth == width && bottomHeight == height ) return ; this . bottomWidth = width ; this . bottomHeight = height ; layers = imageType . createArray ( getNumLayers ( ) ) ; double scaleFactor = getScale ( 0 ) ; if ( scaleFactor == 1 ) { if ( ! saveOriginalReference ) { layers [ 0 ] = imageType . createImage ( bottomWidth , bottomHeight ) ; } } else { layers [ 0 ] = imageType . createImage ( ( int ) Math . ceil ( bottomWidth / scaleFactor ) , ( int ) Math . ceil ( bottomHeight / scaleFactor ) ) ; } for ( int i = 1 ; i < layers . length ; i ++ ) { scaleFactor = getScale ( i ) ; layers [ i ] = imageType . createImage ( ( int ) Math . ceil ( bottomWidth / scaleFactor ) , ( int ) Math . ceil ( bottomHeight / scaleFactor ) ) ; } }
Initializes internal data structures based on the input image s size . Should be called each time a new image is processed .