当前位置: 首页>>代码示例>>C#>>正文


C# SparseArray.get方法代码示例

本文整理汇总了C#中SparseArray.get方法的典型用法代码示例。如果您正苦于以下问题:C# SparseArray.get方法的具体用法?C# SparseArray.get怎么用?C# SparseArray.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SparseArray的用法示例。


在下文中一共展示了SparseArray.get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: showInformationDialog

		/// <summary>
		/// Shows the camera device information into dialog.
		/// </summary>
		private void showInformationDialog()
		{

			StringBuilder builder = new StringBuilder();

			builder.Append("<html><body><pre>");
			if (mCharacteristics != null)
			{
				builder.Append(string.Format("Camera Id: {0}\n", mCameraId));

				// Check supported hardware level.
				SparseArray<string> level = new SparseArray<string>();
				level.put(SCameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL, "Full");
				level.put(SCameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED, "Limited");
				level.put(SCameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY, "Legacy");

				builder.Append(string.Format("Supported H/W Level: {0}\n", level.get(mCharacteristics.get(SCameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL))));

				// Available characteristics tag.
				builder.Append("\nCharacteristics [\n");
//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
//ORIGINAL LINE: for(com.samsung.android.sdk.camera.SCameraCharacteristics.Key<?> key : mCharacteristics.getKeys())
				foreach (SCameraCharacteristics.Key<?> key in mCharacteristics.Keys)
				{
					if (mCharacteristics.get(key) is int[])
					{
						builder.Append(string.Format("\t{0} --> {1}\n", key.Name, Arrays.ToString((int[])mCharacteristics.get(key))));
					}
					else if (mCharacteristics.get(key) is Range[])
					{
						builder.Append(string.Format("\t{0} --> {1}\n", key.Name, Arrays.deepToString((Range[])mCharacteristics.get(key))));
					}
					else if (mCharacteristics.get(key) is Size[])
					{
						builder.Append(string.Format("\t{0} --> {1}\n", key.Name, Arrays.deepToString((Size[]) mCharacteristics.get(key))));
					}
					else if (mCharacteristics.get(key) is float[])
					{
						builder.Append(string.Format("\t{0} --> {1}\n", key.Name, Arrays.ToString((float[])mCharacteristics.get(key))));
					}
					else if (mCharacteristics.get(key) is StreamConfigurationMap)
					{
						builder.Append(string.Format("\t{0} --> [\n", key.Name));
						{
							StreamConfigurationMap streamConfigurationMap = mCharacteristics.get(SCameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
							SparseArray<string> formatMap = new SparseArray<string>();
							formatMap.put(ImageFormat.JPEG, "JPEG");
							if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
							{
								formatMap.put(ImageFormat.PRIVATE, "PRIVATE");
								formatMap.put(ImageFormat.DEPTH16, "DEPTH16");
								formatMap.put(ImageFormat.DEPTH_POINT_CLOUD, "DEPTH_POINT_CLOUD");
							}
							formatMap.put(ImageFormat.NV16, "NV16");
							formatMap.put(ImageFormat.NV21, "NV21");
							formatMap.put(ImageFormat.RAW10, "RAW10");
							formatMap.put(ImageFormat.RAW_SENSOR, "RAW_SENSOR");
							formatMap.put(ImageFormat.RGB_565, "RGB_565");
							formatMap.put(ImageFormat.UNKNOWN, "UNKNOWN");
							formatMap.put(ImageFormat.YUV_420_888, "420_888");
							formatMap.put(ImageFormat.YUY2, "YUY2");
							formatMap.put(ImageFormat.YV12, "YV12");
							formatMap.put(PixelFormat.RGBA_8888, "RGBA_8888");

							foreach (int format in streamConfigurationMap.OutputFormats)
							{
								builder.Append(string.Format("\t\t{0}(0x{1:x}) --> {2}\n", formatMap.get(format), format, Arrays.deepToString(streamConfigurationMap.getOutputSizes(format))));
								if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
								{
									builder.Append(string.Format("\t\tHigh Resolution {0}(0x{1:x}) --> {2}\n", formatMap.get(format), format, Arrays.deepToString(streamConfigurationMap.getHighResolutionOutputSizes(format))));
								}
							}

							builder.Append(string.Format("\n\t\tHigh speed video fps --> {0}\n", Arrays.deepToString(streamConfigurationMap.HighSpeedVideoFpsRanges)));
							builder.Append(string.Format("\t\tHigh speed video size --> {0}\n", Arrays.deepToString(streamConfigurationMap.HighSpeedVideoSizes)));

							if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
							{
								builder.Append(string.Format("\n\t\tInput formats [\n"));
								foreach (int format in streamConfigurationMap.InputFormats)
								{
									builder.Append(string.Format("\t\t\t{0}(0x{1:x}) --> {2}\n", formatMap.get(format), format, Arrays.deepToString(streamConfigurationMap.getInputSizes(format))));
								}
							}

							builder.Append(string.Format("\t\t]\n"));

						}
						builder.Append("\t]\n");
					}
					else if (mCharacteristics.get(key) is BlackLevelPattern)
					{
						BlackLevelPattern pattern = mCharacteristics.get(SCameraCharacteristics.SENSOR_BLACK_LEVEL_PATTERN);
						int[] patternArray = new int[BlackLevelPattern.COUNT];
						pattern.copyTo(patternArray, 0);

						builder.Append(string.Format("\t{0} --> {1}\n", key.Name, Arrays.ToString(patternArray)));
//.........这里部分代码省略.........
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:101,代码来源:Sample_Single.cs


注:本文中的SparseArray.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。