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


C# CvEnum.ToString方法代码示例

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


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

示例1: LoadLibrary

      /*
      private static void LoadLibrary(string libraryName, string errorMessage)
      {
         errorMessage = String.Format(errorMessage, libraryName);
         try
         {
            IntPtr handle = Emgu.Util.Toolbox.LoadLibrary(libraryName);
            if (handle == IntPtr.Zero)
               throw new DllNotFoundException(errorMessage);
         }
         catch (Exception e)
         {
            throw new DllNotFoundException(errorMessage, e);
         }
      }*/

      #region CV MACROS
      /*
      /// <summary>
      /// This function performs the same as MakeType macro
      /// </summary>
      /// <param name="depth">The type of depth</param>
      /// <param name="cn">The number of channels</param>
      /// <returns></returns>
      public static int MakeType(int depth, int cn)
      {
         return ((depth) + (((cn) - 1) << 3));
      }*/

      /// <summary>
      /// Get the corresponding depth type
      /// </summary>
      /// <param name="t">The opencv depth type</param>
      /// <returns>The equivalent depth type</returns>
      public static Type GetDepthType(CvEnum.DepthType t)
      {
         switch (t)
         {
            case CvEnum.DepthType.Cv8U:
               return typeof(byte);
            case CvEnum.DepthType.Cv8S:
               return typeof(SByte);
            case CvEnum.DepthType.Cv16U:
               return typeof(UInt16);
            case CvEnum.DepthType.Cv16S:
               return typeof(Int16);
            case CvEnum.DepthType.Cv32S:
               return typeof(Int32);
            case CvEnum.DepthType.Cv32F:
               return typeof(float);
            case CvEnum.DepthType.Cv64F:
               return typeof(double);
            default:
               throw new ArgumentException(String.Format("Unable to convert type {0} to depth type", t.ToString()));
         }
      }
开发者ID:joelmuzz,项目名称:Emgu-CV,代码行数:56,代码来源:CvInvoke.cs


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