protected void doSubLine(byte[] curLine){
  int sub=(int)Math.ceil((getBitsPerComponent() * getColors()) / 8.0);
  for (int i=0; i < curLine.length; i++) {
    int prevIdx=i - sub;
    if (prevIdx >= 0) {
      curLine[i]+=curLine[prevIdx];
    }
  }
}

protected void doSubLine ( byte [ ] curLine ) { int sub = ( int ) Math . ceil ( ( getBitsPerComponent ( ) * getColors ( ) ) / 8.0 ) ; for ( int i = 0 ; i < curLine . length ; i ++ ) { int prevIdx = i - sub ; if ( prevIdx >= 0 ) { curLine [ i ] += curLine [ prevIdx ] ; } } }
return the value of the sub algorithm on the line ( compare bytes to the previous byte of the same color on this line ) .
