本文整理汇总了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;
}
示例2: Normal3hNV
internal extern static void Normal3hNV(Half nx, Half ny, Half nz);
示例3: IsPositiveInfinity
public static bool IsPositiveInfinity(Half half)
{
return (half.value == 0x7c00);
}
示例4: IsNaN
public static bool IsNaN(Half half)
{
return ((half.value & 0x7fff) > 0x7c00);
}
示例5: Negate
public static Half Negate(Half half)
{
return Half.ToHalf((ushort)(half.value ^ 0x8000));
}
示例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;
}
示例7: VertexWeighthNV
internal extern static void VertexWeighthNV(Half weight);
示例8: VertexAttrib4hNV
internal extern static void VertexAttrib4hNV(UInt32 index, Half x, Half y, Half z, Half w);
示例9: TexCoord3hNV
internal extern static void TexCoord3hNV(Half s, Half t, Half r);
示例10: TexCoord2hNV
internal extern static void TexCoord2hNV(Half s, Half t);
示例11: Color3hNV
internal extern static void Color3hNV(Half red, Half green, Half blue);
示例12: TexCoord1hNV
internal extern static void TexCoord1hNV(Half s);
示例13: SecondaryColor3hvNV
internal extern static unsafe void SecondaryColor3hvNV(Half* v);
示例14: SecondaryColor3hNV
internal extern static void SecondaryColor3hNV(Half red, Half green, Half blue);
示例15: Normal3hvNV
internal extern static unsafe void Normal3hvNV(Half* v);