CSJ2K.j2k.codestream.HeaderInfo.QCD.ToString C# (CSharp) Метод

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

Display information found in this QCD marker segment
public ToString ( ) : System.String
Результат System.String
            public override System.String ToString()
            {
                System.String str = "\n --- QCD (" + lqcd + " bytes) ---\n";
                str += " Quant. type    : ";
                int qt = QuantType;
                if (qt == CSJ2K.j2k.codestream.Markers.SQCX_NO_QUANTIZATION)
                    str += "No quantization \n";
                else if (qt == CSJ2K.j2k.codestream.Markers.SQCX_SCALAR_DERIVED)
                    str += "Scalar derived\n";
                else if (qt == CSJ2K.j2k.codestream.Markers.SQCX_SCALAR_EXPOUNDED)
                    str += "Scalar expounded\n";
                str += (" Guard bits     : " + NumGuardBits + "\n");
                if (qt == CSJ2K.j2k.codestream.Markers.SQCX_NO_QUANTIZATION)
                {
                    str += " Exponents   :\n";
                    int exp;
                    for (int i = 0; i < spqcd.Length; i++)
                    {
                        for (int j = 0; j < spqcd[i].Length; j++)
                        {
                            if (i == 0 && j == 0)
                            {
                                exp = (spqcd[0][0] >> CSJ2K.j2k.codestream.Markers.SQCX_EXP_SHIFT) & CSJ2K.j2k.codestream.Markers.SQCX_EXP_MASK;
                                str += ("\tr=0 : " + exp + "\n");
                            }
                            else if (i != 0 && j > 0)
                            {
                                exp = (spqcd[i][j] >> CSJ2K.j2k.codestream.Markers.SQCX_EXP_SHIFT) & CSJ2K.j2k.codestream.Markers.SQCX_EXP_MASK;
                                str += ("\tr=" + i + ",s=" + j + " : " + exp + "\n");
                            }
                        }
                    }
                }
                else
                {
                    str += " Exp / Mantissa : \n";
                    int exp;
                    double mantissa;
                    for (int i = 0; i < spqcd.Length; i++)
                    {
                        for (int j = 0; j < spqcd[i].Length; j++)
                        {
                            if (i == 0 && j == 0)
                            {
                                exp = (spqcd[0][0] >> 11) & 0x1f;
                                //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                                mantissa = (- 1f - ((float) (spqcd[0][0] & 0x07ff)) / (1 << 11)) / (- 1 << exp);
                                str += ("\tr=0 : " + exp + " / " + mantissa + "\n");
                            }
                            else if (i != 0 && j > 0)
                            {
                                exp = (spqcd[i][j] >> 11) & 0x1f;
                                //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                                mantissa = (- 1f - ((float) (spqcd[i][j] & 0x07ff)) / (1 << 11)) / (- 1 << exp);
                                str += ("\tr=" + i + ",s=" + j + " : " + exp + " / " + mantissa + "\n");
                            }
                        }
                    }
                }
                str += "\n";
                return str;
            }