Examples of RLEBit1OutputStream


Examples of uk.co.mmscomputing.io.RLEBit1OutputStream

      throw new IOException(cn+".writeImage:\n\t"+e.getMessage());
    }
  }

  static private void copyout(ModHuffmanOutputStream mhos,byte[] imgdata,int width,int height)throws IOException{
    RLEBit1OutputStream    rlos = new RLEBit1OutputStream(mhos);

    int len=width>>3;                                                  // eight pixel per byte
    int end=8-(width&0x07);                                            // how many bits of last byte represent image data

    int off=0;
    if(end==8){                                                        // image row ends at byte boundary
      for(int y=0;y<height;y++){
        rlos.setStartCodeWord(0x0001);                                 // white run first; White is Zero: 1s in image => 0s in compressed data
        mhos.writeEOL();                                               // T.6: we don't write EOL code, we just set up buffers here
        rlos.write(imgdata,off,len);
        rlos.flush();
        off+=len;
      }
    }else{
      for(int y=0;y<height;y++){
        rlos.setStartCodeWord(0x0001);                                 // white run first; White is Zero: 1s in image => 0s in compressed data
        mhos.writeEOL();                                               // T.6: we don't write EOL code, we just set up buffers here
        rlos.write(imgdata,off,len);
        rlos.writeBits(imgdata[off+len],7,end);                        // write end of line pixel
        rlos.flush();
        off+=len+1;
      }
    }
    if(mhos instanceof ModModREADOutputStream){                        // T.6: write EOFB after every strip
      ((ModModREADOutputStream)mhos).writeEOFB();
    }
    rlos.close();
  }
View Full Code Here

Examples of uk.co.mmscomputing.io.RLEBit1OutputStream

      super(out);

      bytesPerLine = (width+7)>>3;

      mmros  = new ModModREADOutputStream(out,width);
      rlos   = new RLEBit1OutputStream(mmros);

      out = rlos;


      rlos.setStartCodeWord(0x0001);                       // white run first
View Full Code Here

Examples of uk.co.mmscomputing.io.RLEBit1OutputStream

    DataBufferByte   buffer=(DataBufferByte)raster.getDataBuffer();
    byte[]           imgdata=(byte[])buffer.getData();

    BitSwapOutputStream    bsos = new BitSwapOutputStream(baos);
    ModHuffmanOutputStream mhos = new ModModREADOutputStream(bsos,width);
    RLEBit1OutputStream    rlos = new RLEBit1OutputStream(mhos);

    int len=width>>3;                              // eight pixel per byte
    int end=8-(width&0x07);                        // how many bits of last byte represent image data

    int off=0;
    if(end==8){                                    // image row ends at byte boundary
      for(int y=0;y<height;y++){
        rlos.setStartCodeWord(0x0001);             // white run first; White is Zero: 1s in image => 0s in compressed data
        mhos.writeEOL();                           // T.6: we don't write EOL code, we just set up buffers here
        rlos.write(imgdata,off,len);
        rlos.flush();
        off+=len;
      }
    }else{
      for(int y=0;y<height;y++){
        rlos.setStartCodeWord(0x0001);             // white run first; White is Zero: 1s in image => 0s in compressed data
        mhos.writeEOL();                           // T.6: we don't write EOL code, we just set up buffers here
        rlos.write(imgdata,off,len);
        rlos.writeBits(imgdata[off+len],7,end);    // write end of line pixel
        rlos.flush();
        off+=len+1;
      }
    }
    if(mhos instanceof ModModREADOutputStream){    // T.6: write EOFB
      ((ModModREADOutputStream)mhos).writeEOFB();
    }
    rlos.close();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.