Changeset 220

Show
Ignore:
Timestamp:
04/22/06 12:54:25 (2 years ago)
Author:
goodea
Message:

working

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • misc/java/src/edu/cmu/cs/cc3/misc/FakePixbuf.java

    r218 r220  
    1717        BufferedImage im = null; 
    1818        try { 
    19             im = ImageIO.read(getClass().getResource("raw-lo.png")); 
     19            im = ImageIO.read(getClass().getResource("resources/raw-lo.png")); 
    2020        } catch (IOException e) { 
    2121            e.printStackTrace(); 
    2222        } 
    2323 
     24        fifo = new byte[rawWidth / 2 * 4 * rawHeight]; 
     25         
    2426        int i = 0; 
    2527        for (int y = 0; y < rawHeight; y++) { 
     
    3739                // B 
    3840                fifo[i + 3] = (byte) (p2 & 0xFF); 
     41                 
     42                i += 4; 
    3943            } 
    4044        } 
    4145    } 
    4246 
    43     private final byte[] fifo = new byte[rawWidth / 2 * 4 * rawHeight]
     47    private final byte[] fifo
    4448 
    4549    private int cursor; 
     
    5054    } 
    5155 
    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++; 
    5662    } 
    5763 
    5864    @Override 
    59     public void skip() { 
     65    public void readRows(byte[] data, int rows) { 
    6066        // TODO Auto-generated method stub 
    61  
     67         
    6268    } 
    6369 
  • misc/java/src/edu/cmu/cs/cc3/misc/Pixbuf.java

    r218 r220  
    1212    int rawWidth, rawHeight; 
    1313 
    14     int x0, y0, x1, y1; 
     14    int x0, y0, x1 = rawWidth + 1, y1 = rawHeight + 1; 
    1515 
    1616    int yLoc; 
    1717 
    18     int xStep, yStep
     18    int xStep = 1, yStep = 1
    1919 
    2020    int coi = CHANNEL_ALL; 
     
    2222    int width, height; 
    2323 
     24    public Pixbuf() { 
     25        updateFrameBounds(); 
     26    } 
    2427     
    2528    public abstract void rewind(); 
     
    8891    } 
    8992 
    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); 
    9499     
    95100    public void setCOI(int channel) {