1
// ==========================================================
2
// FreeImage 3 .NET wrapper
3
// Original FreeImage 3 functions and .NET compatible derived functions
5
// Design and implementation by
6
// - Jean-Philippe Goerke (jpgoerke@users.sourceforge.net)
7
// - Carsten Klein (cklein05@users.sourceforge.net)
10
// - David Boland (davidboland@vodafone.ie)
12
// Main reference : MSDN Knowlede Base
14
// This file is part of FreeImage 3
16
// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
17
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
18
// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
19
// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
20
// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
21
// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
22
// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
23
// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
26
// Use at your own risk!
27
// ==========================================================
29
// ==========================================================
32
// $Date: 2009/02/20 07:41:08 $
33
// $Id: FIMETADATA.cs,v 1.5 2009/02/20 07:41:08 cklein05 Exp $
34
// ==========================================================
37
using System.Runtime.InteropServices;
39
namespace FreeImageAPI
42
/// The <b>FIMETADATA</b> structure is an unique search handle for metadata search operations.
45
/// The <b>FIMETADATA</b> structure is usually returned by the
46
/// <see cref="FreeImageAPI.FreeImage.FindFirstMetadata(FREE_IMAGE_MDMODEL, FIBITMAP, out FITAG)"/>
47
/// function and then used on subsequent calls to
48
/// <see cref="FreeImageAPI.FreeImage.FindNextMetadata(FIMETADATA, out FITAG)"/>.
49
/// When the <b>FIMETADATA</b> handle is no longer used, it needs to be freed by the
50
/// <see cref="FreeImageAPI.FreeImage.FindCloseMetadata(FIMETADATA)"/> function.
52
[Serializable, StructLayout(LayoutKind.Sequential)]
53
public struct FIMETADATA : IComparable, IComparable<FIMETADATA>, IEquatable<FIMETADATA>
58
/// A read-only field that represents a handle that has been initialized to zero.
60
public static readonly FIMETADATA Zero;
63
/// Tests whether two specified <see cref="FIMETADATA"/> structures are equivalent.
65
/// <param name="left">The <see cref="FIMETADATA"/> that is to the left of the equality operator.</param>
66
/// <param name="right">The <see cref="FIMETADATA"/> that is to the right of the equality operator.</param>
68
/// <b>true</b> if the two <see cref="FIMETADATA"/> structures are equal; otherwise, <b>false</b>.
70
public static bool operator ==(FIMETADATA left, FIMETADATA right)
72
return (left.data == right.data);
76
/// Tests whether two specified <see cref="FIMETADATA"/> structures are different.
78
/// <param name="left">The <see cref="FIMETADATA"/> that is to the left of the inequality operator.</param>
79
/// <param name="right">The <see cref="FIMETADATA"/> that is to the right of the inequality operator.</param>
81
/// <b>true</b> if the two <see cref="FIMETADATA"/> structures are different; otherwise, <b>false</b>.
83
public static bool operator !=(FIMETADATA left, FIMETADATA right)
85
return (left.data != right.data);
89
/// Gets whether the pointer is a null pointer or not.
91
/// <value><b>true</b> if this <see cref="FIMETADATA"/> is a null pointer;
92
/// otherwise, <b>false</b>.</value>
97
return (data == IntPtr.Zero);
102
/// Sets the handle to <i>null</i>.
104
public void SetNull()
110
/// Converts the numeric value of the <see cref="FIMETADATA"/> object
111
/// to its equivalent string representation.
113
/// <returns>The string representation of the value of this instance.</returns>
114
public override string ToString()
116
return data.ToString();
120
/// Returns a hash code for this <see cref="FIMETADATA"/> structure.
122
/// <returns>An integer value that specifies the hash code for this <see cref="FIMETADATA"/>.</returns>
123
public override int GetHashCode()
125
return data.GetHashCode();
129
/// Determines whether the specified <see cref="Object"/> is equal to the current <see cref="Object"/>.
131
/// <param name="obj">The <see cref="Object"/> to compare with the current <see cref="Object"/>.</param>
132
/// <returns><b>true</b> if the specified <see cref="Object"/> is equal to the current <see cref="Object"/>; otherwise, <b>false</b>.</returns>
133
public override bool Equals(object obj)
135
return ((obj is FIMETADATA) && (this == ((FIMETADATA)obj)));
139
/// Indicates whether the current object is equal to another object of the same type.
141
/// <param name="other">An object to compare with this object.</param>
142
/// <returns><b>true</b> if the current object is equal to the other parameter; otherwise, <b>false</b>.</returns>
143
public bool Equals(FIMETADATA other)
145
return (this == other);
149
/// Compares this instance with a specified <see cref="Object"/>.
151
/// <param name="obj">An object to compare with this instance.</param>
152
/// <returns>A 32-bit signed integer indicating the lexical relationship between the two comparands.</returns>
153
/// <exception cref="ArgumentException"><paramref name="obj"/> is not a <see cref="FIMETADATA"/>.</exception>
154
public int CompareTo(object obj)
160
if (!(obj is FIMETADATA))
162
throw new ArgumentException("obj");
164
return CompareTo((FIMETADATA)obj);
168
/// Compares this instance with a specified <see cref="FIMETADATA"/> object.
170
/// <param name="other">A <see cref="FIMETADATA"/> to compare.</param>
171
/// <returns>A signed number indicating the relative values of this instance
172
/// and <paramref name="other"/>.</returns>
173
public int CompareTo(FIMETADATA other)
175
return this.data.ToInt64().CompareTo(other.data.ToInt64());
b'\\ No newline at end of file'