CSJ2K.j2k.entropy.encoder.StdEntropyCoder.initTileComp C# (CSharp) Method

initTileComp() public method

Load options, length calculation type and termination type for each tile-component.
public initTileComp ( int nt, int nc ) : void
nt int The number of tiles /// ///
nc int The number of components /// ///
return void
		public virtual void  initTileComp(int nt, int nc)
		{
			
			opts = new int[nt][];
			for (int i2 = 0; i2 < nt; i2++)
			{
				opts[i2] = new int[nc];
			}
			lenCalc = new int[nt][];
			for (int i3 = 0; i3 < nt; i3++)
			{
				lenCalc[i3] = new int[nc];
			}
			tType = new int[nt][];
			for (int i4 = 0; i4 < nt; i4++)
			{
				tType[i4] = new int[nc];
			}
			
			for (int t = 0; t < nt; t++)
			{
				for (int c = 0; c < nc; c++)
				{
					opts[t][c] = 0;
					
					// Bypass coding mode ?
					if (((System.String) bms.getTileCompVal(t, c)).ToUpper().Equals("on".ToUpper()))
					{
						opts[t][c] |= CSJ2K.j2k.entropy.StdEntropyCoderOptions.OPT_BYPASS;
					}
					// MQ reset after each coding pass ?
					if (((System.String) mqrs.getTileCompVal(t, c)).ToUpper().Equals("on".ToUpper()))
					{
						opts[t][c] |= CSJ2K.j2k.entropy.StdEntropyCoderOptions.OPT_RESET_MQ;
					}
					// MQ termination after each arithmetically coded coding pass ?
					if (((System.String) rts.getTileCompVal(t, c)).ToUpper().Equals("on".ToUpper()))
					{
						opts[t][c] |= CSJ2K.j2k.entropy.StdEntropyCoderOptions.OPT_TERM_PASS;
					}
					// Vertically stripe-causal context mode ?
					if (((System.String) css.getTileCompVal(t, c)).ToUpper().Equals("on".ToUpper()))
					{
						opts[t][c] |= CSJ2K.j2k.entropy.StdEntropyCoderOptions.OPT_VERT_STR_CAUSAL;
					}
					// Error resilience segmentation symbol insertion ?
					if (((System.String) sss.getTileCompVal(t, c)).ToUpper().Equals("on".ToUpper()))
					{
						opts[t][c] |= CSJ2K.j2k.entropy.StdEntropyCoderOptions.OPT_SEG_SYMBOLS;
					}
					
					// Set length calculation type of the MQ coder
					System.String lCalcType = (System.String) lcs.getTileCompVal(t, c);
					if (lCalcType.Equals("near_opt"))
					{
						lenCalc[t][c] = MQCoder.LENGTH_NEAR_OPT;
					}
					else if (lCalcType.Equals("lazy_good"))
					{
						lenCalc[t][c] = MQCoder.LENGTH_LAZY_GOOD;
					}
					else if (lCalcType.Equals("lazy"))
					{
						lenCalc[t][c] = MQCoder.LENGTH_LAZY;
					}
					else
					{
						throw new System.ArgumentException("Unrecognized or " + "unsupported MQ " + "length calculation.");
					}
					
					// Set termination type of MQ coder
					System.String termType = (System.String) tts.getTileCompVal(t, c);
					if (termType.ToUpper().Equals("easy".ToUpper()))
					{
						tType[t][c] = MQCoder.TERM_EASY;
					}
					else if (termType.ToUpper().Equals("full".ToUpper()))
					{
						tType[t][c] = MQCoder.TERM_FULL;
					}
					else if (termType.ToUpper().Equals("near_opt".ToUpper()))
					{
						tType[t][c] = MQCoder.TERM_NEAR_OPT;
					}
					else if (termType.ToUpper().Equals("predict".ToUpper()))
					{
						tType[t][c] = MQCoder.TERM_PRED_ER;
						opts[t][c] |= CSJ2K.j2k.entropy.StdEntropyCoderOptions.OPT_PRED_TERM;
						if ((opts[t][c] & (CSJ2K.j2k.entropy.StdEntropyCoderOptions.OPT_TERM_PASS | CSJ2K.j2k.entropy.StdEntropyCoderOptions.OPT_BYPASS)) == 0)
						{
							FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.INFO, "Using error resilient MQ" + " termination, but terminating only at " + "the end of code-blocks. The error " + "protection offered by this option will" + " be very weak. Specify the " + "'Cterminate' " + "and/or 'Cbypass' option for " + "increased error resilience.");
						}
					}
					else
					{
						throw new System.ArgumentException("Unrecognized or " + "unsupported " + "MQ coder " + "termination.");
					}
				} // End loop on components
			} // End loop on tiles
		}