private ImageBuffer createRaster ( Media rasterMedia , Raster raster , int i , boolean save ) { final ImageBuffer rasterBuffer ; if ( rasterMedia . exists ( ) ) { rasterBuffer = Graphics . getImageBuffer ( rasterMedia ) ; rasterBuffer . prepare ( ) ; } else { final double fr = getRasterFactor ( i , raster . getRed ( ) ) ; final double fg = getRasterFactor ( i , raster . getGreen ( ) ) ; final double fb = getRasterFactor ( i , raster . getBlue ( ) ) ; rasterBuffer = Graphics . getRasterBuffer ( surface , fr , fg , fb ) ; if ( save ) { Graphics . saveImage ( rasterBuffer , rasterMedia ) ; } } return rasterBuffer ; }
Create raster from data or load from cache .