< prev index next >

modules/graphics/src/main/java/com/sun/javafx/iio/ios/IosImageLoader.java

Print this page
rev 8890 : RT-40778


 223             throws IOException {
 224 
 225         if (imageIndex >= nImages) {
 226             dispose();
 227             return null;
 228         }
 229 
 230         // Determine output image dimensions.
 231         int[] widthHeight = ImageTools.computeDimensions(inWidth, inHeight, width, height, preserveAspectRatio);
 232         width = widthHeight[0];
 233         height = widthHeight[1];
 234 
 235         final ImageMetadata md = new ImageMetadata(
 236                 null, // gamma
 237                 true, // whether smaller values represent darker shades
 238                 null, // a palette index to use as background
 239                 null, // background color
 240                 null, // a palette index to be used as transparency
 241                 delayTime == 0 ? null : delayTime, // the amount of time to pause at the current image (milliseconds).
 242                 nImages > 1 ? loopCount : null, // number of loops
 243                 inWidth, // source width
 244                 inHeight, // source height
 245                 null, // image left offset
 246                 null, // image top offset
 247                 null); // disposal method
 248 
 249         updateImageMetadata(md);
 250 
 251         resizeImage(structPointer, width, height);
 252 
 253         // the color model and the number of components can change when resizing
 254         final int nComponents = getNumberOfComponents(structPointer);
 255         final int colorSpaceCode = getColorSpaceCode(structPointer);
 256         final ImageType imageType = colorSpaceMapping.get(colorSpaceCode);
 257 
 258         final byte[] pixels = getImageBuffer(structPointer, imageIndex);
 259 
 260         return new ImageFrame(imageType,
 261                 ByteBuffer.wrap(pixels),
 262                 width,
 263                 height,
 264                 width * nComponents,


 223             throws IOException {
 224 
 225         if (imageIndex >= nImages) {
 226             dispose();
 227             return null;
 228         }
 229 
 230         // Determine output image dimensions.
 231         int[] widthHeight = ImageTools.computeDimensions(inWidth, inHeight, width, height, preserveAspectRatio);
 232         width = widthHeight[0];
 233         height = widthHeight[1];
 234 
 235         final ImageMetadata md = new ImageMetadata(
 236                 null, // gamma
 237                 true, // whether smaller values represent darker shades
 238                 null, // a palette index to use as background
 239                 null, // background color
 240                 null, // a palette index to be used as transparency
 241                 delayTime == 0 ? null : delayTime, // the amount of time to pause at the current image (milliseconds).
 242                 nImages > 1 ? loopCount : null, // number of loops
 243                 width, // image width
 244                 height, // image height
 245                 null, // image left offset
 246                 null, // image top offset
 247                 null); // disposal method
 248 
 249         updateImageMetadata(md);
 250 
 251         resizeImage(structPointer, width, height);
 252 
 253         // the color model and the number of components can change when resizing
 254         final int nComponents = getNumberOfComponents(structPointer);
 255         final int colorSpaceCode = getColorSpaceCode(structPointer);
 256         final ImageType imageType = colorSpaceMapping.get(colorSpaceCode);
 257 
 258         final byte[] pixels = getImageBuffer(structPointer, imageIndex);
 259 
 260         return new ImageFrame(imageType,
 261                 ByteBuffer.wrap(pixels),
 262                 width,
 263                 height,
 264                 width * nComponents,
< prev index next >