using System;
using System.Collections;
using System.Text;
using com.drew.metadata;
using com.drew.lang;
using com.utils;
using System.Globalization;
///
/// This class was first written by Drew Noakes in Java.
///
/// This is public domain software - that is, you can do whatever you want
/// with it, and include it software that is licensed under the GNU or the
/// BSD license, or whatever other licence you choose, including proprietary
/// closed source licenses. I do ask that you leave this header in tact.
///
/// If you make modifications to this code that you think would benefit the
/// wider community, please send me a copy and I'll post it on my site.
///
/// If you make use of this code, Drew Noakes will appreciate hearing
/// about it: drew@drewnoakes.com
///
/// Latest Java version of this software kept at
/// http://drewnoakes.com/
///
/// The C# class was made by Ferret Renaud:
/// renaud91@free.fr
/// If you find a bug in the C# code, feel free to mail me.
///
namespace com.drew.metadata.exif
{
///
/// This class represents EXIF INTEROP marker note.
///
public class ExifInteropDirectory : Directory
{
public const int TAG_INTEROP_INDEX = 0x0001;
public const int TAG_INTEROP_VERSION = 0x0002;
public const int TAG_RELATED_IMAGE_FILE_FORMAT = 0x1000;
public const int TAG_RELATED_IMAGE_WIDTH = 0x1001;
public const int TAG_RELATED_IMAGE_LENGTH = 0x1002;
protected static readonly ResourceBundle BUNDLE = new ResourceBundle("ExifInteropMarkernote");
protected static readonly IDictionary tagNameMap = ExifInteropDirectory.InitTagMap();
///
/// Initialize the tag map.
///
/// the tag map
private static IDictionary InitTagMap()
{
// Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer,
// based on the Spanish culture (es-AR), where "I" is not the uppercase version of "i".
CultureInfo myCul = new CultureInfo( "es-AR" );
IDictionary resu = new Hashtable( new CaseInsensitiveHashCodeProvider( myCul ), new CaseInsensitiveComparer( myCul ));
//IDictionary resu = new Hashtable();
resu.Add(TAG_INTEROP_INDEX, BUNDLE["TAG_INTEROP_INDEX"]);
resu.Add(TAG_INTEROP_VERSION, BUNDLE["TAG_INTEROP_VERSION"]);
resu.Add(TAG_RELATED_IMAGE_FILE_FORMAT, BUNDLE["TAG_RELATED_IMAGE_FILE_FORMAT"]);
resu.Add(TAG_RELATED_IMAGE_WIDTH, BUNDLE["TAG_RELATED_IMAGE_WIDTH"]);
resu.Add(TAG_RELATED_IMAGE_LENGTH, BUNDLE["TAG_RELATED_IMAGE_LENGTH"]);
return resu;
}
///
/// Constructor of the object.
///
public ExifInteropDirectory() : base()
{
this.SetDescriptor(new ExifInteropDescriptor(this));
}
///
/// Provides the name of the directory, for display purposes. E.g. Exif
///
/// the name of the directory
public override string GetName()
{
return BUNDLE["MARKER_NOTE_NAME"];
}
///
/// Provides the map of tag names, hashed by tag type identifier.
///
/// the map of tag names
protected override IDictionary GetTagNameMap()
{
return tagNameMap;
}
}
}