Package uk.co.mmscomputing.io

Examples of uk.co.mmscomputing.io.ModModREADOutputStream


      ByteArrayOutputStream  baos = new ByteArrayOutputStream();
      ModHuffmanOutputStream mhos;
      switch(mode){
      case compT4MH: mhos = new ModHuffmanOutputStream(baos);break;
      case compT4MR: mhos = new ModREADOutputStream(baos,width);break;
      case compT6MMR:mhos = new ModModREADOutputStream(baos,width);break;
      default: throw new IOException(cn+".writeImage: Internal Error: Unknown compression = "+mode)// Should never get here.
      }

      copyout(mhos,imgdata,width,height);
View Full Code Here


    public PDFCCITTFaxEncoder(OutputStream out,int width)throws IOException{
      super(out);

      bytesPerLine = (width+7)>>3;

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

      out = rlos;

View Full Code Here

    WritableRaster   raster=image.getRaster();
    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;
      }
View Full Code Here

TOP

Related Classes of uk.co.mmscomputing.io.ModModREADOutputStream

Copyright © 2018 www.massapicom. 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.