Initial commit

This commit is contained in:
Thastertyn committed 2024-06-07 00:47:07 +02:00
commit 262601edb8
2025 files changed
+218754

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5d86ce8f4d2311c57a6bb79780d9d19b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,99 @@
//
// ByteIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a byte value
/// </summary>
public class ByteIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public byte Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="System.Byte"/> to be stored
/// </param>
public ByteIFDEntry (ushort tag, byte value)
{
Tag = tag;
Value = value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Byte;
count = 1;
return Value;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e30ec222d31fe77fbb9a2135c8b82b60
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,99 @@
//
// ByteVectorIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains an BYTE value with a count > 1 (byte sequence).
/// </summary>
public class ByteVectorIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The data which is stored by the current instance
/// </value>
public ByteVector Data { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="data">
/// A <see cref="ByteVector"/> to be stored
/// </param>
public ByteVectorIFDEntry (ushort tag, ByteVector data)
{
Tag = tag;
Data = data;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Byte;
count = (uint)Data.Count;
return Data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 476bad34b205d23448270b585d76cc71
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,88 @@
//
// LongArrayIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a LONG value with a count > 1
/// </summary>
public class LongArrayIFDEntry : ArrayIFDEntry<uint>
{
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="values">
/// A <see cref="T:System.UInt32[]"/> to be stored
/// </param>
public LongArrayIFDEntry (ushort tag, uint[] values) : base (tag)
{
Values = values;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Long;
count = (uint)Values.Length;
ByteVector data = new ByteVector ();
foreach (uint value in Values)
data.Add (ByteVector.FromUInt (value, is_bigendian));
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e4a13318b4ea6b8ab89c09ea3c1e61ad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,99 @@
//
// LongIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a LONG value.
/// </summary>
public class LongIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public uint Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="System.UInt32"/> to be stored
/// </param>
public LongIFDEntry (ushort tag, uint value)
{
Tag = tag;
Value = value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Long;
count = 1;
return ByteVector.FromUInt (Value, is_bigendian);
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5a17ee3c56b573ed9b907c6fbd6f2bb9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,279 @@
//
// MakernoteIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// An enum to represent the manufactor of the makernote
/// The information of the makernote types is from:
/// http://exiv2.org/makernote.html
/// </summary>
public enum MakernoteType
{
/// <summary>
/// The manufactor could not be determined
/// </summary>
Unknown,
/// <summary>
/// Canon makernote.
/// Standard IFD without a special prefix.
/// </summary>
Canon,
/// <summary>
/// Panasonic makernote.
/// "Panasonic\0\0\0" prefix and IFD starting at offset 12.
/// The next-IFD pointer is missing
/// </summary>
Panasonic,
/// <summary>
/// Leica makernote.
/// "LEICA\0\0\0" prefix and IFD starting at offset 10.
/// </summary>
Leica,
/// <summary>
/// Pentax makernote.
/// "AOC\0" + 2 unknown bytes as prefix. The IFD starts at
/// offset 6.
/// </summary>
Pentax,
/// <summary>
/// Nikon makernote (type 1).
/// Standard IFD without a special prefix.
/// </summary>
Nikon1,
/// <summary>
/// Nikon makernote (type 2).
/// "Nikon\0" + 2 unknown bytes prefix. The IFD starts at
/// offset 8.
/// </summary>
Nikon2,
/// <summary>
/// Nikon makernote (type 3).
/// "Nikon\0" + 4 bytes with verison code + Tiff header.
/// The IFD starts usually at offset 18. The offsets of the IFD
/// are relative to start of the Tiff header (byte 10)
/// </summary>
Nikon3,
/// <summary>
/// Olympus makernote (type 1).
/// "OLYMP\0" + 2 unknown bytes as prefix. The IFD starts at
/// offset 8.
/// </summary>
Olympus1,
/// <summary>
/// Olympus makernote (type 2)
/// "OLYMPUS\0II" + 2 unknown bytes as prefix. The IFD starts at
/// offset 12. The offsets of the IFD are relative to the
/// beginning of the makernote.
/// </summary>
Olympus2,
/// <summary>
/// Sony makernote (type 1).
/// "SONY DSC \0\0\0" as prefix. The IFD starts at offset 12. A
/// next-IFD pointer is missing.
/// </summary>
Sony
}
/// <summary>
/// Contains a Makernote IFD.
/// </summary>
/// <remarks>
/// Makernote IFDs are mostly of the same form. They start with and
/// Manufactor specific prefix indicating the type and contain then
/// a IFD structure.
/// It must be distinguished, where the offsets in the IFD belongs to.
/// For some makernotes the offset refers to the beginning of the
/// surrounding metadata IFD structure, for others they refer to the
/// start of the makernote.
/// In addition the endianess of the makernote can be different to the
/// endianess of the surrounding metadata.
/// This class takes care about all those things.
/// </remarks>
public class MakernoteIFDEntry : IFDEntry
{
#region Private Fields
/// <value>
/// Stores the prefix of the makernote
/// </value>
readonly ByteVector prefix;
/// <value>
/// Stores the offset of the IFD contained in makernote
/// </value>
readonly uint ifd_offset;
/// <value>
/// Indicates, if the offsets are relative to the current makernote
/// or absolut to the base_offset of the surrounding IFD.
/// </value>
readonly bool absolute_offset;
/// <value>
/// Stores, if the makernote is encoded in big- or little endian.
/// If the field is <see langword="null"/>, the endianess of the
/// surrounding IFD is used.
/// </value>
readonly bool? is_bigendian;
#endregion
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The type of the makernote the current instance represents
/// </value>
public MakernoteType MakernoteType { get; private set; }
/// <value>
/// The pure <see cref="IFDStructure"/> which is stored by the
/// makernote.
/// </value>
public IFDStructure Structure { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="structure">
/// A <see cref="IFDStructure"/> with the IFD structure, which is stored by this
/// instance
/// </param>
/// <param name="makernoteType">
/// A <see cref="MakernoteType"/> with the type of the makernote.
/// </param>
/// <param name="prefix">
/// A <see cref="ByteVector"/> containing the prefix, which should be rendered
/// before the real IFD.
/// </param>
/// <param name="ifdOffset">
/// A <see cref="System.UInt32"/> with the offset in addition to the relative
/// offsets in the IFD
/// </param>
/// <param name="absoluteOffset">
/// A <see cref="System.Boolean"/> indicating if the offsets of the IFD are relative
/// to the <paramref name="ifdOffset"/>, or absolut to the base offset of the
/// surrounding IFD.
/// </param>
/// <param name="is_bigendian">
/// A <see cref="System.Nullable"/> indicating if the current IFD is encoded in
/// big- or little endian. It it is <see langword="null"/>, the endianess of the
/// surrounding IFD is used.
/// </param>
public MakernoteIFDEntry (ushort tag, IFDStructure structure, MakernoteType makernoteType, ByteVector prefix, uint ifdOffset, bool absoluteOffset, bool? is_bigendian)
{
Tag = tag;
Structure = structure;
MakernoteType = makernoteType;
this.prefix = prefix;
this.ifd_offset = ifdOffset;
this.absolute_offset = absoluteOffset;
this.is_bigendian = is_bigendian;
}
/// <summary>
/// Constructor. Creates a makernote instance just containing an IFD and
/// without any special prefix or offset behavior.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="structure">
/// A <see cref="IFDStructure"/> with the IFD structure, which is stored by this
/// instance
/// </param>
/// <param name="makernote_type">
/// A <see cref="MakernoteType"/> with the type of the makernote.
/// </param>
public MakernoteIFDEntry (ushort tag, IFDStructure structure, MakernoteType makernote_type)
: this (tag, structure, makernote_type, null, 0, true, null) { }
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Undefined;
var renderer =
new IFDRenderer (this.is_bigendian ?? is_bigendian, Structure, absolute_offset ? offset + ifd_offset : ifd_offset);
ByteVector data = renderer.Render ();
data.Insert (0, prefix);
count = (uint)data.Count;
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 15fd16b2b2549ef4ea309a18ee931ad8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+168
View File
@@ -0,0 +1,168 @@
//
// Rational.cs: A structure to represent rational values by a numerator and
// a denominator.
//
// Author:
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
using System;
namespace TagLib.IFD.Entries
{
/// <summary>
/// Representation of an unsigned rational value
/// </summary>
public struct Rational : IFormattable
{
#region Private Fields
/// <summary>
/// The denominator of the rational value
/// </summary>
uint denominator;
#endregion
#region Constructor
/// <summary>
/// Creates a new Rational value
/// </summary>
/// <param name="numerator">
/// A <see cref="System.UInt32"/> with the numerator of the
/// rational value
/// </param>
/// <param name="denominator">
/// A <see cref="System.UInt32"/> with the denominator of the
/// rational value. It must be not 0.
/// </param>
public Rational (uint numerator, uint denominator)
{
if (denominator == 0)
throw new ArgumentException (nameof(denominator));
Numerator = numerator;
this.denominator = denominator;
}
#endregion
#region Public Methods
/// <summary>
/// Returns a rational value with reduced nominator and denominator
/// </summary>
/// <returns>
/// A <see cref="Rational"/>
/// </returns>
public Rational Reduce ()
{
uint gcd = Denominator;
uint b = Numerator;
while (b != 0) {
uint tmp = gcd % b;
gcd = b;
b = tmp;
}
return new Rational (Numerator / gcd, Denominator / gcd);
}
/// <summary>
/// Formatprovider to allow formatting of a value. <see cref="IFormattable"/>
/// </summary>
/// <param name="format">
/// A <see cref="System.String"/>. <see cref="IFormattable"/>
/// </param>
/// <param name="provider">
/// A <see cref="IFormatProvider"/>. <see cref="IFormattable"/>
/// </param>
/// <returns>
/// A <see cref="System.String"/> formated according to the given parameter
/// </returns>
public string ToString (string format, IFormatProvider provider)
{
Rational reduced = Reduce ();
return $"{reduced.Numerator}/{reduced.Denominator}";
}
/// <summary>
/// Converts the value to a <see cref="System.String"/>.
/// </summary>
/// <returns>
/// A <see cref="System.String"/> with the current value.
/// </returns>
public override string ToString ()
{
return $"{this}";
}
#endregion
#region Public Properties
/// <value>
/// The numerator of the rational value
/// </value>
public uint Numerator { get; set; }
/// <value>
/// The denominator of the rational value
/// </value>
/// <remarks>
/// Cannot be 0.
/// </remarks>
public uint Denominator {
get { return denominator; }
set {
if (value == 0)
throw new ArgumentException ("denominator");
denominator = value;
}
}
#endregion
#region Public Static Methods
/// <summary>
/// Cast the <see cref="Rational"/> value to a <see cref="System.Double"/>.
/// </summary>
/// <param name="rat">
/// A <see cref="Rational"/> with the value to cast.
/// </param>
/// <returns>
/// A <see cref="System.Double"/> with the double.
/// </returns>
public static implicit operator double (Rational rat)
{
return rat.Numerator / (double)rat.Denominator;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c54ef18a96c2addaf8af3a46cb1d940e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,91 @@
//
// RationalArrayIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a RATIONAL value with a count > 1
/// </summary>
public class RationalArrayIFDEntry : ArrayIFDEntry<Rational>
{
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="entries">
/// A <see cref="T:Rational[]"/> to be stored
/// </param>
public RationalArrayIFDEntry (ushort tag, Rational[] entries)
: base (tag)
{
Values = entries;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Rational;
count = (uint)Values.Length;
ByteVector data = new ByteVector ();
foreach (Rational rational in Values) {
data.Add (ByteVector.FromUInt (rational.Numerator, is_bigendian));
data.Add (ByteVector.FromUInt (rational.Denominator, is_bigendian));
}
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: de4f327b40f36ebc5b3dae0b5e0308e1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,105 @@
//
// RationalIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a RATIONAL value.
/// </summary>
public class RationalIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public Rational Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="Rational"/>
/// </param>
public RationalIFDEntry (ushort tag, Rational value)
{
Tag = tag;
Value = value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Rational;
count = 1;
var data = new ByteVector {
ByteVector.FromUInt (Value.Numerator, is_bigendian),
ByteVector.FromUInt (Value.Denominator, is_bigendian)
};
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 44b2ca6ba8c384c4d8f3fdaaba537c5b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,100 @@
//
// SByteIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a signed byte value
/// </summary>
public class SByteIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public sbyte Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="System.SByte"/> to be stored
/// </param>
public SByteIFDEntry (ushort tag, sbyte value)
{
Tag = tag;
Value = value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.SByte;
count = 1;
return (byte)Value;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c5ed6e266e2174f649f633c341f65d0b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,88 @@
//
// SLongArrayIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a SLONG value with a count > 1
/// </summary>
public class SLongArrayIFDEntry : ArrayIFDEntry<int>
{
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="values">
/// A <see cref="T:System.Int32[]"/> to be stored
/// </param>
public SLongArrayIFDEntry (ushort tag, int[] values) : base (tag)
{
Values = values;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Long;
count = (uint)Values.Length;
ByteVector data = new ByteVector ();
foreach (int value in Values)
data.Add (ByteVector.FromInt (value, is_bigendian));
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ed66a5dd5e70f2507998da510321ed28
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,100 @@
//
// SLongIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a signed LONG value.
/// </summary>
public class SLongIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public int Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="System.Int32"/> to be stored
/// </param>
public SLongIFDEntry (ushort tag, int value)
{
Tag = tag;
Value = value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.SLong;
count = 1;
return ByteVector.FromInt (Value, is_bigendian);
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 328fcbc8e76d1d1f2ac1d4889c0d07af
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,168 @@
//
// SRational.cs: A structure to represent signed rational values by a
// numerator and a denominator.
//
// Author:
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
using System;
namespace TagLib.IFD.Entries
{
/// <summary>
/// Representation of a signed rational value
/// </summary>
public struct SRational : IFormattable
{
#region Private Fields
/// <summary>
/// The denominator of the rational value
/// </summary>
int denominator;
#endregion
#region Constructor
/// <summary>
/// Creates a new Rational value
/// </summary>
/// <param name="numerator">
/// A <see cref="System.Int32"/> with the numerator of the
/// rational value
/// </param>
/// <param name="denominator">
/// A <see cref="System.Int32"/> with the denominator of the
/// rational value. It must be not 0.
/// </param>
public SRational (int numerator, int denominator)
{
if (denominator == 0)
throw new ArgumentException (nameof(denominator), "denominator can't be 0");
Numerator = numerator;
this.denominator = denominator;
}
#endregion
#region Public Methods
/// <summary>
/// Returns a rational value with reduced nominator and denominator
/// </summary>
/// <returns>
/// A <see cref="SRational"/>
/// </returns>
public SRational Reduce ()
{
int den_sign = Math.Sign (Denominator);
int gcd = Math.Abs (Denominator);
int b = Math.Abs (Numerator);
while (b != 0) {
int tmp = gcd % b;
gcd = b;
b = tmp;
}
return new SRational (den_sign * (Numerator / gcd), Math.Abs (Denominator) / gcd);
}
/// <summary>
/// Formatprovider to allow formatting of a value. <see cref="IFormattable"/>
/// </summary>
/// <param name="format">
/// A <see cref="System.String"/>. <see cref="IFormattable"/>
/// </param>
/// <param name="provider">
/// A <see cref="IFormatProvider"/>. <see cref="IFormattable"/>
/// </param>
/// <returns>
/// A <see cref="System.String"/> formated according to the given parameter
/// </returns>
public string ToString (string format, IFormatProvider provider)
{
SRational reduced = Reduce ();
return $"{reduced.Numerator}/{reduced.Denominator}";
}
/// <summary>
/// Converts the value to a <see cref="System.String"/>.
/// </summary>
/// <returns>
/// A <see cref="System.String"/> with the current value.
/// </returns>
public override string ToString ()
{
return $"{this}";
}
#endregion
#region Public Properties
/// <value>
/// The numerator of the rational value
/// </value>
public int Numerator { get; set; }
/// <value>
/// The denominator of the rational value
/// </value>
/// <remarks>
/// Cannot be 0.
/// </remarks>
public int Denominator {
get { return denominator; }
set {
if (value == 0)
throw new ArgumentException ("denominator");
denominator = value;
}
}
#endregion
#region Public Static Methods
/// <summary>
/// Cast the <see cref="Rational"/> value to a <see cref="System.Double"/>.
/// </summary>
/// <param name="rat">
/// A <see cref="Rational"/> with the value to cast.
/// </param>
/// <returns>
/// A <see cref="System.Double"/> with the double.
/// </returns>
public static implicit operator double (SRational rat)
{
return rat.Numerator / (double)rat.Denominator;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 442566190340b7ee19bb53e0604dfb27
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,91 @@
//
// SRationalArrayIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a SRATIONAL value with a count > 1
/// </summary>
public class SRationalArrayIFDEntry : ArrayIFDEntry<SRational>
{
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="entries">
/// A <see cref="T:SRational[]"/> to be stored
/// </param>
public SRationalArrayIFDEntry (ushort tag, SRational[] entries)
: base (tag)
{
Values = entries;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.SRational;
count = (uint)Values.Length;
ByteVector data = new ByteVector ();
foreach (SRational rational in Values) {
data.Add (ByteVector.FromInt (rational.Numerator, is_bigendian));
data.Add (ByteVector.FromInt (rational.Denominator, is_bigendian));
}
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 76c58e1dee89487ecbe5ec447cdad58c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,105 @@
//
// SRationalIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a SRATIONAL value.
/// </summary>
public class SRationalIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public SRational Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="SRational"/> to be stored
/// </param>
public SRationalIFDEntry (ushort tag, SRational value)
{
Tag = tag;
Value = value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.SRational;
count = 1;
var data = new ByteVector {
ByteVector.FromInt (Value.Numerator, is_bigendian),
ByteVector.FromInt (Value.Denominator, is_bigendian)
};
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fcbd5cb51bb75489bbde84ea02e5e5b8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,89 @@
//
// SShortArrayIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a SSHORT value with a count > 1
/// </summary>
public class SShortArrayIFDEntry : ArrayIFDEntry<short>
{
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="values">
/// A <see cref="T:System.Int16[]"/> to be stored
/// </param>
public SShortArrayIFDEntry (ushort tag, short[] values) : base (tag)
{
Values = values;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.SShort;
count = (uint)Values.Length;
ByteVector data = new ByteVector ();
foreach (var value in Values)
data.Add (ByteVector.FromShort (value, is_bigendian));
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 727f03ef3a38b1d4e8a97d4aa6f710dd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,99 @@
//
// SShortIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a Signed SHORT value.
/// </summary>
public class SShortIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public ushort Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="System.Int16"/> to be stored
/// </param>
public SShortIFDEntry (ushort tag, ushort value)
{
Tag = tag;
Value = value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.SShort;
count = 1;
return ByteVector.FromUShort (Value, is_bigendian);
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 22221f4a48ba6653c844d7d26a4915bf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,89 @@
//
// ShortArrayIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a SHORT value with a count > 1
/// </summary>
public class ShortArrayIFDEntry : ArrayIFDEntry<ushort>
{
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="values">
/// A <see cref="T:System.UInt16[]"/> to be stored
/// </param>
public ShortArrayIFDEntry (ushort tag, ushort[] values) : base (tag)
{
Values = values;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Short;
count = (uint)Values.Length;
ByteVector data = new ByteVector ();
foreach (ushort value in Values)
data.Add (ByteVector.FromUShort (value, is_bigendian));
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c635594ea3db213b38d2cf4178d4a4f0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,99 @@
//
// ShortIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a SHORT value.
/// </summary>
public class ShortIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public ushort Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="System.UInt16"/> to be stored
/// </param>
public ShortIFDEntry (ushort tag, ushort value)
{
Tag = tag;
Value = value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Short;
count = 1;
return ByteVector.FromUShort (Value, is_bigendian);
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1317a01474fe7d76b8440b29fe50bcfc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,104 @@
//
// StringIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains an ASCII STRING value.
/// </summary>
public class StringIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public string Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="System.String"/> to be stored
/// </param>
public StringIFDEntry (ushort tag, string value)
{
Tag = tag;
Value = value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Ascii;
ByteVector data = Value;
data.Add ("\0");
count = (uint)data.Count;
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cd95c96d002f6a6dcb39e311991cdb66
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,150 @@
//
// StripOffsetsIFDEntry.cs:
//
// Author:
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
using System;
using System.IO;
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains the offsets to the image data strips.
/// </summary>
public class StripOffsetsIFDEntry : ArrayIFDEntry<uint>
{
#region Private Fields
/// <value>
/// Store the strip length to read them before writing.
/// </value>
readonly uint[] byte_counts;
/// <value>
/// The file the offsets belong to
/// </value>
readonly File file;
#endregion
#region Constructors
/// <summary>
/// Constructor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="values">
/// A <see cref="T:System.UInt32[]"/> with the strip offsets.
/// </param>
/// <param name="byte_counts">
/// The length of the strips.
/// </param>
/// <param name="file">
/// The file from which the strips will be read.
/// </param>
public StripOffsetsIFDEntry (ushort tag, uint[] values, uint[] byte_counts, File file) : base (tag)
{
Values = values;
this.byte_counts = byte_counts;
this.file = file;
if (values.Length != byte_counts.Length)
throw new Exception ("strip offsets and strip byte counts do not have the same length");
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
// The StripOffsets are an array of offsets, where the image data can be found.
// We store the offsets and behind the offsets the image data is stored. Therfore,
// the ByteVector data first collects the image data and the offsets itself are
// collected by offset_data. Then both are concatenated.
ByteVector data = new ByteVector ();
ByteVector offset_data = new ByteVector ();
// every offset needs 4 byte, we need to reserve the bytes.
uint data_offset = offset + (uint)(4 * Values.Length);
for (int i = 0; i < Values.Length; i++) {
uint new_offset = (uint)(data_offset + data.Count);
file.Seek (Values[i], SeekOrigin.Begin);
data.Add (file.ReadBlock ((int)byte_counts[i]));
// update strip offset data to new offset
Values[i] = new_offset;
offset_data.Add (ByteVector.FromUInt (new_offset, is_bigendian));
}
// If the StripOffsets only consists of one offset, this doesn't work, because this offset
// should be stored inside the IFD as a value. But, because of the additional image data,
// it is not stored there. We need to fix this, that the offset is adjusted correctly.
// Therefore, the offset_data is only added if it contains more than one value.
// Then, the offset is set correctly. (However, we need to ensure, that the image data
// consists at least of 4 bytes, which is probably the case every time, but to be sure ...)
// However, the strip offset in the array must also be adjusted, if the offset_data is ignored.
if (Values.Length > 1)
data.Insert (0, offset_data);
else
Values[0] = offset;
while (data.Count < 4)
data.Add (0x00);
// the entry is a single long entry where the value is an offset to the data
// the offset is automatically updated by the renderer.
type = (ushort)IFDEntryType.Long;
count = (uint)Values.Length;
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b262bd25288ec03bcae2a46557c937ed
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,97 @@
//
// SubIFDArrayEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
using System;
using System.Collections.Generic;
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains the SubIFDs IFD entry.
/// </summary>
public class SubIFDArrayEntry : IFDEntry
{
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag {
get;
set;
}
/// <value>
/// The structures of the IFDs to which this entry points.
/// </value>
public IFDStructure[] Entries { get; private set; }
#region Constructors
/// <summary>
/// Constructor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="entries">
/// A set of ifd structures.
/// </param>
public SubIFDArrayEntry (ushort tag, List<IFDStructure> entries)
{
Tag = tag;
Entries = entries.ToArray ();
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
throw new NotImplementedException ("Not implemented yet!");
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ee312155639ae8185acc2b682f87064c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,126 @@
//
// SubIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains a Sub IFD.
/// </summary>
public class SubIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The type of the IFD entry.
/// </value>
public ushort Type { get; private set; }
/// <value>
/// The count of the IFD entry.
/// </value>
public uint Count { get; private set; }
/// <value>
/// The structure of the sub-ifd which is stored by the current
/// instance
/// </value>
public IFDStructure Structure { get; private set; }
/// <value>
/// The number of entries in the entire IFD.
/// </value>
public int ChildCount {
get {
int sum = 0;
foreach (var directory in Structure.Directories)
sum += directory.Count;
return sum;
}
}
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> with the type of the IFD entry.
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the IFD entry.
/// </param>
/// <param name="structure">
/// A <see cref="IFDStructure"/> to be stored
/// </param>
public SubIFDEntry (ushort tag, ushort type, uint count, IFDStructure structure)
{
Tag = tag;
Type = type;
Count = count;
Structure = structure;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = Type;
count = Count;
return new IFDRenderer (is_bigendian, Structure, offset).Render ();
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3fe882109f05b15fb9b7ad5ea782ab22
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,105 @@
//
// ThumbnailDataIFDEntry.cs:
//
// Author:
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains the data of a Thumbnail. Since the thumbnail is
/// referenced by two long entries (offset to the data and length)
/// we need to take care of this special case.
/// This entry acts as the offset-entry but holds also the
/// thumbail data. When rendering the entry, we have to render the
/// data but write a long entry.
/// </summary>
public class ThumbnailDataIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The data of the thumbnail which is stored by the current instance
/// </value>
public ByteVector Data { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="data">
/// A <see cref="ByteVector"/> with the thumbnail data to be stored
/// </param>
public ThumbnailDataIFDEntry (ushort tag, ByteVector data)
{
Tag = tag;
Data = data;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
// the entry is a single long entry where the value is an offset to the data
// the offset is automatically updated by the renderer.
type = (ushort)IFDEntryType.Long;
count = 1;
return Data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8c560a76d5d631847a3c12e716dcb2d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,100 @@
//
// UndefinedIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (miek@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains an Undefined value type, represented by a byte vector
/// </summary>
public class UndefinedIFDEntry : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The data which is stored by the current instance
/// </value>
public ByteVector Data { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="data">
/// A <see cref="ByteVector"/> to be stored
/// </param>
public UndefinedIFDEntry (ushort tag, ByteVector data)
{
Tag = tag;
Data = data;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Undefined;
count = (uint)Data.Count;
return Data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 92771c9e9c69b6a3892532a48bed0b99
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,209 @@
//
// UserCommentIFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Entries
{
/// <summary>
/// Contains an ASCII STRING value.
/// </summary>
public class UserCommentIFDEntry : IFDEntry
{
#region Constant Values
/// <summary>
/// Marker for an ASCII-encoded UserComment tag.
/// </summary>
public static readonly ByteVector COMMENT_ASCII_CODE = new byte[] { 0x41, 0x53, 0x43, 0x49, 0x49, 0x00, 0x00, 0x00 };
/// <summary>
/// Marker for a JIS-encoded UserComment tag.
/// </summary>
public static readonly ByteVector COMMENT_JIS_CODE = new byte[] { 0x4A, 0x49, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00 };
/// <summary>
/// Marker for a UNICODE-encoded UserComment tag.
/// </summary>
public static readonly ByteVector COMMENT_UNICODE_CODE = new byte[] { 0x55, 0x4E, 0x49, 0x43, 0x4F, 0x44, 0x45, 0x00 };
/// <summary>
/// Corrupt marker that seems to be resembling unicode.
/// </summary>
public static readonly ByteVector COMMENT_BAD_UNICODE_CODE = new byte[] { 0x55, 0x6E, 0x69, 0x63, 0x6F, 0x64, 0x65, 0x00 };
/// <summary>
/// Marker for a UserComment tag with undefined encoding.
/// </summary>
public static readonly ByteVector COMMENT_UNDEFINED_CODE = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
#endregion
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The value which is stored by the current instance
/// </value>
public string Value { get; private set; }
#endregion
#region Constructors
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="value">
/// A <see cref="string"/> to be stored
/// </param>
public UserCommentIFDEntry (ushort tag, string value)
{
Tag = tag;
Value = value;
}
/// <summary>
/// Construcor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
/// <param name="data">
/// A <see cref="ByteVector"/> to be stored
/// </param>
/// <param name="file">
/// The file that's currently being parsed, used for reporting corruptions.
/// </param>
public UserCommentIFDEntry (ushort tag, ByteVector data, File file)
{
Tag = tag;
if (data.StartsWith (COMMENT_ASCII_CODE)) {
Value = TrimNull (data.ToString (StringType.Latin1, COMMENT_ASCII_CODE.Count, data.Count - COMMENT_ASCII_CODE.Count));
return;
}
if (data.StartsWith (COMMENT_UNICODE_CODE)) {
Value = TrimNull (data.ToString (StringType.UTF8, COMMENT_UNICODE_CODE.Count, data.Count - COMMENT_UNICODE_CODE.Count));
return;
}
var trimmed = data.ToString ().Trim ();
if (trimmed.Length == 0 || trimmed == "\0") {
Value = string.Empty;
return;
}
// Some programs like e.g. CanonZoomBrowser inserts just the first 0x00-byte
// followed by 7-bytes of trash.
if (data.StartsWith ((byte)0x00) && data.Count >= 8) {
// And CanonZoomBrowser fills some trailing bytes of the comment field
// with '\0'. So we return only the characters before the first '\0'.
int term = data.Find ("\0", 8);
if (term != -1) {
Value = data.ToString (StringType.Latin1, 8, term - 8);
} else {
Value = data.ToString (StringType.Latin1, 8, data.Count - 8);
}
return;
}
if (data.Data.Length == 0) {
Value = string.Empty;
return;
}
// Try to parse anyway
int offset = 0;
int length = data.Count - offset;
// Corruption that starts with a Unicode header and a count byte.
if (data.StartsWith (COMMENT_BAD_UNICODE_CODE)) {
offset = COMMENT_BAD_UNICODE_CODE.Count;
length = data.Count - offset;
}
file.MarkAsCorrupt ("UserComment with other encoding than Latin1 or Unicode");
Value = TrimNull (data.ToString (StringType.UTF8, offset, length));
}
string TrimNull (string value)
{
int term = value.IndexOf ('\0');
if (term > -1)
value = value.Substring (0, term);
return value;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
{
type = (ushort)IFDEntryType.Undefined;
var data = new ByteVector {
COMMENT_UNICODE_CODE,
ByteVector.FromString (Value, StringType.UTF8)
};
count = (uint)data.Count;
return data;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 89a8a2b7ae6819d1296a07d4a94fa225
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+35
View File
@@ -0,0 +1,35 @@
//
// IFDDirectory.cs: A dictionary grouping IFDEntries.
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2009 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
using System.Collections.Generic;
namespace TagLib.IFD
{
/// <summary>
/// Contains the entries in this IFD.
/// </summary>
public class IFDDirectory : Dictionary<ushort, IFDEntry>
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d0acb7d7e95bc4ce3bad0c425947b412
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+132
View File
@@ -0,0 +1,132 @@
//
// IFDEntry.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD
{
/// <summary>
/// An IFD entry, which is a key/value pair inside an IFD.
/// </summary>
public interface IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
ushort Tag { get; }
#endregion
#region Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count);
#endregion
}
/// <summary>
/// This class abstracts common stuff for array IFD entries
/// </summary>
public abstract class ArrayIFDEntry<T> : IFDEntry
{
#region Properties
/// <value>
/// The ID of the tag, the current instance belongs to
/// </value>
public ushort Tag { get; private set; }
/// <value>
/// The values stored by the current instance.
/// </value>
public T[] Values { get; protected set; }
#endregion
#region Constructors
/// <summary>
/// Constructor.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag ID of the entry this instance
/// represents
/// </param>
public ArrayIFDEntry (ushort tag)
{
Tag = tag;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>
/// </summary>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/> indicating the endianess for rendering.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset, the data is stored.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> the ID of the type, which is rendered
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the count of the values which are
/// rendered.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered data.
/// </returns>
public abstract ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count);
#endregion
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 319f3c2809c4aab049a1d992e6c28035
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+108
View File
@@ -0,0 +1,108 @@
//
// IFDEntryType.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD
{
/// <summary>
/// A type indicator, which identifies how the corresponding value
/// field should be interpreted.
/// </summary>
public enum IFDEntryType : ushort
{
/// <summary>
/// Unknown (shouldn't occur)
/// </summary>
Unknown = 0,
/// <summary>
/// 8-bit unsigned integer.
/// </summary>
Byte = 1,
/// <summary>
/// 8-bit byte that contains a 7-bit ASCII code; the last byte
/// must be NUL (binary zero).
/// </summary>
Ascii = 2,
/// <summary>
/// 16-bit (2-byte) unsigned integer.
/// </summary>
Short = 3,
/// <summary>
/// 32-bit (4-byte) unsigned integer.
/// </summary>
Long = 4,
/// <summary>
/// Two LONGs: the first represents the numerator of a
/// fraction; the second, the denominator.
/// </summary>
Rational = 5,
/// <summary>
/// An 8-bit signed (twos-complement) integer.
/// </summary>
SByte = 6,
/// <summary>
/// An 8-bit byte that may contain anything, depending on
/// the definition of the field.
/// </summary>
Undefined = 7,
/// <summary>
/// A 16-bit (2-byte) signed (twos-complement) integer.
/// </summary>
SShort = 8,
/// <summary>
/// A 32-bit (4-byte) signed (twos-complement) integer.
/// </summary>
SLong = 9,
/// <summary>
/// Two SLONG’s: the first represents the numerator of a
/// fraction, the second the denominator.
/// </summary>
SRational = 10,
/// <summary>
/// Single precision (4-byte) IEEE format.
/// </summary>
Float = 11,
/// <summary>
/// Double precision (8-byte) IEEE format.
/// </summary>
Double = 12,
/// <summary>
/// IFD
/// </summary>
IFD = 13
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d7c4e9ec2f759079db2b5865f5f8cf44
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large. Load diff
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 91edd387b20a655a6aefd3ed9841b1e7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+274
View File
@@ -0,0 +1,274 @@
//
// IFDRenderer.cs: Outputs an IFD structure into TIFF IFD bytes.
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
using System;
using System.Collections.Generic;
using TagLib.IFD.Entries;
namespace TagLib.IFD
{
/// <summary>
/// This class contains all the IFD rendering code.
/// </summary>
public class IFDRenderer
{
#region Private Fields
/// <summary>
/// The IFD structure that will be rendered.
/// </summary>
readonly IFDStructure structure;
/// <summary>
/// If IFD should be encoded in BigEndian or not.
/// </summary>
readonly bool is_bigendian;
/// <summary>
/// A <see cref="System.UInt32"/> value with the offset of the
/// current IFD. All offsets inside the IFD must be adjusted
/// according to this given offset.
/// </summary>
readonly uint ifd_offset;
#endregion
#region Constructors
/// <summary>
/// Constructor. Will render the given IFD structure.
/// </summary>
/// <param name="is_bigendian">
/// If IFD should be encoded in BigEndian or not.
/// </param>
/// <param name="structure">
/// The IFD structure that will be rendered.
/// </param>
/// <param name="ifd_offset">
/// A <see cref="System.UInt32"/> value with the offset of the
/// current IFD. All offsets inside the IFD must be adjusted
/// according to this given offset.
/// </param>
public IFDRenderer (bool is_bigendian, IFDStructure structure, uint ifd_offset)
{
this.is_bigendian = is_bigendian;
this.structure = structure;
this.ifd_offset = ifd_offset;
}
#endregion
#region Public Methods
/// <summary>
/// Renders the current instance to a <see cref="ByteVector"/>.
/// </summary>
/// <returns>
/// A <see cref="ByteVector"/> containing the rendered IFD.
/// </returns>
public ByteVector Render ()
{
ByteVector ifd_data = new ByteVector ();
uint current_offset = ifd_offset;
var directories = structure.directories;
for (int index = 0; index < directories.Count; index++) {
ByteVector data = RenderIFD (directories[index], current_offset, index == directories.Count - 1);
current_offset += (uint)data.Count;
ifd_data.Add (data);
}
return ifd_data;
}
#endregion
#region Private Methods
/// <summary>
/// Renders the IFD to an ByteVector where the offset of the IFD
/// itself is <paramref name="ifd_offset"/> and all offsets
/// contained in the IFD are adjusted accroding it.
/// </summary>
/// <param name="directory">
/// A <see cref="IFDDirectory"/> with the directory to render.
/// </param>
/// <param name="ifd_offset">
/// A <see cref="System.UInt32"/> with the offset of the IFD
/// </param>
/// <param name="last">
/// A <see cref="System.Boolean"/> which is true, if the IFD is
/// the last one, i.e. the offset to the next IFD, which is
/// stored inside the IFD, is 0. If the value is false, the
/// offset to the next IFD is set that it starts directly after
/// the current one.
/// </param>
/// <returns>
/// A <see cref="ByteVector"/> with the rendered IFD.
/// </returns>
ByteVector RenderIFD (IFDDirectory directory, uint ifd_offset, bool last)
{
if (directory.Count > ushort.MaxValue)
throw new Exception ($"Directory has too much entries: {directory.Count}");
// Remove empty SUB ifds.
var tags = new List<ushort> (directory.Keys);
foreach (var tag in tags) {
var entry = directory[tag];
if (entry is SubIFDEntry && (entry as SubIFDEntry).ChildCount == 0) {
directory.Remove (tag);
}
}
ushort entry_count = (ushort)directory.Count;
// ifd_offset + size of entry_count + entries + next ifd offset
uint data_offset = ifd_offset + 2 + 12 * (uint)entry_count + 4;
// store the entries itself
ByteVector entry_data = new ByteVector ();
// store the data referenced by the entries
ByteVector offset_data = new ByteVector ();
entry_data.Add (ByteVector.FromUShort (entry_count, is_bigendian));
foreach (IFDEntry entry in directory.Values)
RenderEntryData (entry, entry_data, offset_data, data_offset);
if (last)
entry_data.Add ("\0\0\0\0");
else
entry_data.Add (ByteVector.FromUInt ((uint)(data_offset + offset_data.Count), is_bigendian));
if (data_offset - ifd_offset != entry_data.Count)
throw new Exception ($"Expected IFD data size was {data_offset - ifd_offset} but is {entry_data.Count}");
entry_data.Add (offset_data);
return entry_data;
}
#endregion
#region Protected Methods
/// <summary>
/// Adds the data of a single entry to <paramref name="entry_data"/>.
/// </summary>
/// <param name="entry_data">
/// A <see cref="ByteVector"/> to add the entry to.
/// </param>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag of the entry.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> with the type of the entry.
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the data count of the entry,
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset field of the entry.
/// </param>
protected void RenderEntry (ByteVector entry_data, ushort tag, ushort type, uint count, uint offset)
{
entry_data.Add (ByteVector.FromUShort (tag, is_bigendian));
entry_data.Add (ByteVector.FromUShort (type, is_bigendian));
entry_data.Add (ByteVector.FromUInt (count, is_bigendian));
entry_data.Add (ByteVector.FromUInt (offset, is_bigendian));
}
/// <summary>
/// Renders a complete entry together with the data. The entry itself
/// is stored in <paramref name="entry_data"/> and the data of the
/// entry is stored in <paramref name="offset_data"/> if it cannot be
/// stored in the offset. This method is called for every <see
/// cref="IFDEntry"/> of this IFD and can be overwritten in subclasses
/// to provide special behavior.
/// </summary>
/// <param name="entry">
/// A <see cref="IFDEntry"/> with the entry to render.
/// </param>
/// <param name="entry_data">
/// A <see cref="ByteVector"/> to add the entry to.
/// </param>
/// <param name="offset_data">
/// A <see cref="ByteVector"/> to add the entry data to if it cannot be
/// stored in the offset field.
/// </param>
/// <param name="data_offset">
/// A <see cref="System.UInt32"/> with the offset, were the data of the
/// entries starts. It is needed to adjust the offsets of the entries
/// itself.
/// </param>
protected virtual void RenderEntryData (IFDEntry entry, ByteVector entry_data, ByteVector offset_data, uint data_offset)
{
ushort tag = entry.Tag;
uint offset = (uint)(data_offset + offset_data.Count);
ByteVector data = entry.Render (is_bigendian, offset, out var type, out var count);
// store data in offset, if it is smaller than 4 byte
if (data.Count <= 4) {
while (data.Count < 4)
data.Add ("\0");
offset = data.ToUInt (is_bigendian);
data = null;
}
// preserve word boundary of offsets
if (data != null && data.Count % 2 != 0)
data.Add ("\0");
RenderEntry (entry_data, tag, type, count, offset);
offset_data.Add (data);
}
/// <summary>
/// Constructs a new IFD Renderer used to render a <see cref="SubIFDEntry"/>.
/// </summary>
/// <param name="is_bigendian">
/// If IFD should be encoded in BigEndian or not.
/// </param>
/// <param name="structure">
/// The IFD structure that will be rendered.
/// </param>
/// <param name="ifd_offset">
/// A <see cref="System.UInt32"/> value with the offset of the
/// current IFD. All offsets inside the IFD must be adjusted
/// according to this given offset.
/// </param>
protected virtual IFDRenderer CreateSubRenderer (bool is_bigendian, IFDStructure structure, uint ifd_offset)
{
return new IFDRenderer (is_bigendian, structure, ifd_offset);
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 540c048ee927708f6bd68f9ccd791ef6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+466
View File
@@ -0,0 +1,466 @@
//
// IFDStructure.cs: A structure resembling the logical structure of a TIFF IFD
// file. This is the same structure as used by Exif.
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
// Paul Lange (palango@gmx.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
using System;
using System.Collections.Generic;
using TagLib.IFD.Entries;
using TagLib.IFD.Tags;
namespace TagLib.IFD
{
/// <summary>
/// This class resembles the structure of a TIFF file. It can either be a
/// top-level IFD, or a nested IFD (in the case of Exif).
/// </summary>
public class IFDStructure
{
#region Private Fields
static readonly string DATETIME_FORMAT = "yyyy:MM:dd HH:mm:ss";
/// <summary>
/// Contains the IFD directories in this tag.
/// </summary>
internal readonly List<IFDDirectory> directories = new List<IFDDirectory> ();
#endregion
#region Public Properties
/// <summary>
/// Gets the IFD directories contained in the current instance.
/// </summary>
/// <value>
/// An array of <see cref="IFDDirectory"/> instances.
/// </value>
public IFDDirectory[] Directories {
get { return directories.ToArray (); }
}
#endregion
#region Public Methods
/// <summary>
/// Checks, if a value for the given tag is contained in the IFD.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> value with the directory index that
/// contains the tag.
/// </param>
/// <param name="tag">
/// A <see cref="System.UInt16"/> value with the tag.
/// </param>
/// <returns>
/// A <see cref="System.Boolean"/>, which is true, if the tag is already
/// contained in the IFD, otherwise false.
/// </returns>
public bool ContainsTag (int directory, ushort tag)
{
if (directory >= directories.Count)
return false;
return directories[directory].ContainsKey (tag);
}
/// <summary>
/// Removes a given tag from the IFD.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> value with the directory index that
/// contains the tag to remove.
/// </param>
/// <param name="tag">
/// A <see cref="System.UInt16"/> value with the tag to remove.
/// </param>
public void RemoveTag (int directory, ushort tag)
{
if (ContainsTag (directory, tag)) {
directories[directory].Remove (tag);
}
}
/// <summary>
/// Removes a given tag from the IFD.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> value with the directory index that
/// contains the tag to remove.
/// </param>
/// <param name="entry_tag">
/// A <see cref="IFDEntryTag"/> value with the tag to remove.
/// </param>
public void RemoveTag (int directory, IFDEntryTag entry_tag)
{
RemoveTag (directory, (ushort)entry_tag);
}
/// <summary>
/// Adds an <see cref="IFDEntry"/> to the IFD, if it is not already
/// contained in, it fails otherwise.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> value with the directory index that
/// should contain the tag that will be added.
/// </param>
/// <param name="entry">
/// A <see cref="IFDEntry"/> to add to the IFD.
/// </param>
public void AddEntry (int directory, IFDEntry entry)
{
while (directory >= directories.Count)
directories.Add (new IFDDirectory ());
directories[directory].Add (entry.Tag, entry);
}
/// <summary>
/// Adds an <see cref="IFDEntry"/> to the IFD. If it is already contained
/// in the IFD, it is overwritten.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> value with the directory index that
/// contains the tag that will be set.
/// </param>
/// <param name="entry">
/// A <see cref="IFDEntry"/> to add to the IFD.
/// </param>
public void SetEntry (int directory, IFDEntry entry)
{
if (ContainsTag (directory, entry.Tag))
RemoveTag (directory, entry.Tag);
AddEntry (directory, entry);
}
/// <summary>
/// Returns the <see cref="IFDEntry"/> belonging to the given tag.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the directory that contains
/// the wanted tag.
/// </param>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag to get.
/// </param>
/// <returns>
/// A <see cref="IFDEntry"/> belonging to the given tag, or
/// null, if no such tag is contained in the IFD.
/// </returns>
public IFDEntry GetEntry (int directory, ushort tag)
{
if (!ContainsTag (directory, tag))
return null;
return directories[directory][tag];
}
/// <summary>
/// Returns the <see cref="IFDEntry"/> belonging to the given tag.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the directory that contains
/// the wanted tag.
/// </param>
/// <param name="entry_tag">
/// A <see cref="IFDEntryTag"/> with the tag to get.
/// </param>
/// <returns>
/// A <see cref="IFDEntry"/> belonging to the given tag, or
/// null, if no such tag is contained in the IFD.
/// </returns>
public IFDEntry GetEntry (int directory, IFDEntryTag entry_tag)
{
return GetEntry (directory, (ushort)entry_tag);
}
/// <summary>
/// Returns the <see cref="System.String"/> stored in the
/// entry defined by <paramref name="entry_tag"/>.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to search for the entry.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <returns>
/// A <see cref="System.String"/> with the value stored in the entry
/// or <see langword="null" /> if no such entry is contained or it
/// does not contain a <see cref="System.String"/> value.
/// </returns>
public string GetStringValue (int directory, ushort entry_tag)
{
var entry = GetEntry (directory, entry_tag);
if (entry is StringIFDEntry)
return (entry as StringIFDEntry).Value;
return null;
}
/// <summary>
/// Returns a <see cref="System.Nullable"/> containing the
/// <see cref="System.Byte"/> stored in the entry defined
/// by <paramref name="entry_tag"/>.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to search for the entry.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <returns>
/// A <see cref="System.Nullable"/> containing the
/// <see cref="System.Byte"/> stored in the entry, or
/// <see langword="null" /> if no such entry is contained or it
/// does not contain a <see cref="System.Byte"/> value.
/// </returns>
public byte? GetByteValue (int directory, ushort entry_tag)
{
var entry = GetEntry (directory, entry_tag);
if (entry != null && entry is ByteIFDEntry)
return (entry as ByteIFDEntry).Value;
return null;
}
/// <summary>
/// Returns a <see cref="System.Nullable"/> containing the
/// <see cref="System.UInt32"/> stored in the entry defined
/// by <paramref name="entry_tag"/>.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to search for the entry.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <returns>
/// A <see cref="System.Nullable"/> containing the
/// <see cref="System.UInt32"/> stored in the entry, or
/// <see langword="null" /> if no such entry is contained or it
/// does not contain a <see cref="System.UInt32"/> value.
/// </returns>
public uint? GetLongValue (int directory, ushort entry_tag)
{
var entry = GetEntry (directory, entry_tag);
if (entry is LongIFDEntry)
return (entry as LongIFDEntry).Value;
if (entry is ShortIFDEntry)
return (entry as ShortIFDEntry).Value;
return null;
}
/// <summary>
/// Returns a <see cref="System.Nullable"/> containing the
/// <see cref="System.Double"/> stored in the entry defined
/// by <paramref name="entry_tag"/>. The entry can be of type
/// <see cref="Entries.RationalIFDEntry"/> or
/// <see cref="Entries.SRationalIFDEntry"/>
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to search for the entry.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <returns>
/// A <see cref="System.Nullable"/> containing the
/// <see cref="System.Double"/> stored in the entry, or
/// <see langword="null" /> if no such entry is contained.
/// </returns>
public double? GetRationalValue (int directory, ushort entry_tag)
{
var entry = GetEntry (directory, entry_tag);
if (entry is RationalIFDEntry)
return (entry as RationalIFDEntry).Value;
if (entry is SRationalIFDEntry)
return (entry as SRationalIFDEntry).Value;
return null;
}
/// <summary>
/// Returns a <see cref="System.Nullable"/> containing the
/// <see cref="System.DateTime"/> stored in the entry defined
/// by <paramref name="entry_tag"/>. The entry must be of type
/// <see cref="Entries.StringIFDEntry"/> and contain an datestring
/// according to the Exif specification.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to search for the entry.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <returns>
/// A <see cref="System.Nullable"/> containing the
/// <see cref="System.DateTime"/> stored in the entry, or
/// <see langword="null" /> if no such entry is contained or it
/// does not contain a valid value.
/// </returns>
public DateTime? GetDateTimeValue (int directory, ushort entry_tag)
{
string date_string = GetStringValue (directory, entry_tag);
try {
DateTime date_time = DateTime.ParseExact (date_string,
DATETIME_FORMAT, System.Globalization.CultureInfo.InvariantCulture);
return date_time;
} catch { }
return null;
}
/// <summary>
/// Adds a <see cref="Entries.StringIFDEntry"/> to the directory with tag
/// given by <paramref name="entry_tag"/> and value given by <paramref name="value"/>
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to add the entry to.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <param name="value">
/// A <see cref="System.String"/> with the value to add. If it is <see langword="null" />
/// an possibly already contained entry is removed for given tag.
/// </param>
public void SetStringValue (int directory, ushort entry_tag, string value)
{
if (value == null) {
RemoveTag (directory, entry_tag);
return;
}
SetEntry (directory, new StringIFDEntry (entry_tag, value));
}
/// <summary>
/// Adds a <see cref="Entries.ByteIFDEntry"/> to the directory with tag
/// given by <paramref name="entry_tag"/> and value given by <paramref name="value"/>
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to add the entry to.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <param name="value">
/// A <see cref="System.Byte"/> with the value to add.
/// </param>
public void SetByteValue (int directory, ushort entry_tag, byte value)
{
SetEntry (directory, new ByteIFDEntry (entry_tag, value));
}
/// <summary>
/// Adds a <see cref="Entries.LongIFDEntry"/> to the directory with tag
/// given by <paramref name="entry_tag"/> and value given by <paramref name="value"/>
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to add the entry to.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <param name="value">
/// A <see cref="System.UInt32"/> with the value to add.
/// </param>
public void SetLongValue (int directory, ushort entry_tag, uint value)
{
SetEntry (directory, new LongIFDEntry (entry_tag, value));
}
/// <summary>
/// Adds a <see cref="Entries.RationalIFDEntry"/> to the directory with tag
/// given by <paramref name="entry_tag"/> and value given by <paramref name="value"/>
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to add the entry to.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <param name="value">
/// A <see cref="System.Double"/> with the value to add. It must be possible to
/// represent the value by a <see cref="Entries.Rational"/>.
/// </param>
public void SetRationalValue (int directory, ushort entry_tag, double value)
{
if (value < 0.0d || value > uint.MaxValue)
throw new ArgumentException ("value");
uint scale = (value >= 1.0d) ? 1 : uint.MaxValue;
Rational rational = new Rational ((uint)(scale * value), scale);
SetEntry (directory, new RationalIFDEntry (entry_tag, rational));
}
/// <summary>
/// Adds a <see cref="Entries.StringIFDEntry"/> to the directory with tag
/// given by <paramref name="entry_tag"/> and value given by <paramref name="value"/>.
/// The value is stored as a date string according to the Exif specification.
/// </summary>
/// <param name="directory">
/// A <see cref="System.Int32"/> with the number of the directory
/// to add the entry to.
/// </param>
/// <param name="entry_tag">
/// A <see cref="System.UInt16"/> with the tag of the entry
/// </param>
/// <param name="value">
/// A <see cref="DateTime"/> with the value to add.
/// </param>
public void SetDateTimeValue (int directory, ushort entry_tag, DateTime value)
{
string date_string = value.ToString (DATETIME_FORMAT);
SetStringValue (directory, entry_tag, date_string);
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d803d4188b13d12409576884ba45abb2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+623
View File
@@ -0,0 +1,623 @@
//
// IFDTag.cs: Basic Tag-class to handle an IFD (Image File Directory) with
// its image-tags.
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
// Paul Lange (palango@gmx.de)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
using System;
using TagLib.IFD.Entries;
using TagLib.IFD.Tags;
using TagLib.Image;
namespace TagLib.IFD
{
/// <summary>
/// Contains the metadata for one IFD (Image File Directory).
/// </summary>
public class IFDTag : ImageTag
{
#region Private Fields
/// <summary>
/// A reference to the Exif IFD (which can be found by following the
/// pointer in IFD0, ExifIFD tag). This variable should not be used
/// directly, use the <see cref="ExifIFD"/> property instead.
/// </summary>
IFDStructure exif_ifd;
/// <summary>
/// A reference to the GPS IFD (which can be found by following the
/// pointer in IFD0, GPSIFD tag). This variable should not be used
/// directly, use the <see cref="GPSIFD"/> property instead.
/// </summary>
IFDStructure gps_ifd;
#endregion
#region Public Properties
/// <value>
/// The IFD structure referenced by the current instance
/// </value>
public IFDStructure Structure { get; private set; }
/// <summary>
/// The Exif IFD. Will create one if the file doesn't alread have it.
/// </summary>
/// <remarks>
/// <para>Note how this also creates an empty IFD for exif, even if
/// you don't set a value. That's okay, empty nested IFDs get ignored
/// when rendering.</para>
/// </remarks>
public IFDStructure ExifIFD {
get {
if (exif_ifd == null) {
if (!(Structure.GetEntry (0, IFDEntryTag.ExifIFD) is SubIFDEntry entry)) {
exif_ifd = new IFDStructure ();
entry = new SubIFDEntry ((ushort)IFDEntryTag.ExifIFD, (ushort)IFDEntryType.Long, 1, exif_ifd);
Structure.SetEntry (0, entry);
}
exif_ifd = entry.Structure;
}
return exif_ifd;
}
}
/// <summary>
/// The GPS IFD. Will create one if the file doesn't alread have it.
/// </summary>
/// <remarks>
/// <para>Note how this also creates an empty IFD for GPS, even if
/// you don't set a value. That's okay, empty nested IFDs get ignored
/// when rendering.</para>
/// </remarks>
public IFDStructure GPSIFD {
get {
if (gps_ifd == null) {
if (!(Structure.GetEntry (0, IFDEntryTag.GPSIFD) is SubIFDEntry entry)) {
gps_ifd = new IFDStructure ();
entry = new SubIFDEntry ((ushort)IFDEntryTag.GPSIFD, (ushort)IFDEntryType.Long, 1, gps_ifd);
Structure.SetEntry (0, entry);
}
gps_ifd = entry.Structure;
}
return gps_ifd;
}
}
/// <summary>
/// Gets the tag types contained in the current instance.
/// </summary>
/// <value>
/// Always <see cref="TagTypes.TiffIFD" />.
/// </value>
public override TagTypes TagTypes {
get { return TagTypes.TiffIFD; }
}
#endregion
#region Constructors
/// <summary>
/// Constructor. Creates an empty IFD tag. Can be populated manually, or via
/// <see cref="IFDReader"/>.
/// </summary>
public IFDTag ()
{
Structure = new IFDStructure ();
}
#endregion
#region Public Methods
/// <summary>
/// Clears the values stored in the current instance.
/// </summary>
public override void Clear ()
{
throw new NotImplementedException ();
}
#endregion
#region Metadata fields
/// <summary>
/// Gets or sets the comment for the image described
/// by the current instance.
/// </summary>
/// <value>
/// A <see cref="string" /> containing the comment of the
/// current instace.
/// </value>
public override string Comment {
get {
if (!(ExifIFD.GetEntry (0, (ushort)ExifEntryTag.UserComment) is UserCommentIFDEntry comment_entry)) {
var description = Structure.GetEntry (0, IFDEntryTag.ImageDescription) as StringIFDEntry;
return description?.Value;
}
return comment_entry.Value;
}
set {
if (value == null) {
ExifIFD.RemoveTag (0, (ushort)ExifEntryTag.UserComment);
Structure.RemoveTag (0, (ushort)IFDEntryTag.ImageDescription);
return;
}
ExifIFD.SetEntry (0, new UserCommentIFDEntry ((ushort)ExifEntryTag.UserComment, value));
Structure.SetEntry (0, new StringIFDEntry ((ushort)IFDEntryTag.ImageDescription, value));
}
}
/// <summary>
/// Gets and sets the copyright information for the media
/// represented by the current instance.
/// </summary>
/// <value>
/// A <see cref="string" /> object containing the copyright
/// information for the media represented by the current
/// instance or <see langword="null" /> if no value present.
/// </value>
public override string Copyright {
get {
return Structure.GetStringValue (0, (ushort)IFDEntryTag.Copyright);
}
set {
if (value == null) {
Structure.RemoveTag (0, (ushort)IFDEntryTag.Copyright);
return;
}
Structure.SetEntry (0, new StringIFDEntry ((ushort)IFDEntryTag.Copyright, value));
}
}
/// <summary>
/// Gets or sets the creator of the image.
/// </summary>
/// <value>
/// A <see cref="string" /> with the name of the creator.
/// </value>
public override string Creator {
get {
return Structure.GetStringValue (0, (ushort)IFDEntryTag.Artist);
}
set {
Structure.SetStringValue (0, (ushort)IFDEntryTag.Artist, value);
}
}
/// <summary>
/// Gets or sets the software the image, the current instance
/// belongs to, was created with.
/// </summary>
/// <value>
/// A <see cref="string" /> containing the name of the
/// software the current instace was created with.
/// </value>
public override string Software {
get {
return Structure.GetStringValue (0, (ushort)IFDEntryTag.Software);
}
set {
Structure.SetStringValue (0, (ushort)IFDEntryTag.Software, value);
}
}
/// <summary>
/// Gets or sets the time when the image, the current instance
/// belongs to, was taken.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the time the image was taken.
/// </value>
public override DateTime? DateTime {
get { return DateTimeOriginal; }
set { DateTimeOriginal = value; }
}
/// <summary>
/// The time of capturing.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the time of capturing.
/// </value>
public DateTime? DateTimeOriginal {
get {
return ExifIFD.GetDateTimeValue (0, (ushort)ExifEntryTag.DateTimeOriginal);
}
set {
if (value == null) {
ExifIFD.RemoveTag (0, (ushort)ExifEntryTag.DateTimeOriginal);
return;
}
ExifIFD.SetDateTimeValue (0, (ushort)ExifEntryTag.DateTimeOriginal, value.Value);
}
}
/// <summary>
/// The time of digitization.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the time of digitization.
/// </value>
public DateTime? DateTimeDigitized {
get {
return ExifIFD.GetDateTimeValue (0, (ushort)ExifEntryTag.DateTimeDigitized);
}
set {
if (value == null) {
ExifIFD.RemoveTag (0, (ushort)ExifEntryTag.DateTimeDigitized);
return;
}
ExifIFD.SetDateTimeValue (0, (ushort)ExifEntryTag.DateTimeDigitized, value.Value);
}
}
/// <summary>
/// Gets or sets the latitude of the GPS coordinate the current
/// image was taken.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the latitude ranging from -90.0
/// to +90.0 degrees.
/// </value>
public override double? Latitude {
get {
var gps_ifd = GPSIFD;
var degree_ref = gps_ifd.GetStringValue (0, (ushort)GPSEntryTag.GPSLatitudeRef);
if (!(gps_ifd.GetEntry (0, (ushort)GPSEntryTag.GPSLatitude) is RationalArrayIFDEntry degree_entry) || degree_ref == null)
return null;
Rational[] values = degree_entry.Values;
if (values.Length != 3)
return null;
double deg = values[0] + values[1] / 60.0d + values[2] / 3600.0d;
if (degree_ref == "S")
deg *= -1.0d;
return Math.Max (Math.Min (deg, 90.0d), -90.0d);
}
set {
var gps_ifd = GPSIFD;
if (value == null) {
gps_ifd.RemoveTag (0, (ushort)GPSEntryTag.GPSLatitudeRef);
gps_ifd.RemoveTag (0, (ushort)GPSEntryTag.GPSLatitude);
return;
}
double angle = value.Value;
if (angle < -90.0d || angle > 90.0d)
throw new ArgumentException ("value");
InitGpsDirectory ();
gps_ifd.SetStringValue (0, (ushort)GPSEntryTag.GPSLatitudeRef, angle < 0 ? "S" : "N");
var entry =
new RationalArrayIFDEntry ((ushort)GPSEntryTag.GPSLatitude, DegreeToRationals (Math.Abs (angle)));
gps_ifd.SetEntry (0, entry);
}
}
/// <summary>
/// Gets or sets the longitude of the GPS coordinate the current
/// image was taken.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the longitude ranging from -180.0
/// to +180.0 degrees.
/// </value>
public override double? Longitude {
get {
var gps_ifd = GPSIFD;
var degree_ref = gps_ifd.GetStringValue (0, (ushort)GPSEntryTag.GPSLongitudeRef);
if (!(gps_ifd.GetEntry (0, (ushort)GPSEntryTag.GPSLongitude) is RationalArrayIFDEntry degree_entry) || degree_ref == null)
return null;
Rational[] values = degree_entry.Values;
if (values.Length != 3)
return null;
double deg = values[0] + values[1] / 60.0d + values[2] / 3600.0d;
if (degree_ref == "W")
deg *= -1.0d;
return Math.Max (Math.Min (deg, 180.0d), -180.0d);
}
set {
var gps_ifd = GPSIFD;
if (value == null) {
gps_ifd.RemoveTag (0, (ushort)GPSEntryTag.GPSLongitudeRef);
gps_ifd.RemoveTag (0, (ushort)GPSEntryTag.GPSLongitude);
return;
}
double angle = value.Value;
if (angle < -180.0d || angle > 180.0d)
throw new ArgumentException ("value");
InitGpsDirectory ();
gps_ifd.SetStringValue (0, (ushort)GPSEntryTag.GPSLongitudeRef, angle < 0 ? "W" : "E");
var entry =
new RationalArrayIFDEntry ((ushort)GPSEntryTag.GPSLongitude,
DegreeToRationals (Math.Abs (angle)));
gps_ifd.SetEntry (0, entry);
}
}
/// <summary>
/// Gets or sets the altitude of the GPS coordinate the current
/// image was taken. The unit is meter.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the altitude. A positive value
/// is above sea level, a negative one below sea level. The unit is meter.
/// </value>
public override double? Altitude {
get {
var gps_ifd = GPSIFD;
var altitude = gps_ifd.GetRationalValue (0, (ushort)GPSEntryTag.GPSAltitude);
var ref_entry = gps_ifd.GetByteValue (0, (ushort)GPSEntryTag.GPSAltitudeRef);
if (altitude == null)
return null;
if (ref_entry != null && ref_entry.Value == 1)
altitude *= -1.0d;
return altitude;
}
set {
var gps_ifd = GPSIFD;
if (value == null) {
gps_ifd.RemoveTag (0, (ushort)GPSEntryTag.GPSAltitudeRef);
gps_ifd.RemoveTag (0, (ushort)GPSEntryTag.GPSAltitude);
return;
}
double altitude = value.Value;
InitGpsDirectory ();
gps_ifd.SetByteValue (0, (ushort)GPSEntryTag.GPSAltitudeRef, (byte)(altitude < 0 ? 1 : 0));
gps_ifd.SetRationalValue (0, (ushort)GPSEntryTag.GPSAltitude, Math.Abs (altitude));
}
}
/// <summary>
/// Gets the exposure time the image, the current instance belongs
/// to, was taken with.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the exposure time in seconds.
/// </value>
public override double? ExposureTime {
get {
return ExifIFD.GetRationalValue (0, (ushort)ExifEntryTag.ExposureTime);
}
set {
ExifIFD.SetRationalValue (0, (ushort)ExifEntryTag.ExposureTime, value ?? 0);
}
}
/// <summary>
/// Gets the FNumber the image, the current instance belongs
/// to, was taken with.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the FNumber.
/// </value>
public override double? FNumber {
get {
return ExifIFD.GetRationalValue (0, (ushort)ExifEntryTag.FNumber);
}
set {
ExifIFD.SetRationalValue (0, (ushort)ExifEntryTag.FNumber, value ?? 0);
}
}
/// <summary>
/// Gets the ISO speed the image, the current instance belongs
/// to, was taken with.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the ISO speed as defined in ISO 12232.
/// </value>
public override uint? ISOSpeedRatings {
get {
return ExifIFD.GetLongValue (0, (ushort)ExifEntryTag.ISOSpeedRatings);
}
set {
ExifIFD.SetLongValue (0, (ushort)ExifEntryTag.ISOSpeedRatings, value ?? 0);
}
}
/// <summary>
/// Gets the focal length the image, the current instance belongs
/// to, was taken with.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the focal length in millimeters.
/// </value>
public override double? FocalLength {
get {
return ExifIFD.GetRationalValue (0, (ushort)ExifEntryTag.FocalLength);
}
set {
ExifIFD.SetRationalValue (0, (ushort)ExifEntryTag.FocalLength, value ?? 0);
}
}
/// <summary>
/// Gets the focal length the image, the current instance belongs
/// to, was taken with, assuming a 35mm film camera.
/// </summary>
/// <value>
/// A <see cref="System.Nullable"/> with the focal length in 35mm equivalent in millimeters.
/// </value>
public override uint? FocalLengthIn35mmFilm {
get {
return ExifIFD.GetLongValue (0, (ushort)ExifEntryTag.FocalLengthIn35mmFilm);
}
set {
if (value.HasValue) {
ExifIFD.SetLongValue (0, (ushort)ExifEntryTag.FocalLengthIn35mmFilm, (uint)value);
} else {
ExifIFD.RemoveTag (0, (ushort)ExifEntryTag.FocalLengthIn35mmFilm);
}
}
}
/// <summary>
/// Gets or sets the orientation of the image described
/// by the current instance.
/// </summary>
/// <value>
/// A <see cref="TagLib.Image.ImageOrientation" /> containing the orientation of the
/// image
/// </value>
public override ImageOrientation Orientation {
get {
var orientation = Structure.GetLongValue (0, (ushort)IFDEntryTag.Orientation);
if (orientation.HasValue)
return (ImageOrientation)orientation;
return ImageOrientation.None;
}
set {
if ((uint)value < 1U || (uint)value > 8U) {
Structure.RemoveTag (0, (ushort)IFDEntryTag.Orientation);
return;
}
Structure.SetLongValue (0, (ushort)IFDEntryTag.Orientation, (uint)value);
}
}
/// <summary>
/// Gets the manufacture of the recording equipment the image, the
/// current instance belongs to, was taken with.
/// </summary>
/// <value>
/// A <see cref="string" /> with the manufacture name.
/// </value>
public override string Make {
get {
return Structure.GetStringValue (0, (ushort)IFDEntryTag.Make);
}
set {
Structure.SetStringValue (0, (ushort)IFDEntryTag.Make, value);
}
}
/// <summary>
/// Gets the model name of the recording equipment the image, the
/// current instance belongs to, was taken with.
/// </summary>
/// <value>
/// A <see cref="string" /> with the model name.
/// </value>
public override string Model {
get {
return Structure.GetStringValue (0, (ushort)IFDEntryTag.Model);
}
set {
Structure.SetStringValue (0, (ushort)IFDEntryTag.Model, value);
}
}
#endregion
#region Private Methods
/// <summary>
/// Initilazies the GPS IFD with some basic entries.
/// </summary>
void InitGpsDirectory ()
{
GPSIFD.SetStringValue (0, (ushort)GPSEntryTag.GPSVersionID, "2 0 0 0");
GPSIFD.SetStringValue (0, (ushort)GPSEntryTag.GPSMapDatum, "WGS-84");
}
/// <summary>
/// Converts a given (positive) angle value to three rationals like they
/// are used to store an angle for GPS data.
/// </summary>
/// <param name="angle">
/// A <see cref="System.Double"/> between 0.0d and 180.0d with the angle
/// in degrees
/// </param>
/// <returns>
/// A <see cref="Rational"/> representing the same angle by degree, minutes
/// and seconds of the angle.
/// </returns>
Rational[] DegreeToRationals (double angle)
{
if (angle < 0.0 || angle > 180.0)
throw new ArgumentException (nameof (angle));
uint deg = (uint)Math.Floor (angle);
uint min = (uint)((angle - Math.Floor (angle)) * 60.0);
uint sec = (uint)((angle - Math.Floor (angle) - (min / 60.0)) * 360000000.0);
var rationals = new[] {
new Rational (deg, 1),
new Rational (min, 1),
new Rational (sec, 100000)
};
return rationals;
}
#endregion
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 900cb93c339b0a8628f65f31b1e731ae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8d07597f836219a9791c2a22e3080335
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,124 @@
//
// Nikon3MakernoteReader.cs: Reads Nikon Makernotes.
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2009 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
using TagLib.IFD.Entries;
using TagLib.IFD.Tags;
namespace TagLib.IFD.Makernotes
{
/// <summary>
/// This class contains Nikon3 makernote specific reading logic.
/// </summary>
public class Nikon3MakernoteReader : IFDReader
{
#region Constructors
/// <summary>
/// Constructor. Reads an IFD from given file, using the given endianness.
/// </summary>
/// <param name="file">
/// A <see cref="File"/> to read from.
/// </param>
/// <param name="is_bigendian">
/// A <see cref="System.Boolean"/>, it must be true, if the data of the IFD should be
/// read as bigendian, otherwise false.
/// </param>
/// <param name="structure">
/// A <see cref="IFDStructure"/> that will be populated.
/// </param>
/// <param name="base_offset">
/// A <see cref="System.Int64"/> value describing the base were the IFD offsets
/// refer to. E.g. in Jpegs the IFD are located in an Segment and the offsets
/// inside the IFD refer from the beginning of this segment. So <paramref
/// name="base_offset"/> must contain the beginning of the segment.
/// </param>
/// <param name="ifd_offset">
/// A <see cref="System.UInt32"/> value with the beginning of the IFD relative to
/// <paramref name="base_offset"/>.
/// </param>
/// <param name="max_offset">
/// A <see cref="System.UInt32"/> value with maximal possible offset. This is to limit
/// the size of the possible data;
/// </param>
public Nikon3MakernoteReader (File file, bool is_bigendian, IFDStructure structure, long base_offset, uint ifd_offset, uint max_offset) :
base (file, is_bigendian, structure, base_offset, ifd_offset, max_offset)
{
}
#endregion
#region Protected Methods
/// <summary>
/// Try to parse the given IFD entry, used to discover format-specific entries.
/// </summary>
/// <param name="tag">
/// A <see cref="System.UInt16"/> with the tag of the entry.
/// </param>
/// <param name="type">
/// A <see cref="System.UInt16"/> with the type of the entry.
/// </param>
/// <param name="count">
/// A <see cref="System.UInt32"/> with the data count of the entry.
/// </param>
/// <param name="base_offset">
/// A <see cref="System.Int64"/> with the base offset which every offsets in the
/// IFD are relative to.
/// </param>
/// <param name="offset">
/// A <see cref="System.UInt32"/> with the offset of the entry.
/// </param>
/// <returns>
/// A <see cref="IFDEntry"/> with the given parameters, or null if none was parsed, after
/// which the normal TIFF parsing is used.
/// </returns>
protected override IFDEntry ParseIFDEntry (ushort tag, ushort type, uint count, long base_offset, uint offset)
{
if (tag == (ushort)Nikon3MakerNoteEntryTag.Preview) {
// SubIFD with Preview Image
// The entry itself is usually a long
// TODO: handle JPEGInterchangeFormat and JPEGInterchangeFormatLength correctly
// The preview field contains a long with an offset to an IFD
// that contains the preview image. We need to be careful
// though: this IFD does not contain a valid next-offset
// pointer. For this reason, we only read the first IFD and
// ignore the rest (which is preview image data, directly
// starting after the IFD entries).
type = (ushort)IFDEntryType.IFD;
IFDStructure ifd_structure = new IFDStructure ();
IFDReader reader = CreateSubIFDReader (file, is_bigendian, ifd_structure, base_offset, offset, max_offset);
reader.Read (1);
return new SubIFDEntry (tag, type, (uint)ifd_structure.Directories.Length, ifd_structure);
}
return base.ParseIFDEntry (tag, type, count, base_offset, offset);
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0392f7f010e6ccc16b8b458227cf2bff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d1c72790457a1b67cb439abf7d610939
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,92 @@
//
// CanonFileInfoEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Label tags for Canon File Info.
/// Based on http://www.exiv2.org/tags-canon.html
/// </summary>
public enum CanonFileInfoEntryTag : ushort
{
/// <summary>
/// File Number. (Hex: 0X0001)
/// </summary>
FileNumber = 1,
/// <summary>
/// Bracket Mode. (Hex: 0X0003)
/// </summary>
BracketMode = 3,
/// <summary>
/// Bracket Value. (Hex: 0X0004)
/// </summary>
BracketValue = 4,
/// <summary>
/// Bracket Shot Number. (Hex: 0X0005)
/// </summary>
BracketShotNumber = 5,
/// <summary>
/// Raw Jpg Quality. (Hex: 0X0006)
/// </summary>
RawJpgQuality = 6,
/// <summary>
/// Raw Jpg Size. (Hex: 0X0007)
/// </summary>
RawJpgSize = 7,
/// <summary>
/// Noise Reduction. (Hex: 0X0008)
/// </summary>
NoiseReduction = 8,
/// <summary>
/// WB Bracket Mode. (Hex: 0X0009)
/// </summary>
WBBracketMode = 9,
/// <summary>
/// WB Bracket Value AB. (Hex: 0X000C)
/// </summary>
WBBracketValueAB = 12,
/// <summary>
/// WB Bracket Value GM. (Hex: 0X000D)
/// </summary>
WBBracketValueGM = 13,
/// <summary>
/// Filter Effect. (Hex: 0X000E)
/// </summary>
FilterEffect = 14,
/// <summary>
/// Toning Effect. (Hex: 0X000F)
/// </summary>
ToningEffect = 15,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c2208990c4f88e2f9b946504a09c3635
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,159 @@
//
// CanonMakerNoteEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009-2010 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Label tags for Canon Makernote.
/// Based on http://www.burren.cx/david/canon.html and http://www.exiv2.org/tags-canon.html
/// </summary>
public enum CanonMakerNoteEntryTag : ushort
{
/// <summary>
/// Unknown field at tag 0x0000. (Hex: 0x0000)
/// </summary>
Unknown0 = 0,
/// <summary>
/// Camera Settings. (Hex: 0x0001)
/// </summary>
CameraSettings = 1,
/// <summary>
/// Focal Length. (Hex: 0x0002)
/// </summary>
FocalLength = 2,
/// <summary>
/// Unknown field at tag 0x0000. (Hex: 0x0003)
/// </summary>
Unknown3 = 3,
/// <summary>
/// Shot Information. (Hex: 0x0004)
/// </summary>
ShotInfo = 4,
/// <summary>
/// Panorama. (Hex: 0x0005)
/// </summary>
Panorama = 5,
/// <summary>
/// Image Type. (Hex: 0x0006)
/// </summary>
ImageType = 6,
/// <summary>
/// Firmware Version. (Hex: 0x0007)
/// </summary>
FirmwareVersion = 7,
/// <summary>
/// Image Number. (Hex: 0x0008)
/// </summary>
ImageNumber = 8,
/// <summary>
/// Owner Name. (Hex: 0x0009)
/// </summary>
OwnerName = 9,
/// <summary>
/// Serial Number. (Hex: 0x000C)
/// </summary>
SerialNumber = 12,
/// <summary>
/// Unknown field at tag 0x0000. (Hex: 0x000D)
/// </summary>
Unknown13 = 13,
/// <summary>
/// Custom Functions. (Hex: 0x000F)
/// </summary>
CustomFunctions = 15,
/// <summary>
/// Model ID. (Hex: 0x0010)
/// </summary>
ModelID = 16,
/// <summary>
/// Picture Info. (Hex: 0x0012)
/// </summary>
PictureInfo = 18,
/// <summary>
/// Serial Number Format. (Hex: 0x0015)
/// </summary>
SerialNumberFormat = 21,
/// <summary>
/// Canon File Info. (Hex: 0x0093)
/// </summary>
CanonFileInfo = 147,
/// <summary>
/// Lens Model. (Hex: 0x0095)
/// </summary>
LensModel = 149,
/// <summary>
/// Serial Info. (Hex: 0x0096)
/// </summary>
SerialInfo = 150,
/// <summary>
/// Processing Info. (Hex: 0x00A0)
/// </summary>
ProcessingInfo = 160,
/// <summary>
/// White Balance Table. (Hex: 0x00A9)
/// </summary>
WhiteBalanceTable = 169,
/// <summary>
/// Measured Color. (Hex: 0x00AA)
/// </summary>
MeasuredColor = 170,
/// <summary>
/// Color Space. (Hex: 0x00B4)
/// </summary>
ColorSpace = 180,
/// <summary>
/// Sensor Info. (Hex: 0x00E0)
/// </summary>
SensorInfo = 224,
/// <summary>
/// Black Level. (Hex: 0x4008)
/// </summary>
BlackLevel = 16392,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 828232a9fc6470c27bfd8eed9f67e839
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,62 @@
//
// CanonPictureInfoEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Label tags for Canon Picture Info.
/// Based on http://www.exiv2.org/tags-canon.html
/// </summary>
public enum CanonPictureInfoEntryTag : ushort
{
/// <summary>
/// Image width. (Hex: 0X0002)
/// </summary>
ImageWidth = 2,
/// <summary>
/// Image height. (Hex: 0X0003)
/// </summary>
ImageHeight = 3,
/// <summary>
/// Image width (as shot). (Hex: 0X0004)
/// </summary>
ImageWidthAsShot = 4,
/// <summary>
/// Image height (as shot). (Hex: 0X0005)
/// </summary>
ImageHeightAsShot = 5,
/// <summary>
/// AF points used. (Hex: 0X0016)
/// </summary>
AFPointsUsed = 22,
/// <summary>
/// AF points used (20D). (Hex: 0X001A)
/// </summary>
AFPointsUsed20D = 26,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8ce6f60143368460da115ce92b58c1e7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,385 @@
//
// ExifEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009-2010 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Entry tags occuring in the Exif IFD
/// The complete overview can be obtained at:
/// http://www.awaresystems.be/imaging/tiff.html
/// </summary>
public enum ExifEntryTag : ushort
{
/// <summary>
/// Contains two values representing the minimum rows and columns
/// to define the repeating patterns of the color filter array.
/// (Hex: 0x828D)
/// </summary>
CFARepeatPatternDim = 33421,
/// <summary>
/// Contains two values representing the minimum rows and columns
/// to define the repeating patterns of the color filter array.
/// (Hex: 0x828E)
/// </summary>
CFAPattern = 33422,
/// <summary>
/// Exposure time, given in seconds. (Hex: 0x829A)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposuretime.html
/// </summary>
ExposureTime = 33434,
/// <summary>
/// The F number. (Hex: 0x829D)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/fnumber.html
/// </summary>
FNumber = 33437,
/// <summary>
/// The class of the program used by the camera to set exposure when the picture is taken. (Hex: 0x8822)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposureprogram.html
/// </summary>
ExposureProgram = 34850,
/// <summary>
/// Indicates the spectral sensitivity of each channel of the camera used. (Hex: 0x8824)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/spectralsensitivity.html
/// </summary>
SpectralSensitivity = 34852,
/// <summary>
/// Indicates the ISO Speed and ISO Latitude of the camera or input device as specified in ISO 12232. (Hex: 0x8827)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/isospeedratings.html
/// </summary>
ISOSpeedRatings = 34855,
/// <summary>
/// Indicates the Opto-Electric Conversion Function (OECF) specified in ISO 14524. (Hex: 0x8828)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/oecf.html
/// </summary>
OECF = 34856,
/// <summary>
/// The version of the supported Exif standard. (Hex: 0x9000)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exifversion.html
/// </summary>
ExifVersion = 36864,
/// <summary>
/// The date and time when the original image data was generated. (Hex: 0x9003)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/datetimeoriginal.html
/// </summary>
DateTimeOriginal = 36867,
/// <summary>
/// The date and time when the image was stored as digital data. (Hex: 0x9004)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/datetimedigitized.html
/// </summary>
DateTimeDigitized = 36868,
/// <summary>
/// Specific to compressed data; specifies the channels and complements PhotometricInterpretation (Hex: 0x9101)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/componentsconfiguration.html
/// </summary>
ComponentsConfiguration = 37121,
/// <summary>
/// Specific to compressed data; states the compressed bits per pixel. (Hex: 0x9102)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/compressedbitsperpixel.html
/// </summary>
CompressedBitsPerPixel = 37122,
/// <summary>
/// Shutter speed. (Hex: 0x9201)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/shutterspeedvalue.html
/// </summary>
ShutterSpeedValue = 37377,
/// <summary>
/// The lens aperture. (Hex: 0x9202)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/aperturevalue.html
/// </summary>
ApertureValue = 37378,
/// <summary>
/// The value of brightness. (Hex: 0x9203)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/brightnessvalue.html
/// </summary>
BrightnessValue = 37379,
/// <summary>
/// The exposure bias. (Hex: 0x9204)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposurebiasvalue.html
/// </summary>
ExposureBiasValue = 37380,
/// <summary>
/// The smallest F number of the lens. (Hex: 0x9205)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/maxaperturevalue.html
/// </summary>
MaxApertureValue = 37381,
/// <summary>
/// The distance to the subject, given in meters. (Hex: 0x9206)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subjectdistance.html
/// </summary>
SubjectDistance = 37382,
/// <summary>
/// The metering mode. (Hex: 0x9207)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/meteringmode.html
/// </summary>
MeteringMode = 37383,
/// <summary>
/// The kind of light source. (Hex: 0x9208)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/lightsource.html
/// </summary>
LightSource = 37384,
/// <summary>
/// Indicates the status of flash when the image was shot. (Hex: 0x9209)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/flash.html
/// </summary>
Flash = 37385,
/// <summary>
/// The actual focal length of the lens, in mm. (Hex: 0x920A)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focallength.html
/// </summary>
FocalLength = 37386,
/// <summary>
/// Indicates the location and area of the main subject in the overall scene. (Hex: 0x9214)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subjectarea.html
/// </summary>
SubjectArea = 37396,
/// <summary>
/// Manufacturer specific information. (Hex: 0x927C)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/makernote.html
/// </summary>
MakerNote = 37500,
/// <summary>
/// Keywords or comments on the image; complements ImageDescription. (Hex: 0x9286)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/usercomment.html
/// </summary>
UserComment = 37510,
/// <summary>
/// A tag used to record fractions of seconds for the DateTime tag. (Hex: 0x9290)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subsectime.html
/// </summary>
SubsecTime = 37520,
/// <summary>
/// A tag used to record fractions of seconds for the DateTimeOriginal tag. (Hex: 0x9291)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subsectimeoriginal.html
/// </summary>
SubsecTimeOriginal = 37521,
/// <summary>
/// A tag used to record fractions of seconds for the DateTimeDigitized tag. (Hex: 0x9292)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subsectimedigitized.html
/// </summary>
SubsecTimeDigitized = 37522,
/// <summary>
/// The Flashpix format version supported by a FPXR file. (Hex: 0xA000)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/flashpixversion.html
/// </summary>
FlashpixVersion = 40960,
/// <summary>
/// The color space information tag is always recorded as the color space specifier. (Hex: 0xA001)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/colorspace.html
/// </summary>
ColorSpace = 40961,
/// <summary>
/// Specific to compressed data; the valid width of the meaningful image. (Hex: 0xA002)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/pixelxdimension.html
/// </summary>
PixelXDimension = 40962,
/// <summary>
/// Specific to compressed data; the valid height of the meaningful image. (Hex: 0xA003)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/pixelydimension.html
/// </summary>
PixelYDimension = 40963,
/// <summary>
/// Used to record the name of an audio file related to the image data. (Hex: 0xA004)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/relatedsoundfile.html
/// </summary>
RelatedSoundFile = 40964,
/// <summary>
/// Indicates the strobe energy at the time the image is captured, as measured in Beam Candle Power Seconds (Hex: 0xA20B)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/flashenergy.html
/// </summary>
FlashEnergy = 41483,
/// <summary>
/// Records the camera or input device spatial frequency table and SFR values in the direction of image width, image height, and diagonal direction, as specified in ISO 12233. (Hex: 0xA20C)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/spatialfrequencyresponse.html
/// </summary>
SpatialFrequencyResponse = 41484,
/// <summary>
/// Indicates the number of pixels in the image width (X) direction per FocalPlaneResolutionUnit on the camera focal plane. (Hex: 0xA20E)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focalplanexresolution.html
/// </summary>
FocalPlaneXResolution = 41486,
/// <summary>
/// Indicates the number of pixels in the image height (Y) direction per FocalPlaneResolutionUnit on the camera focal plane. (Hex: 0xA20F)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focalplaneyresolution.html
/// </summary>
FocalPlaneYResolution = 41487,
/// <summary>
/// Indicates the unit for measuring FocalPlaneXResolution and FocalPlaneYResolution. (Hex: 0xA210)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focalplaneresolutionunit.html
/// </summary>
FocalPlaneResolutionUnit = 41488,
/// <summary>
/// Indicates the location of the main subject in the scene. (Hex: 0xA214)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subjectlocation.html
/// </summary>
SubjectLocation = 41492,
/// <summary>
/// Indicates the exposure index selected on the camera or input device at the time the image is captured. (Hex: 0xA215)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposureindex.html
/// </summary>
ExposureIndex = 41493,
/// <summary>
/// Indicates the image sensor type on the camera or input device. (Hex: 0xA217)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/sensingmethod.html
/// </summary>
SensingMethod = 41495,
/// <summary>
/// Indicates the image source. (Hex: 0xA300)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/filesource.html
/// </summary>
FileSource = 41728,
/// <summary>
/// Indicates the type of scene. (Hex: 0xA301)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/scenetype.html
/// </summary>
SceneType = 41729,
/// <summary>
/// Indicates the color filter array (CFA) geometric pattern of the image sensor when a one-chip color area sensor is used. (Hex: 0xA302)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/cfapattern.html
/// </summary>
CFAPattern2 = 41730,
/// <summary>
/// Indicates the use of special processing on image data, such as rendering geared to output. (Hex: 0xA401)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/customrendered.html
/// </summary>
CustomRendered = 41985,
/// <summary>
/// Indicates the exposure mode set when the image was shot. (Hex: 0xA402)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposuremode.html
/// </summary>
ExposureMode = 41986,
/// <summary>
/// Indicates the white balance mode set when the image was shot. (Hex: 0xA403)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/whitebalance.html
/// </summary>
WhiteBalance = 41987,
/// <summary>
/// Indicates the digital zoom ratio when the image was shot. (Hex: 0xA404)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/digitalzoomratio.html
/// </summary>
DigitalZoomRatio = 41988,
/// <summary>
/// Indicates the equivalent focal length assuming a 35mm film camera, in mm. (Hex: 0xA405)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focallengthin35mmfilm.html
/// </summary>
FocalLengthIn35mmFilm = 41989,
/// <summary>
/// Indicates the type of scene that was shot. (Hex: 0xA406)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/scenecapturetype.html
/// </summary>
SceneCaptureType = 41990,
/// <summary>
/// Indicates the degree of overall image gain adjustment. (Hex: 0xA407)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/gaincontrol.html
/// </summary>
GainControl = 41991,
/// <summary>
/// Indicates the direction of contrast processing applied by the camera when the image was shot. (Hex: 0xA408)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/contrast.html
/// </summary>
Contrast = 41992,
/// <summary>
/// Indicates the direction of saturation processing applied by the camera when the image was shot. (Hex: 0xA409)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/saturation.html
/// </summary>
Saturation = 41993,
/// <summary>
/// Indicates the direction of sharpness processing applied by the camera when the image was shot. (Hex: 0xA40A)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/sharpness.html
/// </summary>
Sharpness = 41994,
/// <summary>
/// This tag indicates information on the picture-taking conditions of a particular camera model. (Hex: 0xA40B)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/devicesettingdescription.html
/// </summary>
DeviceSettingDescription = 41995,
/// <summary>
/// Indicates the distance to the subject. (Hex: 0xA40C)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subjectdistancerange.html
/// </summary>
SubjectDistanceRange = 41996,
/// <summary>
/// Indicates an identifier assigned uniquely to each image. (Hex: 0xA420)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/imageuniqueid.html
/// </summary>
ImageUniqueID = 42016,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 79dbe651dcd2a7056921086e1ea2b2c7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+222
View File
@@ -0,0 +1,222 @@
//
// GPSEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009-2010 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Entry tags occuring in the GPS IFD
/// The complete overview can be obtained at:
/// http://www.awaresystems.be/imaging/tiff.html
/// </summary>
public enum GPSEntryTag : ushort
{
/// <summary>
/// Indicates the version of GPSInfoIFD. (Hex: 0x0000)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsversionid.html
/// </summary>
GPSVersionID = 0,
/// <summary>
/// Indicates whether the latitude is north or south latitude. (Hex: 0x0001)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpslatituderef.html
/// </summary>
GPSLatitudeRef = 1,
/// <summary>
/// Indicates the latitude. (Hex: 0x0002)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpslatitude.html
/// </summary>
GPSLatitude = 2,
/// <summary>
/// Indicates whether the longitude is east or west longitude. (Hex: 0x0003)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpslongituderef.html
/// </summary>
GPSLongitudeRef = 3,
/// <summary>
/// Indicates the longitude. (Hex: 0x0004)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpslongitude.html
/// </summary>
GPSLongitude = 4,
/// <summary>
/// Indicates the altitude used as the reference altitude. (Hex: 0x0005)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsaltituderef.html
/// </summary>
GPSAltitudeRef = 5,
/// <summary>
/// Indicates the altitude based on the reference in GPSAltitudeRef. (Hex: 0x0006)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsaltitude.html
/// </summary>
GPSAltitude = 6,
/// <summary>
/// Indicates the time as UTC (Coordinated Universal Time). (Hex: 0x0007)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpstimestamp.html
/// </summary>
GPSTimeStamp = 7,
/// <summary>
/// Indicates the GPS satellites used for measurements. (Hex: 0x0008)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpssatellites.html
/// </summary>
GPSSatellites = 8,
/// <summary>
/// Indicates the status of the GPS receiver when the image is recorded. (Hex: 0x0009)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsstatus.html
/// </summary>
GPSStatus = 9,
/// <summary>
/// Indicates the GPS measurement mode. (Hex: 0x000A)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsmeasuremode.html
/// </summary>
GPSMeasureMode = 10,
/// <summary>
/// Indicates the GPS DOP (data degree of precision). (Hex: 0x000B)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdop.html
/// </summary>
GPSDOP = 11,
/// <summary>
/// Indicates the unit used to express the GPS receiver speed of movement. (Hex: 0x000C)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsspeedref.html
/// </summary>
GPSSpeedRef = 12,
/// <summary>
/// Indicates the speed of GPS receiver movement. (Hex: 0x000D)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsspeed.html
/// </summary>
GPSSpeed = 13,
/// <summary>
/// Indicates the reference for giving the direction of GPS receiver movement. (Hex: 0x000E)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpstrackref.html
/// </summary>
GPSTrackRef = 14,
/// <summary>
/// Indicates the direction of GPS receiver movement. (Hex: 0x000F)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpstrack.html
/// </summary>
GPSTrack = 15,
/// <summary>
/// Indicates the reference for giving the direction of the image when it is captured. (Hex: 0x0010)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsimgdirectionref.html
/// </summary>
GPSImgDirectionRef = 16,
/// <summary>
/// Indicates the direction of the image when it was captured. (Hex: 0x0011)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsimgdirection.html
/// </summary>
GPSImgDirection = 17,
/// <summary>
/// Indicates the geodetic survey data used by the GPS receiver. (Hex: 0x0012)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsmapdatum.html
/// </summary>
GPSMapDatum = 18,
/// <summary>
/// Indicates whether the latitude of the destination point is north or south latitude. (Hex: 0x0013)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestlatituderef.html
/// </summary>
GPSDestLatitudeRef = 19,
/// <summary>
/// Indicates the latitude of the destination point. (Hex: 0x0014)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestlatitude.html
/// </summary>
GPSDestLatitude = 20,
/// <summary>
/// Indicates whether the longitude of the destination point is east or west longitude. (Hex: 0x0015)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestlongituderef.html
/// </summary>
GPSDestLongitudeRef = 21,
/// <summary>
/// Indicates the longitude of the destination point. (Hex: 0x0016)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestlongitude.html
/// </summary>
GPSDestLongitude = 22,
/// <summary>
/// Indicates the reference used for giving the bearing to the destination point. (Hex: 0x0017)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestbearingref.html
/// </summary>
GPSDestBearingRef = 23,
/// <summary>
/// Indicates the bearing to the destination point. (Hex: 0x0018)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestbearing.html
/// </summary>
GPSDestBearing = 24,
/// <summary>
/// Indicates the unit used to express the distance to the destination point. (Hex: 0x0019)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestdistanceref.html
/// </summary>
GPSDestDistanceRef = 25,
/// <summary>
/// Indicates the distance to the destination point. (Hex: 0x001A)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestdistance.html
/// </summary>
GPSDestDistance = 26,
/// <summary>
/// A character string recording the name of the method used for location finding. (Hex: 0x001B)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsprocessingmethod.html
/// </summary>
GPSProcessingMethod = 27,
/// <summary>
/// A character string recording the name of the GPS area. (Hex: 0x001C)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsareainformation.html
/// </summary>
GPSAreaInformation = 28,
/// <summary>
/// A character string recording date and time information relative to UTC (Coordinated Universal Time). (Hex: 0x001D)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdatestamp.html
/// </summary>
GPSDateStamp = 29,
/// <summary>
/// Indicates whether differential correction is applied to the GPS receiver. (Hex: 0x001E)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdifferential.html
/// </summary>
GPSDifferential = 30,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6f2a9cc17e0fc5d98b55eab7ec407fe5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4f3c87f0431d9d572af45dc7245e2ea9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,61 @@
//
// IOPEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009-2010 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Entry tags occuring in the Interoperability IFD
/// The complete overview can be obtained at:
/// http://www.awaresystems.be/imaging/tiff.html
/// </summary>
public enum IOPEntryTag : ushort
{
/// <summary>
/// Indicates the identification of the Interoperability rule. (Hex: 0x0001)
/// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/interoperability/interoperabilityindex.html
/// </summary>
InteroperabilityIndex = 1,
/// <summary>
/// Interoperability version. (Hex: 0x0002)
/// </summary>
InteroperabilityVersion = 2,
/// <summary>
/// File format of image file. (Hex: 0x1000)
/// </summary>
RelatedImageFileFormat = 4096,
/// <summary>
/// Image Width. (Hex: 0x1001)
/// </summary>
RelatedImageWidth = 4097,
/// <summary>
/// Image Height. (Hex: 0x1002)
/// </summary>
RelatedImageLength = 4098,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 982fc4355a9d7a8ec853fde30ef0a93b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,473 @@
//
// Nikon3MakerNoteEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Nikon format 3 makernote tags.
/// Based on http://www.exiv2.org/tags-nikon.html and
/// http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
/// </summary>
public enum Nikon3MakerNoteEntryTag : ushort
{
/// <summary>
/// Makernote version. (Hex: 0x0001)
/// </summary>
Version = 1,
/// <summary>
/// ISO speed setting. (Hex: 0X0002)
/// </summary>
ISOSpeed = 2,
/// <summary>
/// Color mode. (Hex: 0X0003)
/// </summary>
ColorMode = 3,
/// <summary>
/// Image quality setting. (Hex: 0X0004)
/// </summary>
Quality = 4,
/// <summary>
/// White balance. (Hex: 0X0005)
/// </summary>
WhiteBalance = 5,
/// <summary>
/// Image sharpening setting. (Hex: 0X0006)
/// </summary>
Sharpening = 6,
/// <summary>
/// Focus mode. (Hex: 0X0007)
/// </summary>
Focus = 7,
/// <summary>
/// Flash setting. (Hex: 0X0008)
/// </summary>
FlashSetting = 8,
/// <summary>
/// Flash device. (Hex: 0X0009)
/// </summary>
FlashDevice = 9,
/// <summary>
/// Unknown. (Hex: 0X000A)
/// </summary>
Unknown10 = 10,
/// <summary>
/// White balance bias. (Hex: 0X000B)
/// </summary>
WhiteBalanceBias = 11,
/// <summary>
/// WB RB levels. (Hex: 0X000C)
/// </summary>
WB_RBLevels = 12,
/// <summary>
/// Program shift. (Hex: 0X000D)
/// </summary>
ProgramShift = 13,
/// <summary>
/// Exposure difference. (Hex: 0X000E)
/// </summary>
ExposureDiff = 14,
/// <summary>
/// ISO selection. (Hex: 0X000F)
/// </summary>
ISOSelection = 15,
/// <summary>
/// Data dump. (Hex: 0X0010)
/// </summary>
DataDump = 16,
/// <summary>
/// Offset to an IFD containing a preview image. (Hex: 0x0011)
/// </summary>
Preview = 17,
/// <summary>
/// Flash compensation setting. (Hex: 0X0012)
/// </summary>
FlashComp = 18,
/// <summary>
/// ISO setting. (Hex: 0X0013)
/// </summary>
ISOSettings = 19,
/// <summary>
/// Image boundary. (Hex: 0X0016)
/// </summary>
ImageBoundary = 22,
/// <summary>
/// Unknown. (Hex: 0X0017)
/// </summary>
Unknown23 = 23,
/// <summary>
/// Flash bracket compensation applied. (Hex: 0X0018)
/// </summary>
FlashBracketComp = 24,
/// <summary>
/// AE bracket compensation applied. (Hex: 0X0019)
/// </summary>
ExposureBracketComp = 25,
/// <summary>
/// Image processing. (Hex: 0X001A)
/// </summary>
ImageProcessing = 26,
/// <summary>
/// Crop high speed. (Hex: 0X001B)
/// </summary>
CropHiSpeed = 27,
/// <summary>
/// Serial Number. (Hex: 0X001D)
/// </summary>
SerialNumber = 29,
/// <summary>
/// Color space. (Hex: 0X001E)
/// </summary>
ColorSpace = 30,
/// <summary>
/// VR info. (Hex: 0X001F)
/// </summary>
VRInfo = 31,
/// <summary>
/// Image authentication. (Hex: 0X0020)
/// </summary>
ImageAuthentication = 32,
/// <summary>
/// ActiveD-lighting. (Hex: 0X0022)
/// </summary>
ActiveDLighting = 34,
/// <summary>
/// Picture control. (Hex: 0X0023)
/// </summary>
PictureControl = 35,
/// <summary>
/// World time. (Hex: 0X0024)
/// </summary>
WorldTime = 36,
/// <summary>
/// ISO info. (Hex: 0X0025)
/// </summary>
ISOInfo = 37,
/// <summary>
/// Vignette control. (Hex: 0X002A)
/// </summary>
VignetteControl = 42,
/// <summary>
/// Image adjustment setting. (Hex: 0X0080)
/// </summary>
ImageAdjustment = 128,
/// <summary>
/// Tone compensation. (Hex: 0X0081)
/// </summary>
ToneComp = 129,
/// <summary>
/// Auxiliary lens (adapter). (Hex: 0X0082)
/// </summary>
AuxiliaryLens = 130,
/// <summary>
/// Lens type. (Hex: 0X0083)
/// </summary>
LensType = 131,
/// <summary>
/// Lens. (Hex: 0X0084)
/// </summary>
Lens = 132,
/// <summary>
/// Manual focus distance. (Hex: 0X0085)
/// </summary>
FocusDistance = 133,
/// <summary>
/// Digital zoom setting. (Hex: 0X0086)
/// </summary>
DigitalZoom = 134,
/// <summary>
/// Mode of flash used. (Hex: 0X0087)
/// </summary>
FlashMode = 135,
/// <summary>
/// AF info. (Hex: 0X0088)
/// </summary>
AFInfo = 136,
/// <summary>
/// Shooting mode. (Hex: 0X0089)
/// </summary>
ShootingMode = 137,
/// <summary>
/// Auto bracket release. (Hex: 0X008A)
/// </summary>
AutoBracketRelease = 138,
/// <summary>
/// Lens FStops. (Hex: 0X008B)
/// </summary>
LensFStops = 139,
/// <summary>
/// Contrast curve. (Hex: 0X008C)
/// </summary>
ContrastCurve = 140,
/// <summary>
/// Color hue. (Hex: 0X008D)
/// </summary>
ColorHue = 141,
/// <summary>
/// Scene mode. (Hex: 0X008F)
/// </summary>
SceneMode = 143,
/// <summary>
/// Light source. (Hex: 0X0090)
/// </summary>
LightSource = 144,
/// <summary>
/// Shot info. (Hex: 0X0091)
/// </summary>
ShotInfo = 145,
/// <summary>
/// Hue adjustment. (Hex: 0X0092)
/// </summary>
HueAdjustment = 146,
/// <summary>
/// NEF compression. (Hex: 0X0093)
/// </summary>
NEFCompression = 147,
/// <summary>
/// Saturation. (Hex: 0X0094)
/// </summary>
Saturation = 148,
/// <summary>
/// Noise reduction. (Hex: 0X0095)
/// </summary>
NoiseReduction = 149,
/// <summary>
/// Linearization table. (Hex: 0X0096)
/// </summary>
LinearizationTable = 150,
/// <summary>
/// Color balance. (Hex: 0X0097)
/// </summary>
ColorBalance = 151,
/// <summary>
/// Lens data settings. (Hex: 0X0098)
/// </summary>
LensData = 152,
/// <summary>
/// Raw image center. (Hex: 0X0099)
/// </summary>
RawImageCenter = 153,
/// <summary>
/// Sensor pixel size. (Hex: 0X009A)
/// </summary>
SensorPixelSize = 154,
/// <summary>
/// Unknown. (Hex: 0X009B)
/// </summary>
Unknown155 = 155,
/// <summary>
/// Scene assist. (Hex: 0X009C)
/// </summary>
SceneAssist = 156,
/// <summary>
/// Retouch history. (Hex: 0X009E)
/// </summary>
RetouchHistory = 158,
/// <summary>
/// Unknown. (Hex: 0X009F)
/// </summary>
Unknown159 = 159,
/// <summary>
/// Camera serial number, usually starts with "NO= ". (Hex: 0X00A0)
/// </summary>
SerialNO = 160,
/// <summary>
/// Image data size. (Hex: 0X00A2)
/// </summary>
ImageDataSize = 162,
/// <summary>
/// Unknown. (Hex: 0X00A3)
/// </summary>
Unknown163 = 163,
/// <summary>
/// Image count. (Hex: 0X00A5)
/// </summary>
ImageCount = 165,
/// <summary>
/// Deleted image count. (Hex: 0X00A6)
/// </summary>
DeletedImageCount = 166,
/// <summary>
/// Number of shots taken by camera. (Hex: 0X00A7)
/// </summary>
ShutterCount = 167,
/// <summary>
/// Flash info. (Hex: 0X00A8)
/// </summary>
FlashInfo = 168,
/// <summary>
/// Image optimization. (Hex: 0X00A9)
/// </summary>
ImageOptimization = 169,
/// <summary>
/// Saturation. (Hex: 0X00AA)
/// </summary>
Saturation2 = 170,
/// <summary>
/// Program variation. (Hex: 0X00AB)
/// </summary>
VariProgram = 171,
/// <summary>
/// Image stabilization. (Hex: 0X00AC)
/// </summary>
ImageStabilization = 172,
/// <summary>
/// AF response. (Hex: 0X00AD)
/// </summary>
AFResponse = 173,
/// <summary>
/// Multi exposure. (Hex: 0X00B0)
/// </summary>
MultiExposure = 176,
/// <summary>
/// High ISO Noise Reduction. (Hex: 0X00B1)
/// </summary>
HighISONoiseReduction = 177,
/// <summary>
/// Toning effect. (Hex: 0X00B3)
/// </summary>
ToningEffect = 179,
/// <summary>
/// AF info 2. (Hex: 0X00B7)
/// </summary>
AFInfo2 = 183,
/// <summary>
/// File info. (Hex: 0X00B8)
/// </summary>
FileInfo = 184,
/// <summary>
/// PrintIM information. (Hex: 0X0E00)
/// </summary>
PrintIM = 3584,
/// <summary>
/// Capture data. (Hex: 0X0E01)
/// </summary>
CaptureData = 3585,
/// <summary>
/// Capture version. (Hex: 0X0E09)
/// </summary>
CaptureVersion = 3593,
/// <summary>
/// Capture offsets. (Hex: 0X0E0E)
/// </summary>
CaptureOffsets = 3598,
/// <summary>
/// Scan IFD. (Hex: 0X0E10)
/// </summary>
ScanIFD = 3600,
/// <summary>
/// ICC profile. (Hex: 0X0E1D)
/// </summary>
ICCProfile = 3613,
/// <summary>
/// Capture output. (Hex: 0X0E1E)
/// </summary>
CaptureOutput = 3614,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0ab76778a10fac15abcde769ad428f5f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,55 @@
//
// NikonIsoInfoEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Nikon Iso Info entry tags.
/// Based on:
/// http://exiv2.org/tags-nikon.html
/// </summary>
public enum NikonIsoInfoEntryTag : ushort
{
/// <summary>
/// ISO. (Hex: 0X0000)
/// </summary>
ISO = 0,
/// <summary>
/// ISO expansion. (Hex: 0X0004)
/// </summary>
ISOExpansion = 4,
/// <summary>
/// ISO 2. (Hex: 0X0006)
/// </summary>
ISO2 = 6,
/// <summary>
/// ISO expansion 2. (Hex: 0X000A)
/// </summary>
ISOExpansion2 = 10,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ebae761c8a89b27cbb512d7af6b28339
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,105 @@
//
// NikonLensData3EntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Nikon lens data entry tags.
/// Based on:
/// http://exiv2.org/tags-nikon.html
/// </summary>
public enum NikonLensData3EntryTag : ushort
{
/// <summary>
/// Version. (Hex: 0X0000)
/// </summary>
Version = 0,
/// <summary>
/// Exit pupil position. (Hex: 0X0004)
/// </summary>
ExitPupilPosition = 4,
/// <summary>
/// AF aperture. (Hex: 0X0005)
/// </summary>
AFAperture = 5,
/// <summary>
/// Focus position. (Hex: 0X0008)
/// </summary>
FocusPosition = 8,
/// <summary>
/// Focus distance. (Hex: 0X000A)
/// </summary>
FocusDistance = 10,
/// <summary>
/// Focal length. (Hex: 0X000B)
/// </summary>
FocalLength = 11,
/// <summary>
/// Lens ID number. (Hex: 0X000C)
/// </summary>
LensIDNumber = 12,
/// <summary>
/// Lens F-stops. (Hex: 0X000D)
/// </summary>
LensFStops = 13,
/// <summary>
/// Min focal length. (Hex: 0X000E)
/// </summary>
MinFocalLength = 14,
/// <summary>
/// Max focal length. (Hex: 0X000F)
/// </summary>
MaxFocalLength = 15,
/// <summary>
/// Max aperture at min focal length. (Hex: 0X0010)
/// </summary>
MaxApertureAtMinFocal = 16,
/// <summary>
/// Max aperture at max focal length. (Hex: 0X0011)
/// </summary>
MaxApertureAtMaxFocal = 17,
/// <summary>
/// MCU version. (Hex: 0X0012)
/// </summary>
MCUVersion = 18,
/// <summary>
/// Effective max aperture. (Hex: 0X0013)
/// </summary>
EffectiveMaxAperture = 19,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ca114fd626a2186f48689c1c1cea8f39
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,100 @@
//
// NikonPictureControlEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Nikon picture control entry tags.
/// Based on:
/// http://exiv2.org/tags-nikon.html
/// </summary>
public enum NikonPictureControlEntryTag : ushort
{
/// <summary>
/// Version. (Hex: 0X0000)
/// </summary>
Version = 0,
/// <summary>
/// Name. (Hex: 0X0004)
/// </summary>
Name = 4,
/// <summary>
/// Base. (Hex: 0X0018)
/// </summary>
Base = 24,
/// <summary>
/// Adjust. (Hex: 0X0030)
/// </summary>
Adjust = 48,
/// <summary>
/// Quick adjust. (Hex: 0X0031)
/// </summary>
QuickAdjust = 49,
/// <summary>
/// Sharpness. (Hex: 0X0032)
/// </summary>
Sharpness = 50,
/// <summary>
/// Contrast. (Hex: 0X0033)
/// </summary>
Contrast = 51,
/// <summary>
/// Brightness. (Hex: 0X0034)
/// </summary>
Brightness = 52,
/// <summary>
/// Saturation. (Hex: 0X0035)
/// </summary>
Saturation = 53,
/// <summary>
/// Hue adjustment. (Hex: 0X0036)
/// </summary>
HueAdjustment = 54,
/// <summary>
/// Filter effect. (Hex: 0X0037)
/// </summary>
FilterEffect = 55,
/// <summary>
/// Toning effect. (Hex: 0X0038)
/// </summary>
ToningEffect = 56,
/// <summary>
/// Toning saturation. (Hex: 0X0039)
/// </summary>
ToningSaturation = 57,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 364bc4e52f75161acba131c29573bca7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,80 @@
//
// NikonPreviewMakerNoteEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
// Mike Gemuende (mike@gemuende.de)
//
// Copyright (C) 2009-2010 Ruben Vermeersch
// Copyright (C) 2009 Mike Gemuende
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Nikon makernote preview image tags
/// The preview image is contained in a sub-IFD stored by the tag
/// Nikon3MakerNoteEntryTag.Preview.
/// Based on:
/// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#PreviewImage
/// </summary>
public enum NikonPreviewMakerNoteEntryTag : ushort
{
/// <summary>
/// Compression scheme used on the image data. (Hex: 0x0103)
/// http://www.awaresystems.be/imaging/tiff/tifftags/compression.html
/// </summary>
Compression = 259,
/// <summary>
/// The number of pixels per ResolutionUnit in the ImageWidth direction. (Hex: 0x011A)
/// http://www.awaresystems.be/imaging/tiff/tifftags/xresolution.html
/// </summary>
XResolution = 282,
/// <summary>
/// The number of pixels per ResolutionUnit in the ImageLength direction. (Hex: 0x011B)
/// http://www.awaresystems.be/imaging/tiff/tifftags/yresolution.html
/// </summary>
YResolution = 283,
/// <summary>
/// The unit of measurement for XResolution and YResolution. (Hex: 0x0128)
/// http://www.awaresystems.be/imaging/tiff/tifftags/resolutionunit.html
/// </summary>
ResolutionUnit = 296,
/// <summary>
/// Start of the preview image data. (Hex: 0x0201)
/// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#PreviewImage
/// </summary>
PreviewImageStart = 513,
/// <summary>
/// Length of the preview image data. (Hex: 0x0202)
/// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#PreviewImage
/// </summary>
PreviewImageLength = 514,
/// <summary>
/// Specifies the positioning of subsampled chrominance components relative to luminance samples. (Hex: 0x0213)
/// http://www.awaresystems.be/imaging/tiff/tifftags/ycbcrpositioning.html
/// </summary>
YCbCrPositioning = 531
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fcb7f1149da6a6ae29b481e57beca4d7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,80 @@
//
// NikonShotInfoEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Nikon shot info entry tags.
/// Based on:
/// http://exiv2.org/tags-nikon.html
/// </summary>
public enum NikonShotInfoEntryTag : ushort
{
/// <summary>
/// Version. (Hex: 0X0000)
/// </summary>
Version = 0,
/// <summary>
/// Shutter count 1. (Hex: 0X006A)
/// </summary>
ShutterCount1 = 106,
/// <summary>
/// Deleted image count. (Hex: 0X006E)
/// </summary>
DeletedImageCount = 110,
/// <summary>
/// Vibration reduction. (Hex: 0X0075)
/// </summary>
VibrationReduction = 117,
/// <summary>
/// . (Hex: 0X0082)
/// </summary>
VibrationReduction1 = 130,
/// <summary>
/// Shutter count 2. (Hex: 0X0157)
/// </summary>
ShutterCount2 = 343,
/// <summary>
/// Vibration reduction 2. (Hex: 0X01AE)
/// </summary>
VibrationReduction2 = 430,
/// <summary>
/// ISO. (Hex: 0X0256)
/// </summary>
ISO = 598,
/// <summary>
/// Shutter count. (Hex: 0X0276)
/// </summary>
ShutterCount = 630,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2d30137cf4584be70971e62ec124a79c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,45 @@
//
// NikonVibrationReductionEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Nikon vibration reduction entry tags.
/// Based on:
/// http://exiv2.org/tags-nikon.html
/// </summary>
public enum NikonVibrationReductionEntryTag : ushort
{
/// <summary>
/// Version. (Hex: 0X0000)
/// </summary>
Version = 0,
/// <summary>
/// Vibration reduction. (Hex: 0X0004)
/// </summary>
VibrationReduction = 4,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 277ea1683049e5c5f8ade1ec2fb0f65d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,50 @@
//
// NikonWorldTimeEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Nikon world time entry tags.
/// Based on:
/// http://exiv2.org/tags-nikon.html
/// </summary>
public enum NikonWorldTimeEntryTag : ushort
{
/// <summary>
/// Timezone. (Hex: 0X0000)
/// </summary>
Timezone = 0,
/// <summary>
/// Daylight savings. (Hex: 0X0002)
/// </summary>
DaylightSavings = 2,
/// <summary>
/// Date display format. (Hex: 0X0003)
/// </summary>
DateDisplayFormat = 3,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a574f148655294c22b84bb41c01e629b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,352 @@
//
// OlympusMakerNoteEntryTag.cs:
//
// Author:
// Ruben Vermeersch (ruben@savanne.be)
//
// Copyright (C) 2010 Ruben Vermeersch
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License version
// 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
namespace TagLib.IFD.Tags
{
/// <summary>
/// Olympus makernote tags.
/// Based on http://www.exiv2.org/tags-olympus.html
/// </summary>
public enum OlympusMakerNoteEntryTag : ushort
{
/// <summary>
/// Thumbnail image. (Hex: 0X0100)
/// </summary>
ThumbnailImage = 256,
/// <summary>
/// Picture taking mode. (Hex: 0X0200)
/// </summary>
SpecialMode = 512,
/// <summary>
/// Image quality setting. (Hex: 0X0201)
/// </summary>
Quality = 513,
/// <summary>
/// Macro mode. (Hex: 0X0202)
/// </summary>
Macro = 514,
/// <summary>
/// Black and white mode. (Hex: 0X0203)
/// </summary>
BWMode = 515,
/// <summary>
/// Digital zoom ratio. (Hex: 0X0204)
/// </summary>
DigitalZoom = 516,
/// <summary>
/// Focal plane diagonal. (Hex: 0X0205)
/// </summary>
FocalPlaneDiagonal = 517,
/// <summary>
/// Lens distortion parameters. (Hex: 0X0206)
/// </summary>
LensDistortionParams = 518,
/// <summary>
/// Software firmware version. (Hex: 0X0207)
/// </summary>
FirmwareVersion = 519,
/// <summary>
/// ASCII format data such as [PictureInfo]. (Hex: 0X0208)
/// </summary>
PictureInfo = 520,
/// <summary>
/// Camera ID data. (Hex: 0X0209)
/// </summary>
CameraID = 521,
/// <summary>
/// Pre-capture frames. (Hex: 0X0300)
/// </summary>
PreCaptureFrames = 768,
/// <summary>
/// One touch white balance. (Hex: 0X0302)
/// </summary>
OneTouchWB = 770,
/// <summary>
/// Serial number. (Hex: 0X0404)
/// </summary>
SerialNumber = 1028,
/// <summary>
/// PrintIM information. (Hex: 0X0E00)
/// </summary>
PrintIM = 3584,
/// <summary>
/// Various camera settings 1. (Hex: 0X0F00)
/// </summary>
DataDump1 = 3840,
/// <summary>
/// Various camera settings 2. (Hex: 0X0F01)
/// </summary>
DataDump2 = 3841,
/// <summary>
/// Shutter speed value. (Hex: 0X1000)
/// </summary>
ShutterSpeed = 4096,
/// <summary>
/// ISO speed value. (Hex: 0X1001)
/// </summary>
ISOSpeed = 4097,
/// <summary>
/// Aperture value. (Hex: 0X1002)
/// </summary>
ApertureValue = 4098,
/// <summary>
/// Brightness value. (Hex: 0X1003)
/// </summary>
Brightness = 4099,
/// <summary>
/// Flash mode. (Hex: 0X1004)
/// </summary>
FlashMode = 4100,
/// <summary>
/// Flash device. (Hex: 0X1005)
/// </summary>
FlashDevice = 4101,
/// <summary>
/// Exposure compensation value. (Hex: 0X1006)
/// </summary>
Bracket = 4102,
/// <summary>
/// Sensor temperature. (Hex: 0X1007)
/// </summary>
SensorTemperature = 4103,
/// <summary>
/// Lens temperature. (Hex: 0X1008)
/// </summary>
LensTemperature = 4104,
/// <summary>
/// Focus mode. (Hex: 0X100B)
/// </summary>
FocusMode = 4107,
/// <summary>
/// Manual focus distance. (Hex: 0X100C)
/// </summary>
FocusDistance = 4108,
/// <summary>
/// Zoom step count. (Hex: 0X100D)
/// </summary>
Zoom = 4109,
/// <summary>
/// Macro focus step count. (Hex: 0X100E)
/// </summary>
MacroFocus = 4110,
/// <summary>
/// Sharpness factor. (Hex: 0X100F)
/// </summary>
SharpnessFactor = 4111,
/// <summary>
/// Flash charge level. (Hex: 0X1010)
/// </summary>
FlashChargeLevel = 4112,
/// <summary>
/// Color matrix. (Hex: 0X1011)
/// </summary>
ColorMatrix = 4113,
/// <summary>
/// Black level. (Hex: 0X1012)
/// </summary>
BlackLevel = 4114,
/// <summary>
/// White balance mode. (Hex: 0X1015)
/// </summary>
WhiteBalance = 4117,
/// <summary>
/// Red balance. (Hex: 0X1017)
/// </summary>
RedBalance = 4119,
/// <summary>
/// Blue balance. (Hex: 0X1018)
/// </summary>
BlueBalance = 4120,
/// <summary>
/// Serial number 2. (Hex: 0X101A)
/// </summary>
SerialNumber2 = 4122,
/// <summary>
/// Flash exposure compensation. (Hex: 0X1023)
/// </summary>
FlashBias = 4131,
/// <summary>
/// External flash bounce. (Hex: 0X1026)
/// </summary>
ExternalFlashBounce = 4134,
/// <summary>
/// External flash zoom. (Hex: 0X1027)
/// </summary>
ExternalFlashZoom = 4135,
/// <summary>
/// External flash mode. (Hex: 0X1028)
/// </summary>
ExternalFlashMode = 4136,
/// <summary>
/// Contrast setting. (Hex: 0X1029)
/// </summary>
Contrast = 4137,
/// <summary>
/// Sharpness factor. (Hex: 0X102A)
/// </summary>
SharpnessFactor2 = 4138,
/// <summary>
/// Color control. (Hex: 0X102B)
/// </summary>
ColorControl = 4139,
/// <summary>
/// Valid bits. (Hex: 0X102C)
/// </summary>
ValidBits = 4140,
/// <summary>
/// Coring filter. (Hex: 0X102D)
/// </summary>
CoringFilter = 4141,
/// <summary>
/// Image width. (Hex: 0X102E)
/// </summary>
ImageWidth = 4142,
/// <summary>
/// Image height. (Hex: 0X102F)
/// </summary>
ImageHeight = 4143,
/// <summary>
/// Compression ratio. (Hex: 0X1034)
/// </summary>
CompressionRatio = 4148,
/// <summary>
/// Preview image embedded. (Hex: 0X1035)
/// </summary>
Thumbnail = 4149,
/// <summary>
/// Offset of the preview image. (Hex: 0X1036)
/// </summary>
ThumbnailOffset = 4150,
/// <summary>
/// Size of the preview image. (Hex: 0X1037)
/// </summary>
ThumbnailLength = 4151,
/// <summary>
/// CCD scan mode. (Hex: 0X1039)
/// </summary>
CCDScanMode = 4153,
/// <summary>
/// Noise reduction. (Hex: 0X103A)
/// </summary>
NoiseReduction = 4154,
/// <summary>
/// Infinity lens step. (Hex: 0X103B)
/// </summary>
InfinityLensStep = 4155,
/// <summary>
/// Near lens step. (Hex: 0X103C)
/// </summary>
NearLensStep = 4156,
/// <summary>
/// Camera equipment sub-IFD. (Hex: 0X2010)
/// </summary>
Equipment = 8208,
/// <summary>
/// Camera Settings sub-IFD. (Hex: 0X2020)
/// </summary>
CameraSettings = 8224,
/// <summary>
/// Raw development sub-IFD. (Hex: 0X2030)
/// </summary>
RawDevelopment = 8240,
/// <summary>
/// Raw development 2 sub-IFD. (Hex: 0X2031)
/// </summary>
RawDevelopment2 = 8241,
/// <summary>
/// Image processing sub-IFD. (Hex: 0X2040)
/// </summary>
ImageProcessing = 8256,
/// <summary>
/// Focus sub-IFD. (Hex: 0X2050)
/// </summary>
FocusInfo = 8272,
/// <summary>
/// Raw sub-IFD. (Hex: 0X3000)
/// </summary>
RawInfo = 12288,
}
}
Loaded 100 of 2025 files, more files were not shown because too many files have changed in this diff. Show more