/[classpath]/classpath/java/awt/image/SinglePixelPackedSampleModel.java
ViewVC logotype

Diff of /classpath/java/awt/image/SinglePixelPackedSampleModel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by mark, Tue Jan 22 22:26:59 2002 UTC revision 1.3 by brawer, Fri Sep 26 07:54:27 2003 UTC
# Line 1  Line 1 
1  /* Copyright (C) 2000, 2002  Free Software Foundation  /* Copyright (C) 2000, 2002, 2003  Free Software Foundation
2    
3  This file is part of GNU Classpath.  This file is part of GNU Classpath.
4    
# Line 88  public class SinglePixelPackedSampleMode Line 88  public class SinglePixelPackedSampleMode
88      return new SinglePixelPackedSampleModel(dataType, w, h, bitMasks);      return new SinglePixelPackedSampleModel(dataType, w, h, bitMasks);
89    }    }
90    
91    
92      /**
93       * Creates a DataBuffer for holding pixel data in the format and
94       * layout described by this SampleModel. The returned buffer will
95       * consist of one single bank.
96       */
97    public DataBuffer createDataBuffer()    public DataBuffer createDataBuffer()
98    {    {
99      // Important: use scanlineStride here, not width!      int size;
100      int size = scanlineStride*height;  
101        // We can save (scanlineStride - width) pixels at the very end of
102        // the buffer. The Sun reference implementation (J2SE 1.3.1 and
103        // 1.4.1_01) seems to do this; tested with Mauve test code.
104        size = scanlineStride * (height - 1) + width;
105    
106      return Buffers.createBuffer(getDataType(), size);      return Buffers.createBuffer(getDataType(), size);
107    }    }
108    
109    
110    public int[] getSampleSize()    public int[] getSampleSize()
111    {    {
112      return sampleSize;      return sampleSize;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26