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


C# Half类代码示例

本文整理汇总了C#中Half的典型用法代码示例。如果您正苦于以下问题:C# Half类的具体用法?C# Half怎么用?C# Half使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: NumBlackPixelsInHalf

		/// <summary>
		/// Cuenta el numero de pixeles negros en la mitad indicada por <c>h</c>.
		/// </summary>
		/// <remarks>
		/// Si la imagen tiene un numero impar de pixeles se incluye la fila
		/// o columna central, segun el caso.
		/// </remarks>
		/// <param name="image">Imagen sobre la que se trabaja</param>
		/// <param name="h">Mitad a analizar</param>
		/// <returns>Numero de pixeles negros</returns>
		public static int NumBlackPixelsInHalf(FloatBitmap image, Half h)
		{
			int n=0;
			
			int width = image.Width;
			int height = image.Height;
			int halfWidth = width/2;
			int halfHeight = height/2;
			
			switch(h) 
			{
				case(Half.Top):
					n=NumPixelsInArea(image,FloatBitmap.Black,
					                  0,0,
					                  width,halfHeight);
					break;
				case(Half.Bottom):
					n=NumPixelsInArea(image,FloatBitmap.Black,
					                  0,halfHeight,
					                  width,height);
					break;
				case(Half.Left):
					n=NumPixelsInArea(image,FloatBitmap.Black,
					                  0,0,
					                  halfWidth,height);
					break;
				case(Half.Right):
					n=NumPixelsInArea(image,FloatBitmap.Black,
					                  halfWidth,0,
					                  width,height);
					break;
			}
			
			return n;			
		}
开发者ID:coler706,项目名称:mathtextrecognizer,代码行数:45,代码来源:CountPixelsHelper.cs

示例2: Normal3hNV

 internal extern static void Normal3hNV(Half nx, Half ny, Half nz);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs

示例3: IsPositiveInfinity

 public static bool IsPositiveInfinity(Half half)
 {
     return (half.value == 0x7c00);
 }
开发者ID:KSLcom,项目名称:CBOR.NET,代码行数:4,代码来源:HalfHelper.cs

示例4: IsNaN

 public static bool IsNaN(Half half)
 {
     return ((half.value & 0x7fff) > 0x7c00);
 }
开发者ID:KSLcom,项目名称:CBOR.NET,代码行数:4,代码来源:HalfHelper.cs

示例5: Negate

 public static Half Negate(Half half)
 {
     return Half.ToHalf((ushort)(half.value ^ 0x8000));
 }
开发者ID:KSLcom,项目名称:CBOR.NET,代码行数:4,代码来源:HalfHelper.cs

示例6: ConvertFrom

 /// <summary>
 /// Converts the given object to the type of this converter, using the specified context and culture information.
 /// </summary>
 /// <param name="context">A <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.</param>
 /// <param name="culture">A <see cref="T:System.Globalization.CultureInfo" />. If <c>null</c> is passed, the current culture is assumed.</param>
 /// <param name="value">The <see cref="T:System.Object" /> to convert.</param>
 /// <returns>An <see cref="T:System.Object" /> that represents the converted value.</returns>
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     if (culture == null)
     {
         culture = CultureInfo.CurrentCulture;
     }
     string @string = value as string;
     if (@string == null)
     {
         return base.ConvertFrom(context, culture, value);
     }
     @string = @string.Trim();
     char[] separator = new char[] { culture.TextInfo.ListSeparator[0] };
     string[] stringArray = @string.Split(separator);
     if (stringArray.Length != 1)
     {
         throw new ArgumentException("Invalid half format.");
     }
     float H = (float)TypeDescriptor.GetConverter(typeof(float)).ConvertFromString(context, culture, stringArray[0]);
     Half type = new Half(H);
     return type;
 }
开发者ID:samitc,项目名称:slimmath,代码行数:29,代码来源:HalfConverter.cs

示例7: VertexWeighthNV

 internal extern static void VertexWeighthNV(Half weight);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs

示例8: VertexAttrib4hNV

 internal extern static void VertexAttrib4hNV(UInt32 index, Half x, Half y, Half z, Half w);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs

示例9: TexCoord3hNV

 internal extern static void TexCoord3hNV(Half s, Half t, Half r);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs

示例10: TexCoord2hNV

 internal extern static void TexCoord2hNV(Half s, Half t);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs

示例11: Color3hNV

 internal extern static void Color3hNV(Half red, Half green, Half blue);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs

示例12: TexCoord1hNV

 internal extern static void TexCoord1hNV(Half s);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs

示例13: SecondaryColor3hvNV

 internal extern static unsafe void SecondaryColor3hvNV(Half* v);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs

示例14: SecondaryColor3hNV

 internal extern static void SecondaryColor3hNV(Half red, Half green, Half blue);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs

示例15: Normal3hvNV

 internal extern static unsafe void Normal3hvNV(Half* v);
开发者ID:renanyoy,项目名称:mono-opentk,代码行数:1,代码来源:GLCore.cs


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