CSJ2K.j2k.codestream.writer.PktEncoder.reset C# (CSharp) Метод

reset() публичный Метод

Resets the state of the object to the initial state, as if the object was just created.
public reset ( ) : void
Результат void
        public virtual void reset()
        {
            int maxsbi, minsbi;

            // Invalidate save
            saved = false;
            // Invalidate last encoded body buffer
            lbbuf = null;

            // Reinitialize each element in the arrays

            // Use reference caches to minimize array access overhead
            TagTreeEncoder[][][] ttIncl_t_c, ttMaxBP_t_c;
            TagTreeEncoder[][] ttIncl_t_c_r, ttMaxBP_t_c_r;
            int[][][] lblock_t_c;
            int[][] prevtIdxs_t_c_r;

            // Loop on tiles
            for (int t = ttIncl.Length - 1; t >= 0; t--)
            {
                // Loop on components
                for (int c = ttIncl[t].Length - 1; c >= 0; c--)
                {
                    // Initialize reference caches
                    lblock_t_c = lblock[t][c];
                    ttIncl_t_c = ttIncl[t][c];
                    ttMaxBP_t_c = ttMaxBP[t][c];
                    // Loop on resolution levels
                    for (int r = lblock_t_c.Length - 1; r >= 0; r--)
                    {
                        // Initialize reference caches
                        ttIncl_t_c_r = ttIncl_t_c[r];
                        ttMaxBP_t_c_r = ttMaxBP_t_c[r];
                        prevtIdxs_t_c_r = prevtIdxs[t][c][r];

                        // Loop on subbands
                        minsbi = (r == 0)?0:1;
                        maxsbi = (r == 0)?1:4;
                        for (int s = minsbi; s < maxsbi; s++)
                        {
                            // Reset 'prevtIdxs'
                            ArrayUtil.intArraySet(prevtIdxs_t_c_r[s], - 1);
                            // Reset 'lblock'
                            ArrayUtil.intArraySet(lblock_t_c[r][s], INIT_LBLOCK);
                        } // End loop on subbands

                        // Loop on precincts
                        for (int p = ppinfo[t][c][r].Length - 1; p >= 0; p--)
                        {
                            if (p < ttIncl_t_c_r.Length)
                            {
                                // Loop on subbands
                                for (int s = minsbi; s < maxsbi; s++)
                                {
                                    ttIncl_t_c_r[p][s].reset();
                                    ttMaxBP_t_c_r[p][s].reset();
                                } // End loop on subbands
                            }
                        } // End loop on precincts
                    } // End loop on resolution levels
                } // End loop on components
            } // End loop on tiles
        }