src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java

Print this page




 757                 }
 758             }
 759         } catch (IIOException iioe) {
 760             throw iioe;
 761         } catch (IOException ioe) {
 762             throw new IIOException("I/O error reading image metadata!", ioe);
 763         }
 764     }
 765 
 766     private int copyData(byte[] src, int offset, byte[] dst) {
 767         int len = dst.length;
 768         int rest = src.length - offset;
 769         if (len > rest) {
 770             len = rest;
 771         }
 772         System.arraycopy(src, offset, dst, 0, len);
 773         return offset + len;
 774     }
 775 
 776     private void startPass(int pass) {
 777         if (updateListeners == null) {
 778             return;
 779         }
 780 
 781         int y = 0;
 782         int yStep = 1;
 783         if (imageMetadata.interlaceFlag) {
 784             y = interlaceOffset[interlacePass];
 785             yStep = interlaceIncrement[interlacePass];
 786         }
 787 
 788         int[] vals = ReaderUtil.
 789             computeUpdatedPixels(sourceRegion,
 790                                  destinationOffset,
 791                                  destinationRegion.x,
 792                                  destinationRegion.y,
 793                                  destinationRegion.x +
 794                                  destinationRegion.width - 1,
 795                                  destinationRegion.y +
 796                                  destinationRegion.height - 1,
 797                                  sourceXSubsampling,
 798                                  sourceYSubsampling,
 799                                  0,
 800                                  y,
 801                                  destinationRegion.width,
 802                                  (destinationRegion.height + yStep - 1)/yStep,
 803                                  1,
 804                                  yStep);
 805 
 806         // Initialized updateMinY and updateYStep




 757                 }
 758             }
 759         } catch (IIOException iioe) {
 760             throw iioe;
 761         } catch (IOException ioe) {
 762             throw new IIOException("I/O error reading image metadata!", ioe);
 763         }
 764     }
 765 
 766     private int copyData(byte[] src, int offset, byte[] dst) {
 767         int len = dst.length;
 768         int rest = src.length - offset;
 769         if (len > rest) {
 770             len = rest;
 771         }
 772         System.arraycopy(src, offset, dst, 0, len);
 773         return offset + len;
 774     }
 775 
 776     private void startPass(int pass) {
 777         if (updateListeners == null || !imageMetadata.interlaceFlag) {
 778             return;
 779         }
 780 
 781         int y = interlaceOffset[interlacePass];
 782         int yStep = interlaceIncrement[interlacePass];




 783 
 784         int[] vals = ReaderUtil.
 785             computeUpdatedPixels(sourceRegion,
 786                                  destinationOffset,
 787                                  destinationRegion.x,
 788                                  destinationRegion.y,
 789                                  destinationRegion.x +
 790                                  destinationRegion.width - 1,
 791                                  destinationRegion.y +
 792                                  destinationRegion.height - 1,
 793                                  sourceXSubsampling,
 794                                  sourceYSubsampling,
 795                                  0,
 796                                  y,
 797                                  destinationRegion.width,
 798                                  (destinationRegion.height + yStep - 1)/yStep,
 799                                  1,
 800                                  yStep);
 801 
 802         // Initialized updateMinY and updateYStep