src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java

Print this page
rev 9230 : imported patch 8033716


 663                 new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
 664                                                 width, height,
 665                                                 numBands,
 666                                                 numBands * width,
 667                                                 bandOffsets);
 668 
 669             colorModel =
 670                 ImageUtil.createColorModel(colorSpace, sampleModel);
 671         }
 672 
 673         originalSampleModel = sampleModel;
 674         originalColorModel = colorModel;
 675 
 676         // Reset to the start of bitmap; then jump to the
 677         //start of image data
 678         iis.reset();
 679         iis.skipBytes(bitmapOffset);
 680         gotHeader = true;
 681     }
 682 
 683     public Iterator getImageTypes(int imageIndex)
 684       throws IOException {
 685         checkIndex(imageIndex);
 686         try {
 687             readHeader();
 688         } catch (IllegalArgumentException e) {
 689             throw new IIOException(I18N.getString("BMPImageReader6"), e);
 690         }
 691         ArrayList list = new ArrayList(1);
 692         list.add(new ImageTypeSpecifier(originalColorModel,
 693                                         originalSampleModel));
 694         return list.iterator();
 695     }
 696 
 697     public ImageReadParam getDefaultReadParam() {
 698         return new ImageReadParam();
 699     }
 700 
 701     public IIOMetadata getImageMetadata(int imageIndex)
 702       throws IOException {
 703         checkIndex(imageIndex);
 704         if (metadata == null) {
 705             try {
 706                 readHeader();
 707             } catch (IllegalArgumentException e) {
 708                 throw new IIOException(I18N.getString("BMPImageReader6"), e);
 709             }
 710         }
 711         return metadata;




 663                 new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
 664                                                 width, height,
 665                                                 numBands,
 666                                                 numBands * width,
 667                                                 bandOffsets);
 668 
 669             colorModel =
 670                 ImageUtil.createColorModel(colorSpace, sampleModel);
 671         }
 672 
 673         originalSampleModel = sampleModel;
 674         originalColorModel = colorModel;
 675 
 676         // Reset to the start of bitmap; then jump to the
 677         //start of image data
 678         iis.reset();
 679         iis.skipBytes(bitmapOffset);
 680         gotHeader = true;
 681     }
 682 
 683     public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
 684       throws IOException {
 685         checkIndex(imageIndex);
 686         try {
 687             readHeader();
 688         } catch (IllegalArgumentException e) {
 689             throw new IIOException(I18N.getString("BMPImageReader6"), e);
 690         }
 691         ArrayList<ImageTypeSpecifier> list = new ArrayList<>(1);
 692         list.add(new ImageTypeSpecifier(originalColorModel,
 693                                         originalSampleModel));
 694         return list.iterator();
 695     }
 696 
 697     public ImageReadParam getDefaultReadParam() {
 698         return new ImageReadParam();
 699     }
 700 
 701     public IIOMetadata getImageMetadata(int imageIndex)
 702       throws IOException {
 703         checkIndex(imageIndex);
 704         if (metadata == null) {
 705             try {
 706                 readHeader();
 707             } catch (IllegalArgumentException e) {
 708                 throw new IIOException(I18N.getString("BMPImageReader6"), e);
 709             }
 710         }
 711         return metadata;