~cosme/ubuntu/precise/freeimage/freeimage-3.15.1

« back to all changes in this revision

Viewing changes to Wrapper/FreeImage.NET/cs/Library/Structs/FI1BIT.cs

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-07-20 13:42:15 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100720134215-xt1454zaedv3b604
Tags: 3.13.1-0ubuntu1
* New upstream release. Closes: (LP: #607800)
 - Updated debian/freeimage-get-orig-source script.
 - Removing no longer necessary debian/patches/* and
   the patch system in debian/rules.
 - Updated debian/rules to work with the new Makefiles.
 - Drop from -O3 to -O2 and use lzma compression saves
   ~10 MB of free space. 
* lintian stuff
 - fixed debhelper-but-no-misc-depends
 - fixed ldconfig-symlink-missing-for-shlib

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.Collections.Generic;
 
3
using System.Text;
 
4
using System.Diagnostics;
 
5
 
 
6
namespace FreeImageAPI
 
7
{
 
8
        /// <summary>
 
9
        /// The <b>FI1BIT</b> structure represents a single bit.
 
10
        /// It's value can be <i>0</i> or <i>1</i>.
 
11
        /// </summary>
 
12
        [DebuggerDisplay("{value}"),
 
13
        Serializable]
 
14
        public struct FI1BIT
 
15
        {
 
16
                /// <summary>
 
17
                /// Represents the largest possible value of <see cref="FI1BIT"/>. This field is constant.
 
18
                /// </summary>
 
19
                public const byte MaxValue = 0x01;
 
20
 
 
21
                /// <summary>
 
22
                /// Represents the smallest possible value of <see cref="FI1BIT"/>. This field is constant.
 
23
                /// </summary>
 
24
                public const byte MinValue = 0x00;
 
25
 
 
26
                /// <summary>
 
27
                /// The value of the structure.
 
28
                /// </summary>
 
29
                private byte value;
 
30
 
 
31
                /// <summary>
 
32
                /// Initializes a new instance based on the specified value.
 
33
                /// </summary>
 
34
                /// <param name="value">The value to initialize with.</param>
 
35
                private FI1BIT(byte value)
 
36
                {
 
37
                        this.value = (byte)(value & MaxValue);
 
38
                }
 
39
 
 
40
                /// <summary>
 
41
                /// Converts the value of a <see cref="FI1BIT"/> structure to a <see cref="Byte"/> structure.
 
42
                /// </summary>
 
43
                /// <param name="value">A <see cref="FI1BIT"/> structure.</param>
 
44
                /// <returns>A new instance of <see cref="FI1BIT"/> initialized to <paramref name="value"/>.</returns>
 
45
                public static implicit operator byte(FI1BIT value)
 
46
                {
 
47
                        return value.value;
 
48
                }
 
49
 
 
50
                /// <summary>
 
51
                /// Converts the value of a <see cref="Byte"/> structure to a <see cref="FI1BIT"/> structure.
 
52
                /// </summary>
 
53
                /// <param name="value">A <see cref="Byte"/> structure.</param>
 
54
                /// <returns>A new instance of <see cref="FI1BIT"/> initialized to <paramref name="value"/>.</returns>
 
55
                public static implicit operator FI1BIT(byte value)
 
56
                {
 
57
                        return new FI1BIT(value);
 
58
                }
 
59
 
 
60
                /// <summary>
 
61
                /// Converts the numeric value of the <see cref="FI1BIT"/> object
 
62
                /// to its equivalent string representation.
 
63
                /// </summary>
 
64
                /// <returns>The string representation of the value of this instance.</returns>
 
65
                public override string ToString()
 
66
                {
 
67
                        return value.ToString();
 
68
                }
 
69
        }
 
70
}