protected void doPaethLine(byte[] curLine,byte[] prevLine){
  int sub=(int)Math.ceil((getBitsPerComponent() * getColors()) / 8.0);
  for (int i=0; i < curLine.length; i++) {
    int left=0;
    int up=0;
    int upLeft=0;
    int prevIdx=i - sub;
    if (prevIdx >= 0) {
      left=curLine[prevIdx] & 0xff;
    }
    if (prevLine != null) {
      up=prevLine[i] & 0xff;
    }
    if (prevIdx > 0 && prevLine != null) {
      upLeft=prevLine[prevIdx] & 0xff;
    }
    curLine[i]+=(byte)paeth(left,up,upLeft);
  }
}

protected void doPaethLine ( byte [ ] curLine , byte [ ] prevLine ) { int sub = ( int ) Math . ceil ( ( getBitsPerComponent ( ) * getColors ( ) ) / 8.0 ) ; for ( int i = 0 ; i < curLine . length ; i ++ ) { int left = 0 ; int up = 0 ; int upLeft = 0 ; int prevIdx = i - sub ; if ( prevIdx >= 0 ) { left = curLine [ prevIdx ] & 0xff ; } if ( prevLine != null ) { up = prevLine [ i ] & 0xff ; } if ( prevIdx > 0 && prevLine != null ) { upLeft = prevLine [ prevIdx ] & 0xff ; } curLine [ i ] += ( byte ) paeth ( left , up , upLeft ) ; } }
return the value of the average algorithm on the line ( compare bytes to the average of the previous byte of the same color and the same byte on the previous line )
