Examples of RLEOutputStream


Examples of uk.co.mmscomputing.io.RLEOutputStream

        ByteArrayOutputStream  baos=new ByteArrayOutputStream();
        BitSwapOutputStream    bsos=new BitSwapOutputStream(baos);
        ModHuffmanOutputStream mhos=new ModHuffmanOutputStream(bsos);

        RLEOutputStream        rlos=new RLEOutputStream(mhos,3);         // rgb = 3 bytes per sample code word (not needed here)

        for(int i=0;i<maxrps;i++){
          if((y+i)==height){break;}                                      // last strip might have less rows
          rlos.setStartCodeWord(-1);                                     // white run first
          for(int x=0;x<width;x++){
            rlos.write(image.getRGB(x,y+i));                            
          }
          rlos.flush();                                                  // write padding after ever image row
        }
        rlos.close();

        byte[] data=baos.toByteArray();
        counts.setCount(index,data.length);                              // update ifd strip counter array
        offsets.setOffset(index,out.getStreamPosition());                // update ifd image data offset array
        out.write(data);                                                 // write to image stream
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.