/// <summary> Initializes the source of compressed data. And sets the number of range /// bits and fraction bits and receives the parameters for the dequantizer. /// /// </summary> /// <param name="src">From where to obtain the quantized data. /// /// </param> /// <param name="rb">The number of "range bits" (bitdepth) for each component /// (must be the "range bits" of the un-transformed components). For a /// definition of "range bits" see the getNomRangeBits() method. /// /// </param> /// <param name="qts">The quantizer type spec /// /// </param> /// <param name="qsss">The dequantizer step sizes spec /// /// </param> /// <seealso cref="Dequantizer.getNomRangeBits"> /// /// </seealso> /// <exception cref="IllegalArgumentException">Thrown if 'outdt' is neither /// TYPE_FLOAT nor TYPE_INT, or if 'param' specify reversible quantization /// and 'outdt' is not TYPE_INT or 'fp' has non-zero values, or if 'outdt' /// is TYPE_FLOAT and 'fp' has non-zero values. /// /// </exception> public StdDequantizer(CBlkQuantDataSrcDec src, int[] utrb, DecoderSpecs decSpec) : base(src, utrb, decSpec) { if (utrb.Length != src.NumComps) { throw new System.ArgumentException("Invalid rb argument"); } this.qsss = decSpec.qsss; this.qts = decSpec.qts; this.gbs = decSpec.gbs; }
/// <summary> Initializes the source of compressed data. /// /// </summary> /// <param name="src">From where to obtain the quantized data. /// /// </param> /// <param name="rb">The number of "range bits" for each component (must be the /// "range bits" of the un-transformed components. For a definition of /// "range bits" see the getNomRangeBits() method. /// /// </param> /// <seealso cref="getNomRangeBits"> /// /// </seealso> public Dequantizer(CBlkQuantDataSrcDec src, int[] utrb, DecoderSpecs decSpec) : base(src) { if (utrb.Length != src.NumComps) { throw new System.ArgumentException(); } this.src = src; this.utrb = utrb; this.cts = decSpec.cts; this.wfs = decSpec.wfs; }
/// <summary> Creates a ROIDeScaler object. The information needed to create the /// object is the Entropy decoder used and the parameters. /// /// </summary> /// <param name="src">The source of data that is to be descaled /// /// </param> /// <param name="pl">The parameter list (or options). /// /// </param> /// <param name="decSpec">The decoding specifications /// /// </param> /// <exception cref="IllegalArgumentException">If an error occurs while parsing /// the options in 'pl' /// /// </exception> public static ROIDeScaler createInstance(CBlkQuantDataSrcDec src, ParameterList pl, DecoderSpecs decSpec) { System.String noRoi; //int i; // Check parameters pl.checkList(OPT_PREFIX, CSJ2K.j2k.util.ParameterList.toNameArray(pinfo)); // Check if no_roi specified in command line or no roi signalled // in bit stream noRoi = pl.getParameter("Rno_roi"); if (noRoi != null || decSpec.rois == null) { // no_roi specified in commandline! return(new ROIDeScaler(src, null)); } return(new ROIDeScaler(src, decSpec.rois)); }
/// <summary> Initializes the source of compressed data. /// /// </summary> /// <param name="src">From where to obtain the quantized data. /// /// </param> /// <param name="rb">The number of "range bits" for each component (must be the /// "range bits" of the un-transformed components. For a definition of /// "range bits" see the getNomRangeBits() method. /// /// </param> /// <seealso cref="getNomRangeBits"> /// /// </seealso> public Dequantizer(CBlkQuantDataSrcDec src, int[] utrb, DecoderSpecs decSpec):base(src) { if (utrb.Length != src.NumComps) { throw new System.ArgumentException(); } this.src = src; this.utrb = utrb; this.cts = decSpec.cts; this.wfs = decSpec.wfs; }
/// <summary> Creates a ROIDeScaler object. The information needed to create the /// object is the Entropy decoder used and the parameters. /// /// </summary> /// <param name="src">The source of data that is to be descaled /// /// </param> /// <param name="pl">The parameter list (or options). /// /// </param> /// <param name="decSpec">The decoding specifications /// /// </param> /// <exception cref="IllegalArgumentException">If an error occurs while parsing /// the options in 'pl' /// /// </exception> public static ROIDeScaler createInstance(CBlkQuantDataSrcDec src, ParameterList pl, DecoderSpecs decSpec) { System.String noRoi; //int i; // Check parameters pl.checkList(OPT_PREFIX, CSJ2K.j2k.util.ParameterList.toNameArray(pinfo)); // Check if no_roi specified in command line or no roi signalled // in bit stream noRoi = pl.getParameter("Rno_roi"); if (noRoi != null || decSpec.rois == null) { // no_roi specified in commandline! return new ROIDeScaler(src, null); } return new ROIDeScaler(src, decSpec.rois); }
/// <summary> Constructor of the ROI descaler, takes EntropyDEcoder as source of data /// to de-scale. /// /// </summary> /// <param name="src">The EntropyDecoder that is the source of data. /// /// </param> /// <param name="mss">The MaxShiftSpec containing the scaling values for all /// tile-components /// /// </param> public ROIDeScaler(CBlkQuantDataSrcDec src, MaxShiftSpec mss):base(src) { this.src = src; this.mss = mss; }
/// <summary> Constructor of the ROI descaler, takes EntropyDEcoder as source of data /// to de-scale. /// /// </summary> /// <param name="src">The EntropyDecoder that is the source of data. /// /// </param> /// <param name="mss">The MaxShiftSpec containing the scaling values for all /// tile-components /// /// </param> public ROIDeScaler(CBlkQuantDataSrcDec src, MaxShiftSpec mss) : base(src) { this.src = src; this.mss = mss; }
/// <summary> Returns the dequantizer parameters. Dequantizer parameters normally are /// the quantization step sizes, see DequantizerParams. /// /// </summary> /// <param name="src">The source of data for the dequantizer. /// /// </param> /// <param name="rb">The number of range bits for each component. Must be /// the number of range bits of the mixed components. /// /// </param> /// <param name="decSpec2">The DecoderSpecs instance after any image manipulation. /// /// </param> /// <returns> The dequantizer /// /// </returns> public Dequantizer createDequantizer(CBlkQuantDataSrcDec src, int[] rb, DecoderSpecs decSpec2) { return new StdDequantizer(src, rb, decSpec2); }
/// <summary> Creates and returns the ROIDeScaler corresponding to the information /// read from the codestream header and with the special additional /// parameters from the parameter list. /// /// </summary> /// <param name="src">The bit stream reader agent where to get code-block data /// from. /// /// </param> /// <param name="pl">The parameter list containing parameters applicable to the /// entropy decoder (other parameters can also be present). /// /// </param> /// <param name="decSpec2">The DecoderSpecs instance after any image manipulation. /// /// </param> /// <returns> The ROI descaler. /// /// </returns> public virtual ROIDeScaler createROIDeScaler(CBlkQuantDataSrcDec src, ParameterList pl, DecoderSpecs decSpec2) { return ROIDeScaler.createInstance(src, pl, decSpec2); }
/// <summary> Initializes the source of compressed data. And sets the number of range /// bits and fraction bits and receives the parameters for the dequantizer. /// /// </summary> /// <param name="src">From where to obtain the quantized data. /// /// </param> /// <param name="rb">The number of "range bits" (bitdepth) for each component /// (must be the "range bits" of the un-transformed components). For a /// definition of "range bits" see the getNomRangeBits() method. /// /// </param> /// <param name="qts">The quantizer type spec /// /// </param> /// <param name="qsss">The dequantizer step sizes spec /// /// </param> /// <seealso cref="Dequantizer.getNomRangeBits"> /// /// </seealso> /// <exception cref="IllegalArgumentException">Thrown if 'outdt' is neither /// TYPE_FLOAT nor TYPE_INT, or if 'param' specify reversible quantization /// and 'outdt' is not TYPE_INT or 'fp' has non-zero values, or if 'outdt' /// is TYPE_FLOAT and 'fp' has non-zero values. /// /// </exception> public StdDequantizer(CBlkQuantDataSrcDec src, int[] utrb, DecoderSpecs decSpec):base(src, utrb, decSpec) { if (utrb.Length != src.NumComps) { throw new System.ArgumentException("Invalid rb argument"); } this.qsss = decSpec.qsss; this.qts = decSpec.qts; this.gbs = decSpec.gbs; }