Examples of writeBits()


Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

                int newFoundCode = findPatternCode(codeTable, inputPattern);
                if (newFoundCode == -1)
                {
                    // use previous
                    chunk = calculateChunk(codeTable.size() - 1);
                    out.writeBits(foundCode, chunk);
                    // create new table entry
                    codeTable.add(inputPattern);

                    if (codeTable.size() == 4096)
                    {
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

                    codeTable.add(inputPattern);

                    if (codeTable.size() == 4096)
                    {
                        // code table is full
                        out.writeBits(CLEAR_TABLE, chunk);
                        chunk = 9;
                        codeTable = createCodeTable();
                    }

                    inputPattern = new byte[]
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

            }
        }
        if (foundCode != -1)
        {
            chunk = calculateChunk(codeTable.size() - 1);
            out.writeBits(foundCode, chunk);
        }

        // PPDFBOX-1977: the decoder wouldn't know that the encoder would output
        // an EOD as code, so he would have increased his own code table and
        // possibly adjusted the chunk. Therefore, the encoder must behave as
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

        // possibly adjusted the chunk. Therefore, the encoder must behave as
        // if the code table had just grown and thus it must be checked it is
        // needed to adjust the chunk, based on an increased table size parameter
        chunk = calculateChunk(codeTable.size());

        out.writeBits(EOD, chunk);
        out.writeBits(0, 7); // pad with 0
        out.flush(); // must do or file will be empty :-(
    }

    /**
 
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

        // if the code table had just grown and thus it must be checked it is
        // needed to adjust the chunk, based on an increased table size parameter
        chunk = calculateChunk(codeTable.size());

        out.writeBits(EOD, chunk);
        out.writeBits(0, 7); // pad with 0
        out.flush(); // must do or file will be empty :-(
    }

    /**
     * Find the longest matching pattern in the code table.
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

                int w = rgbImage.getWidth();
                for (int y = 0; y < h; ++y)
                {
                    for (int x = 0; x < w; ++x)
                    {
                        mcios.writeBits(rgbImage.getRGB(x, y), bpc);
                    }
                }
                mcios.writeBits(0, 7); // padding
                mcios.flush();
                mcios.close();
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

                    for (int x = 0; x < w; ++x)
                    {
                        mcios.writeBits(rgbImage.getRGB(x, y), bpc);
                    }
                }
                mcios.writeBits(0, 7); // padding
                mcios.flush();
                mcios.close();
            }
            else
            {
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

                    for (int y = 0; y < height; ++y)
                    {
                        for (int x = 0; x < width; ++x)
                        {
                            // grayscale images need one color per sample
                            mcios.writeBits(bi.getRGB(x, y) & 0xFF, bpc);
                        }
                    }
                    // padding
                    while (mcios.getBitOffset() != 0)
                    {
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

        // possibly adjusted the chunk. Therefore, the encoder must behave as
        // if the code table had just grown and thus it must be checked it is
        // needed to adjust the chunk, based on an increased table size parameter
        chunk = calculateChunk(codeTable.size());

        out.writeBits(EOD, chunk);
        out.writeBits(0, 7); // pad with 0
        out.flush(); // must do or file will be empty :-(
    }

    /**
 
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBits()

        // if the code table had just grown and thus it must be checked it is
        // needed to adjust the chunk, based on an increased table size parameter
        chunk = calculateChunk(codeTable.size());

        out.writeBits(EOD, chunk);
        out.writeBits(0, 7); // pad with 0
        out.flush(); // must do or file will be empty :-(
    }

    /**
     * Find the longest matching pattern in the code table.
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.