-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathExifInterOperability.cs
More file actions
60 lines (57 loc) · 1.99 KB
/
ExifInterOperability.cs
File metadata and controls
60 lines (57 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Text;
namespace ExifLibrary
{
/// <summary>
/// Represents interoperability data for an exif tag in the platform byte order.
/// </summary>
public struct ExifInterOperability
{
private ushort mTagID;
private ushort mTypeID;
private uint mCount;
private byte[] mData;
/// <summary>
/// Gets the tag ID defined in the Exif standard.
/// </summary>
public ushort TagID { get { return mTagID; } }
/// <summary>
/// Gets the type code defined in the Exif standard.
/// <list type="bullet">
/// <item>1 = BYTE (byte)</item>
/// <item>2 = ASCII (byte array)</item>
/// <item>3 = SHORT (ushort)</item>
/// <item>4 = LONG (uint)</item>
/// <item>5 = RATIONAL (2 x uint: numerator, denominator)</item>
/// <item>7 = UNDEFINED (byte array)</item>
/// <item>9 = SLONG (int)</item>
/// <item>10 = SRATIONAL (2 x int: numerator, denominator)</item>
/// </list>
/// </summary>
public ushort TypeID { get { return mTypeID; } }
/// <summary>
/// Gets the byte count or number of components.
/// </summary>
public uint Count { get { return mCount; } }
/// <summary>
/// Gets the field value as an array of bytes.
/// </summary>
public byte[] Data { get { return mData; } }
/// <summary>
/// Returns the string representation of this instance.
/// </summary>
/// <returns></returns>
public override string ToString()
{
return string.Format("Tag: {0}, Type: {1}, Count: {2}, Data Length: {3}", mTagID, mTypeID, mCount, mData.Length);
}
public ExifInterOperability(ushort tagid, ushort typeid, uint count, byte[] data)
{
mTagID = tagid;
mTypeID = typeid;
mCount = count;
mData = data;
}
}
}