2626import java .util .logging .Logger ;
2727import javax .imageio .ImageWriter ;
2828import org .eclipse .imagen .ImageLayout ;
29- import org .eclipse .imagen .JAI ;
29+ import org .eclipse .imagen .ImageN ;
3030import org .eclipse .imagen .media .colorindexer .ColorIndexer ;
3131import org .eclipse .imagen .media .colorindexer .Quantizer ;
3232import org .geotools .image .ImageWorker ;
@@ -68,8 +68,8 @@ public RenderedImage preprocess(RenderedImage ri) {
6868 ParameterBlock pb = new ParameterBlock ();
6969 pb .setSource (ri , 0 );
7070 pb .set (bands , 0 );
71- final RenderingHints hints = new RenderingHints (JAI .KEY_IMAGE_LAYOUT , new ImageLayout (ri ));
72- ri = JAI .create ("BandSelect" , pb , hints );
71+ final RenderingHints hints = new RenderingHints (ImageN .KEY_IMAGE_LAYOUT , new ImageLayout (ri ));
72+ ri = ImageN .create ("BandSelect" , pb , hints );
7373 }
7474 return ri ;
7575 }
@@ -92,8 +92,8 @@ public RenderedImage preprocess(RenderedImage canvas) {
9292 ParameterBlock pb = new ParameterBlock ();
9393 pb .setSource (canvas , 0 ); // The source image.
9494 pb .set (indexer , 0 );
95- canvas = JAI .create (
96- "ColorIndexer" , pb , JAI .getDefaultInstance ().getRenderingHints ());
95+ canvas = ImageN .create (
96+ "ColorIndexer" , pb , ImageN .getDefaultInstance ().getRenderingHints ());
9797 }
9898 }
9999 }
@@ -261,14 +261,14 @@ boolean isBestFormatJpeg(RenderedImage renderedImage) {
261261 int numBands = renderedImage .getSampleModel ().getNumBands ();
262262 if (numBands == 4 || numBands == 2 ) {
263263 ImageWorker iw = new ImageWorker (renderedImage );
264- iw .setRenderingHints (JAI .getDefaultInstance ().getRenderingHints ());
264+ iw .setRenderingHints (ImageN .getDefaultInstance ().getRenderingHints ());
265265 double [] mins = iw .getMinimums ();
266266
267267 return mins [mins .length - 1 ] == 255 ; // fully opaque
268268 } else if (renderedImage .getColorModel () instanceof IndexColorModel ) {
269269 // JPEG would still compress a bit better, but in order to figure out
270270 // if the image has transparency we'd have to expand to RGB or roll
271- // a new JAI image op that looks for the transparent pixels. Out of scope
271+ // a new ImageN image op that looks for the transparent pixels. Out of scope
272272 // for the moment
273273 return false ;
274274 } else {
0 commit comments