CSJ2K.j2k.wavelet.analysis.SubbandAn.split C# (CSharp) Method

split() protected method

Splits the current subband in its four subbands. It changes the status of this element (from a leaf to a node, and sets the filters), creates the childs and initializes them. An IllegalArgumentException is thrown if this subband is not a leaf.

It uses the initChilds() method to initialize the childs.

protected split ( WaveletFilter hfilter, WaveletFilter vfilter ) : Subband
hfilter WaveletFilter The horizontal wavelet filter used to decompose this /// subband. It has to be a AnWTFilter object. /// ///
vfilter WaveletFilter The vertical wavelet filter used to decompose this /// subband. It has to be a AnWTFilter object. /// ///
return CSJ2K.j2k.wavelet.Subband
        protected internal override Subband split(WaveletFilter hfilter, WaveletFilter vfilter)
        {
            // Test that this is a node
            if (isNode)
            {
                throw new System.ArgumentException();
            }

            // Modify this element into a node and set the filters
            isNode = true;
            this.hFilter = (AnWTFilter) hfilter;
            this.vFilter = (AnWTFilter) vfilter;

            // Create childs
            subb_LL = new SubbandAn();
            subb_LH = new SubbandAn();
            subb_HL = new SubbandAn();
            subb_HH = new SubbandAn();

            // Assign parent
            subb_LL.parentband = this;
            subb_HL.parentband = this;
            subb_LH.parentband = this;
            subb_HH.parentband = this;

            // Initialize childs
            initChilds();

            // Return reference to LL subband
            return subb_LL;
        }