Changeset 220
- Timestamp:
- 04/22/06 12:54:25 (2 years ago)
- Files:
-
- misc/java/src/edu/cmu/cs/cc3/misc/FakePixbuf.java (modified) (3 diffs)
- misc/java/src/edu/cmu/cs/cc3/misc/Pixbuf.java (modified) (3 diffs)
- misc/java/src/edu/cmu/cs/cc3/misc/Test.java (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
misc/java/src/edu/cmu/cs/cc3/misc/FakePixbuf.java
r218 r220 17 17 BufferedImage im = null; 18 18 try { 19 im = ImageIO.read(getClass().getResource("r aw-lo.png"));19 im = ImageIO.read(getClass().getResource("resources/raw-lo.png")); 20 20 } catch (IOException e) { 21 21 e.printStackTrace(); 22 22 } 23 23 24 fifo = new byte[rawWidth / 2 * 4 * rawHeight]; 25 24 26 int i = 0; 25 27 for (int y = 0; y < rawHeight; y++) { … … 37 39 // B 38 40 fifo[i + 3] = (byte) (p2 & 0xFF); 41 42 i += 4; 39 43 } 40 44 } 41 45 } 42 46 43 private final byte[] fifo = new byte[rawWidth / 2 * 4 * rawHeight];47 private final byte[] fifo; 44 48 45 49 private int cursor; … … 50 54 } 51 55 52 @Override 53 public byte read() { 54 // TODO Auto-generated method stub 55 return 0; 56 byte read() { 57 return fifo[cursor++]; 58 } 59 60 void skip() { 61 cursor++; 56 62 } 57 63 58 64 @Override 59 public void skip() {65 public void readRows(byte[] data, int rows) { 60 66 // TODO Auto-generated method stub 61 67 62 68 } 63 69 misc/java/src/edu/cmu/cs/cc3/misc/Pixbuf.java
r218 r220 12 12 int rawWidth, rawHeight; 13 13 14 int x0, y0, x1 , y1;14 int x0, y0, x1 = rawWidth + 1, y1 = rawHeight + 1; 15 15 16 16 int yLoc; 17 17 18 int xStep , yStep;18 int xStep = 1, yStep = 1; 19 19 20 20 int coi = CHANNEL_ALL; … … 22 22 int width, height; 23 23 24 public Pixbuf() { 25 updateFrameBounds(); 26 } 24 27 25 28 public abstract void rewind(); … … 88 91 } 89 92 90 public abstract byte read(); 91 92 public abstract void skip(); 93 93 public byte[] allocateRows(int rows) { 94 int p = coi == CHANNEL_ALL ? 3 : 1; 95 return new byte[p * getWidth() * rows]; 96 } 97 98 public abstract void readRows(byte[] data, int rows); 94 99 95 100 public void setCOI(int channel) {
