using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace FreeImageAPI
{
///
/// The FI1BIT structure represents a single bit.
/// It's value can be 0 or 1.
///
[DebuggerDisplay("{value}"),
Serializable]
public struct FI1BIT
{
///
/// Represents the largest possible value of . This field is constant.
///
public const byte MaxValue = 0x01;
///
/// Represents the smallest possible value of . This field is constant.
///
public const byte MinValue = 0x00;
///
/// The value of the structure.
///
private byte value;
///
/// Initializes a new instance based on the specified value.
///
/// The value to initialize with.
private FI1BIT(byte value)
{
this.value = (byte)(value & MaxValue);
}
///
/// Converts the value of a structure to a structure.
///
/// A structure.
/// A new instance of initialized to .
public static implicit operator byte(FI1BIT value)
{
return value.value;
}
///
/// Converts the value of a structure to a structure.
///
/// A structure.
/// A new instance of initialized to .
public static implicit operator FI1BIT(byte value)
{
return new FI1BIT(value);
}
///
/// Converts the numeric value of the object
/// to its equivalent string representation.
///
/// The string representation of the value of this instance.
public override string ToString()
{
return value.ToString();
}
}
}