pax_global_header 0000666 0000000 0000000 00000000064 14462226067 0014523 g ustar 00root root 0000000 0000000 52 comment=6d4c2fb50df13bc32a19ef83f3d8811e380cf4c9
quickroute-linux-upstream-2.5/ 0000775 0000000 0000000 00000000000 14462226067 0016557 5 ustar 00root root 0000000 0000000 quickroute-linux-upstream-2.5/.gitignore 0000664 0000000 0000000 00000000126 14462226067 0020546 0 ustar 00root root 0000000 0000000 *.pidb
*.resources
*.mdb
*.dll
*.dll.config
*~
bin
obj
/tmp.*
/QuickRoute.userprefs
quickroute-linux-upstream-2.5/3rdparty/ 0000775 0000000 0000000 00000000000 14462226067 0020327 5 ustar 00root root 0000000 0000000 quickroute-linux-upstream-2.5/3rdparty/ExifLibrary/ 0000775 0000000 0000000 00000000000 14462226067 0022547 5 ustar 00root root 0000000 0000000 quickroute-linux-upstream-2.5/3rdparty/ExifLibrary/BitConverterEx.cs 0000664 0000000 0000000 00000033344 14462226067 0026010 0 ustar 00root root 0000000 0000000 using System;
namespace ExifLibrary
{
///
/// An endian-aware converter for converting between base data types
/// and an array of bytes.
///
public class BitConverterEx
{
#region Public Enums
///
/// Represents the byte order.
///
public enum ByteOrder
{
LittleEndian = 1,
BigEndian = 2,
}
#endregion
#region Member Variables
private ByteOrder mFrom, mTo;
#endregion
#region Constructors
public BitConverterEx(ByteOrder from, ByteOrder to)
{
mFrom = from;
mTo = to;
}
#endregion
#region Properties
///
/// Indicates the byte order in which data is stored in this platform.
///
public static ByteOrder SystemByteOrder
{
get
{
return (BitConverter.IsLittleEndian ? ByteOrder.LittleEndian : ByteOrder.BigEndian);
}
}
#endregion
#region Predefined Values
///
/// Returns a bit converter that converts between little-endian and system byte-order.
///
public static BitConverterEx LittleEndian
{
get
{
return new BitConverterEx(ByteOrder.LittleEndian, BitConverterEx.SystemByteOrder);
}
}
///
/// Returns a bit converter that converts between big-endian and system byte-order.
///
public static BitConverterEx BigEndian
{
get
{
return new BitConverterEx(ByteOrder.BigEndian, BitConverterEx.SystemByteOrder);
}
}
///
/// Returns a bit converter that does not do any byte-order conversion.
///
public static BitConverterEx SystemEndian
{
get
{
return new BitConverterEx(BitConverterEx.SystemByteOrder, BitConverterEx.SystemByteOrder);
}
}
#endregion
#region Static Methods
///
/// Converts the given array of bytes to a Unicode character.
///
public static char ToChar(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
{
byte[] data = CheckData(value, startIndex, 2, from, to);
return BitConverter.ToChar(data, 0);
}
///
/// Converts the given array of bytes to a 16-bit unsigned integer.
///
public static ushort ToUInt16(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
{
byte[] data = CheckData(value, startIndex, 2, from, to);
return BitConverter.ToUInt16(data, 0);
}
///
/// Converts the given array of bytes to a 32-bit unsigned integer.
///
public static uint ToUInt32(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
{
byte[] data = CheckData(value, startIndex, 4, from, to);
return BitConverter.ToUInt32(data, 0);
}
///
/// Converts the given array of bytes to a 64-bit unsigned integer.
///
public static ulong ToUInt64(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
{
byte[] data = CheckData(value, startIndex, 8, from, to);
return BitConverter.ToUInt64(data, 0);
}
///
/// Converts the given array of bytes to a 16-bit signed integer.
///
public static short ToInt16(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
{
byte[] data = CheckData(value, startIndex, 2, from, to);
return BitConverter.ToInt16(data, 0);
}
///
/// Converts the given array of bytes to a 32-bit signed integer.
///
public static int ToInt32(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
{
byte[] data = CheckData(value, startIndex, 4, from, to);
return BitConverter.ToInt32(data, 0);
}
///
/// Converts the given array of bytes to a 64-bit signed integer.
///
public static long ToInt64(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
{
byte[] data = CheckData(value, startIndex, 8, from, to);
return BitConverter.ToInt64(data, 0);
}
///
/// Converts the given array of bytes to a single precision floating number.
///
public static float ToSingle(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
{
byte[] data = CheckData(value, startIndex, 4, from, to);
return BitConverter.ToSingle(data, 0);
}
///
/// Converts the given array of bytes to a double precision floating number.
///
public static double ToDouble(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
{
byte[] data = CheckData(value, startIndex, 8, from, to);
return BitConverter.ToDouble(data, 0);
}
///
/// Converts the given 16-bit unsigned integer to an array of bytes.
///
public static byte[] GetBytes(ushort value, ByteOrder from, ByteOrder to)
{
byte[] data = BitConverter.GetBytes(value);
data = CheckData(data, from, to);
return data;
}
///
/// Converts the given 32-bit unsigned integer to an array of bytes.
///
public static byte[] GetBytes(uint value, ByteOrder from, ByteOrder to)
{
byte[] data = BitConverter.GetBytes(value);
data = CheckData(data, from, to);
return data;
}
///
/// Converts the given 64-bit unsigned integer to an array of bytes.
///
public static byte[] GetBytes(ulong value, ByteOrder from, ByteOrder to)
{
byte[] data = BitConverter.GetBytes(value);
data = CheckData(data, from, to);
return data;
}
///
/// Converts the given 16-bit signed integer to an array of bytes.
///
public static byte[] GetBytes(short value, ByteOrder from, ByteOrder to)
{
byte[] data = BitConverter.GetBytes(value);
data = CheckData(data, from, to);
return data;
}
///
/// Converts the given 32-bit signed integer to an array of bytes.
///
public static byte[] GetBytes(int value, ByteOrder from, ByteOrder to)
{
byte[] data = BitConverter.GetBytes(value);
data = CheckData(data, from, to);
return data;
}
///
/// Converts the given 64-bit signed integer to an array of bytes.
///
public static byte[] GetBytes(long value, ByteOrder from, ByteOrder to)
{
byte[] data = BitConverter.GetBytes(value);
data = CheckData(data, from, to);
return data;
}
///
/// Converts the given single precision floating-point number to an array of bytes.
///
public static byte[] GetBytes(float value, ByteOrder from, ByteOrder to)
{
byte[] data = BitConverter.GetBytes(value);
data = CheckData(data, from, to);
return data;
}
///
/// Converts the given double precision floating-point number to an array of bytes.
///
public static byte[] GetBytes(double value, ByteOrder from, ByteOrder to)
{
byte[] data = BitConverter.GetBytes(value);
data = CheckData(data, from, to);
return data;
}
#endregion
#region Instance Methods
///
/// Converts the given array of bytes to a 16-bit unsigned integer.
///
public char ToChar(byte[] value, long startIndex)
{
return BitConverterEx.ToChar(value, startIndex, mFrom, mTo);
}
///
/// Converts the given array of bytes to a 16-bit unsigned integer.
///
public ushort ToUInt16(byte[] value, long startIndex)
{
return BitConverterEx.ToUInt16(value, startIndex, mFrom, mTo);
}
///
/// Converts the given array of bytes to a 32-bit unsigned integer.
///
public uint ToUInt32(byte[] value, long startIndex)
{
return BitConverterEx.ToUInt32(value, startIndex, mFrom, mTo);
}
///
/// Converts the given array of bytes to a 64-bit unsigned integer.
///
public ulong ToUInt64(byte[] value, long startIndex)
{
return BitConverterEx.ToUInt64(value, startIndex, mFrom, mTo);
}
///
/// Converts the given array of bytes to a 16-bit signed integer.
///
public short ToInt16(byte[] value, long startIndex)
{
return BitConverterEx.ToInt16(value, startIndex, mFrom, mTo);
}
///
/// Converts the given array of bytes to a 32-bit signed integer.
///
public int ToInt32(byte[] value, long startIndex)
{
return BitConverterEx.ToInt32(value, startIndex, mFrom, mTo);
}
///
/// Converts the given array of bytes to a 64-bit signed integer.
///
public long ToInt64(byte[] value, long startIndex)
{
return BitConverterEx.ToInt64(value, startIndex, mFrom, mTo);
}
///
/// Converts the given array of bytes to a single precision floating number.
///
public float ToSingle(byte[] value, long startIndex)
{
return BitConverterEx.ToSingle(value, startIndex, mFrom, mTo);
}
///
/// Converts the given array of bytes to a double precision floating number.
///
public double ToDouble(byte[] value, long startIndex)
{
return BitConverterEx.ToDouble(value, startIndex, mFrom, mTo);
}
///
/// Converts the given 16-bit unsigned integer to an array of bytes.
///
public byte[] GetBytes(ushort value)
{
return BitConverterEx.GetBytes(value, mFrom, mTo);
}
///
/// Converts the given 32-bit unsigned integer to an array of bytes.
///
public byte[] GetBytes(uint value)
{
return BitConverterEx.GetBytes(value, mFrom, mTo);
}
///
/// Converts the given 64-bit unsigned integer to an array of bytes.
///
public byte[] GetBytes(ulong value)
{
return BitConverterEx.GetBytes(value, mFrom, mTo);
}
///
/// Converts the given 16-bit signed integer to an array of bytes.
///
public byte[] GetBytes(short value)
{
return BitConverterEx.GetBytes(value, mFrom, mTo);
}
///
/// Converts the given 32-bit signed integer to an array of bytes.
///
public byte[] GetBytes(int value)
{
return BitConverterEx.GetBytes(value, mFrom, mTo);
}
///
/// Converts the given 64-bit signed integer to an array of bytes.
///
public byte[] GetBytes(long value)
{
return BitConverterEx.GetBytes(value, mFrom, mTo);
}
///
/// Converts the given single precision floating-point number to an array of bytes.
///
public byte[] GetBytes(float value)
{
return BitConverterEx.GetBytes(value, mFrom, mTo);
}
///
/// Converts the given double precision floating-point number to an array of bytes.
///
public byte[] GetBytes(double value)
{
return BitConverterEx.GetBytes(value, mFrom, mTo);
}
#endregion
#region Private Helpers
///
/// Reverse the array of bytes as needed.
///
private static byte[] CheckData(byte[] value, long startIndex, long length, ByteOrder from, ByteOrder to)
{
byte[] data = new byte[length];
Array.Copy(value, startIndex, data, 0, length);
if (from != to)
Array.Reverse(data);
return data;
}
///
/// Reverse the array of bytes as needed.
///
private static byte[] CheckData(byte[] value, ByteOrder from, ByteOrder to)
{
return CheckData(value, 0, value.Length, from, to);
}
#endregion
}
}
quickroute-linux-upstream-2.5/3rdparty/ExifLibrary/ExifBitConverter.cs 0000664 0000000 0000000 00000035165 14462226067 0026332 0 ustar 00root root 0000000 0000000 using System;
using System.Text;
namespace ExifLibrary
{
///
/// Converts between exif data types and array of bytes.
///
public class ExifBitConverter : BitConverterEx
{
#region Constructors
public ExifBitConverter(ByteOrder from, ByteOrder to)
: base(from, to)
{
;
}
#endregion
#region Static Methods
///
/// Returns an ASCII string converted from the given byte array.
///
public static string ToAscii(byte[] data, bool endatfirstnull, Encoding encoding)
{
int len = data.Length;
if (endatfirstnull)
{
len = Array.IndexOf(data, (byte)0);
if (len == -1) len = data.Length;
}
return encoding.GetString(data, 0, len);
}
///
/// Returns an ASCII string converted from the given byte array.
///
public static string ToAscii(byte[] data, Encoding encoding)
{
return ToAscii(data, true, encoding);
}
///
/// Returns a string converted from the given byte array.
/// from the numeric value of each byte.
///
public static string ToString(byte[] data)
{
StringBuilder sb = new StringBuilder();
foreach (byte b in data)
sb.Append(b);
return sb.ToString();
}
///
/// Returns a DateTime object converted from the given byte array.
///
public static DateTime ToDateTime(byte[] data, bool hastime)
{
string str = ToAscii(data, Encoding.ASCII);
string[] parts = str.Split(new char[] { ':', ' ' });
try
{
if (hastime && parts.Length == 6)
{
// yyyy:MM:dd HH:mm:ss
// This is the expected format though some cameras
// can use single digits. See Issue 21.
return new DateTime(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]), int.Parse(parts[4]), int.Parse(parts[5]));
}
else if (!hastime && parts.Length == 3)
{
// yyyy:MM:dd
return new DateTime(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]));
}
else
{
return DateTime.MinValue;
}
}
catch (ArgumentOutOfRangeException)
{
return DateTime.MinValue;
}
catch (ArgumentException)
{
return DateTime.MinValue;
}
}
///
/// Returns a DateTime object converted from the given byte array.
///
public static DateTime ToDateTime(byte[] data)
{
return ToDateTime(data, true);
}
///
/// Returns an unsigned rational number converted from the first
/// eight bytes of the given byte array. The first four bytes are
/// assumed to be the numerator and the next four bytes are the
/// denumerator.
/// Numbers are converted from the given byte-order to platform byte-order.
///
public static MathEx.UFraction32 ToURational(byte[] data, ByteOrder frombyteorder)
{
byte[] num = new byte[4];
byte[] den = new byte[4];
Array.Copy(data, 0, num, 0, 4);
Array.Copy(data, 4, den, 0, 4);
return new MathEx.UFraction32(ToUInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder), ToUInt32(den, 0, frombyteorder, BitConverterEx.SystemByteOrder));
}
///
/// Returns a signed rational number converted from the first
/// eight bytes of the given byte array. The first four bytes are
/// assumed to be the numerator and the next four bytes are the
/// denumerator.
/// Numbers are converted from the given byte-order to platform byte-order.
///
public static MathEx.Fraction32 ToSRational(byte[] data, ByteOrder frombyteorder)
{
byte[] num = new byte[4];
byte[] den = new byte[4];
Array.Copy(data, 0, num, 0, 4);
Array.Copy(data, 4, den, 0, 4);
return new MathEx.Fraction32(ToInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder), ToInt32(den, 0, frombyteorder, BitConverterEx.SystemByteOrder));
}
///
/// Returns an array of 16-bit unsigned integers converted from
/// the given byte array.
/// Numbers are converted from the given byte-order to platform byte-order.
///
public static ushort[] ToUShortArray(byte[] data, int count, ByteOrder frombyteorder)
{
ushort[] numbers = new ushort[count];
for (uint i = 0; i < count; i++)
{
byte[] num = new byte[2];
Array.Copy(data, i * 2, num, 0, 2);
numbers[i] = ToUInt16(num, 0, frombyteorder, BitConverterEx.SystemByteOrder);
}
return numbers;
}
///
/// Returns an array of 32-bit unsigned integers converted from
/// the given byte array.
/// Numbers are converted from the given byte-order to platform byte-order.
///
public static uint[] ToUIntArray(byte[] data, int count, ByteOrder frombyteorder)
{
uint[] numbers = new uint[count];
for (uint i = 0; i < count; i++)
{
byte[] num = new byte[4];
Array.Copy(data, i * 4, num, 0, 4);
numbers[i] = ToUInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder);
}
return numbers;
}
///
/// Returns an array of 32-bit signed integers converted from
/// the given byte array.
/// Numbers are converted from the given byte-order to platform byte-order.
///
public static int[] ToSIntArray(byte[] data, int count, ByteOrder byteorder)
{
int[] numbers = new int[count];
for (uint i = 0; i < count; i++)
{
byte[] num = new byte[4];
Array.Copy(data, i * 4, num, 0, 4);
numbers[i] = ToInt32(num, 0, byteorder, BitConverterEx.SystemByteOrder);
}
return numbers;
}
///
/// Returns an array of unsigned rational numbers converted from
/// the given byte array.
/// Numbers are converted from the given byte-order to platform byte-order.
///
public static MathEx.UFraction32[] ToURationalArray(byte[] data, int count, ByteOrder frombyteorder)
{
MathEx.UFraction32[] numbers = new MathEx.UFraction32[count];
for (uint i = 0; i < count; i++)
{
byte[] num = new byte[4];
byte[] den = new byte[4];
Array.Copy(data, i * 8, num, 0, 4);
Array.Copy(data, i * 8 + 4, den, 0, 4);
numbers[i].Set(ToUInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder), ToUInt32(den, 0, frombyteorder, BitConverterEx.SystemByteOrder));
}
return numbers;
}
///
/// Returns an array of signed rational numbers converted from
/// the given byte array.
/// Numbers are converted from the given byte-order to platform byte-order.
///
public static MathEx.Fraction32[] ToSRationalArray(byte[] data, int count, ByteOrder frombyteorder)
{
MathEx.Fraction32[] numbers = new MathEx.Fraction32[count];
for (uint i = 0; i < count; i++)
{
byte[] num = new byte[4];
byte[] den = new byte[4];
Array.Copy(data, i * 8, num, 0, 4);
Array.Copy(data, i * 8 + 4, den, 0, 4);
numbers[i].Set(ToInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder), ToInt32(den, 0, frombyteorder, BitConverterEx.SystemByteOrder));
}
return numbers;
}
///
/// Converts the given ascii string to an array of bytes optionally adding a null terminator.
///
public static byte[] GetBytes(string value, bool addnull, Encoding encoding)
{
if (addnull) value += '\0';
return encoding.GetBytes(value);
}
///
/// Converts the given ascii string to an array of bytes without adding a null terminator.
///
public static byte[] GetBytes(string value, Encoding encoding)
{
return GetBytes(value, false, encoding);
}
///
/// Converts the given datetime to an array of bytes with a null terminator.
///
public static byte[] GetBytes(DateTime value, bool hastime)
{
string str = "";
if (hastime)
str = value.ToString("yyyy:MM:dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
else
str = value.ToString("yyyy:MM:dd", System.Globalization.CultureInfo.InvariantCulture);
return GetBytes(str, true, Encoding.ASCII);
}
///
/// Converts the given unsigned rational number to an array of bytes.
/// Numbers are converted from the platform byte-order to the given byte-order.
///
public static byte[] GetBytes(MathEx.UFraction32 value, ByteOrder tobyteorder)
{
byte[] num = GetBytes(value.Numerator, BitConverterEx.SystemByteOrder, tobyteorder);
byte[] den = GetBytes(value.Denominator, BitConverterEx.SystemByteOrder, tobyteorder);
byte[] data = new byte[8];
Array.Copy(num, 0, data, 0, 4);
Array.Copy(den, 0, data, 4, 4);
return data;
}
///
/// Converts the given signed rational number to an array of bytes.
/// Numbers are converted from the platform byte-order to the given byte-order.
///
public static byte[] GetBytes(MathEx.Fraction32 value, ByteOrder tobyteorder)
{
byte[] num = GetBytes(value.Numerator, BitConverterEx.SystemByteOrder, tobyteorder);
byte[] den = GetBytes(value.Denominator, BitConverterEx.SystemByteOrder, tobyteorder);
byte[] data = new byte[8];
Array.Copy(num, 0, data, 0, 4);
Array.Copy(den, 0, data, 4, 4);
return data;
}
///
/// Converts the given array of 16-bit unsigned integers to an array of bytes.
/// Numbers are converted from the platform byte-order to the given byte-order.
///
public static byte[] GetBytes(ushort[] value, ByteOrder tobyteorder)
{
byte[] data = new byte[2 * value.Length];
for (int i = 0; i < value.Length; i++)
{
byte[] num = GetBytes(value[i], BitConverterEx.SystemByteOrder, tobyteorder);
Array.Copy(num, 0, data, i * 2, 2);
}
return data;
}
///
/// Converts the given array of 32-bit unsigned integers to an array of bytes.
/// Numbers are converted from the platform byte-order to the given byte-order.
///
public static byte[] GetBytes(uint[] value, ByteOrder tobyteorder)
{
byte[] data = new byte[4 * value.Length];
for (int i = 0; i < value.Length; i++)
{
byte[] num = GetBytes(value[i], BitConverterEx.SystemByteOrder, tobyteorder);
Array.Copy(num, 0, data, i * 4, 4);
}
return data;
}
///
/// Converts the given array of 32-bit signed integers to an array of bytes.
/// Numbers are converted from the platform byte-order to the given byte-order.
///
public static byte[] GetBytes(int[] value, ByteOrder tobyteorder)
{
byte[] data = new byte[4 * value.Length];
for (int i = 0; i < value.Length; i++)
{
byte[] num = GetBytes(value[i], BitConverterEx.SystemByteOrder, tobyteorder);
Array.Copy(num, 0, data, i * 4, 4);
}
return data;
}
///
/// Converts the given array of unsigned rationals to an array of bytes.
/// Numbers are converted from the platform byte-order to the given byte-order.
///
public static byte[] GetBytes(MathEx.UFraction32[] value, ByteOrder tobyteorder)
{
byte[] data = new byte[8 * value.Length];
for (int i = 0; i < value.Length; i++)
{
byte[] num = GetBytes(value[i].Numerator, BitConverterEx.SystemByteOrder, tobyteorder);
byte[] den = GetBytes(value[i].Denominator, BitConverterEx.SystemByteOrder, tobyteorder);
Array.Copy(num, 0, data, i * 8, 4);
Array.Copy(den, 0, data, i * 8 + 4, 4);
}
return data;
}
///
/// Converts the given array of signed rationals to an array of bytes.
/// Numbers are converted from the platform byte-order to the given byte-order.
///
public static byte[] GetBytes(MathEx.Fraction32[] value, ByteOrder tobyteorder)
{
byte[] data = new byte[8 * value.Length];
for (int i = 0; i < value.Length; i++)
{
byte[] num = GetBytes(value[i].Numerator, BitConverterEx.SystemByteOrder, tobyteorder);
byte[] den = GetBytes(value[i].Denominator, BitConverterEx.SystemByteOrder, tobyteorder);
Array.Copy(num, 0, data, i * 8, 4);
Array.Copy(den, 0, data, i * 8 + 4, 4);
}
return data;
}
#endregion
}
}
quickroute-linux-upstream-2.5/3rdparty/ExifLibrary/ExifEnums.cs 0000664 0000000 0000000 00000036454 14462226067 0025015 0 ustar 00root root 0000000 0000000 using System;
namespace ExifLibrary
{
///
/// Represents a general indication of the kind of data contained in this subfile.
///
[Flags]
public enum NewSubfileType : uint
{
///
/// This image is a reduced resolution version of another image in the file.
///
ReducedResolution = 1,
///
/// The image is a single page of a multi-page image.
///
MultiPage = 2,
///
/// This image defines a transparency mask for another image in this file.
///
TransparencyMask = 4,
///
/// The IFD containing this tag is Mixed Raster Content (MRC) specific.
///
MRCSpecific = 16
}
///
/// Represents a general indication of the kind of data contained in this subfile.
///
public enum SubfileType : ushort
{
///
/// This image is a full resolution image.
///
FullResolution = 1,
///
/// This image is a reduced resolution version of another image in the file.
///
ReducedResolution = 2,
///
/// The image is a single page of a multi-page image.
///
MultiPage = 3
}
///
/// Represenst the compression scheme used for the image data.
///
public enum Compression : ushort
{
///
/// No compression.
///
Uncompressed = 1,
///
/// CCITT modified Huffman RLE compression.
///
CCITT1D = 2,
///
/// CCITT Group 3 fax encoding.
///
Group3Fax = 3,
///
/// CCITT Group 4 fax encoding.
///
Group4Fax = 4,
///
/// LZW compression.
///
LZW = 5,
///
/// JPEG compression.
///
JPEG = 6,
///
/// PackBits compression, aka Macintosh RLE.
///
PackBits = 32773
}
///
/// Represents the pixel composition.
///
public enum PhotometricInterpretation : ushort
{
///
/// For bilevel and grayscale images: 0 is imaged as white.
///
WhiteIsZero = 0,
///
/// For bilevel and grayscale images: 0 is imaged as black.
///
BlackIsZero = 1,
///
/// RGB value of (0,0,0) represents black, and (255,255,255) represents white,
/// assuming 8-bit components. The components are stored in the indicated order:
/// first Red, then Green, then Blue.
///
RGB = 2,
///
/// Palette color. In this model, a color is described with a single component.
/// The value of the component is used as an index into the red, green and blue
/// curves in the ColorMap field to retrieve an RGB triplet that defines the color.
/// With a palette, ColorMap must be present and SamplesPerPixel must be 1.
///
RGBPalette = 3,
///
/// The image is used to define an irregularly shaped region of another image
/// in the same file. SamplesPerPixel and BitsPerSample must be 1.
/// PackBits compression is recommended. The 1-bits define the interior
/// of the region; the 0-bits define the exterior of the region.
///
TransparencyMask = 4,
///
/// Seperated, usually CMYK.
///
Seperated = 5,
///
/// YCbCr color space.
///
YCbCr = 6,
///
/// CIE (L*, a*, b*) color space.
///
CIELab = 8,
///
/// ICC (L*, a*, b*) color space.
///
ICCLab = 9,
///
/// ITU (L*, a*, b*) color space.
///
ITULab = 10,
///
/// Color Filter Array color space.
///
CFA = 32803,
///
/// Linear Raw color space.
///
LinearRaw = 34892,
///
/// Pixar LogL color space.
///
Pixar_LOGL = 32844,
///
/// Pixar LogLUV color space.
///
PixarLOGLUV = 32845
}
///
/// Represents the technique used to convert from gray to black and white pixels.
///
public enum Threshholding : ushort
{
///
/// No dithering or halftoning has been applied to the image data.
///
BiLevel = 1,
///
/// An ordered dither or halftone technique has been applied to the image data.
///
HalfTone = 2,
///
/// A randomized process such as error diffusion has been applied to the image data.
///
ErrorDiffuse = 3
}
///
/// Represents the logical order of bits within a byte.
///
public enum FillOrder : ushort
{
///
/// Pixels with lower column values are stored in the higher-order bits of the byte.
///
MSB2LSB = 1,
///
/// Pixels with lower column values are stored in the lower-order bits of the byte.
///
LSB2MSB = 2
}
///
/// Represents the image orientation.
///
public enum Orientation : ushort
{
///
/// The 0th row is at the visual top of the image, and the 0th column is the
/// visual left-hand side.
///
Normal = 1,
///
/// The 0th row is at the visual top of the image, and the 0th column is
/// the visual right-hand side.
///
MirroredVertically = 2,
///
/// The 0th row is at the visual bottom of the image, and the 0th column is
/// the visual right-hand side.
///
Rotated180 = 3,
///
/// The 0th row is at the visual bottom of the image, and the 0th column is
/// the visual left-hand side.
///
MirroredHorizontally = 4,
///
/// The 0th row is the visual left-hand side of the image, and the 0th column
/// is the visual top.
///
RotatedLeftAndMirroredVertically = 5,
///
/// The 0th row is the visual right-hand side of the image, and the 0th column
/// is the visual top.
///
RotatedRight = 6,
///
/// The 0th row is the visual right-hand side of the image, and the 0th column
/// is the visual bottom.
///
RotatedLeft = 7,
///
/// The 0th row is the visual left-hand side of the image, and the 0th column
/// is the visual bottom.
///
RotatedRightAndMirroredVertically = 8
}
///
/// Represents the recording format of pixel components.
///
public enum PlanarConfiguration : ushort
{
///
/// Pixels are recorded in chunky format.
///
ChunkyFormat = 1,
///
/// Pixels are recorded in planar format.
///
PlanarFormat = 2
}
///
/// Represents the precision of the information contained in the gray response curve.
///
public enum GrayResponseUnit : ushort
{
///
/// Number represents tenths of a unit.
///
Tenth = 1,
///
/// Number represents hundredths of a unit.
///
Hundreth = 2,
///
/// Number represents thousandths of a unit.
///
Thousandth = 3,
///
/// Number represents ten-thousandths of a unit.
///
TenThousandth = 4,
///
/// Number represents hundred-thousandths of a unit.
///
HundredThousandth = 5
}
///
/// Represents the options for Group 3 Fax compression.
///
[Flags]
public enum T4Options : uint
{
///
/// 2-dimensional coding (otherwise 1-dimensional is assumed).
///
TwoDimensionalEncoding = 1,
///
/// Uncompressed mode is used.
///
Uncompressed = 2,
///
/// Fill bits have been added before EOL codes such that EOL always
/// ends on a byte boundary.
///
FillBits = 4
}
///
/// Represents the options for Group 4 Fax compression.
///
[Flags]
public enum T6Options : uint
{
///
/// Uncompressed mode is used.
///
Uncompressed = 2
}
///
/// The unit for measuring XResolution and YResolution.
///
public enum ResolutionUnit : ushort
{
Inches = 2,
Centimeters = 3
}
public enum YCbCrPositioning : ushort
{
Centered = 1,
CoSited = 2
}
public enum ColorSpace : ushort
{
sRGB = 1,
Uncalibrated = 0xfff
}
public enum ExposureProgram : ushort
{
NotDefined = 0,
Manual = 1,
Normal = 2,
AperturePriority = 3,
ShutterPriority = 4,
///
/// Biased toward depth of field.
///
Creative = 5,
///
/// Biased toward fast shutter speed.
///
Action = 6,
///
/// For closeup photos with the background out of focus.
///
Portrait = 7,
///
/// For landscape photos with the background in focus.
///
Landscape = 8
}
public enum MeteringMode : ushort
{
Unknown = 0,
Average = 1,
CenterWeightedAverage = 2,
Spot = 3,
MultiSpot = 4,
Pattern = 5,
Partial = 6,
Other = 255
}
public enum LightSource : ushort
{
Unknown = 0,
Daylight = 1,
Fluorescent = 2,
Tungsten = 3,
Flash = 4,
FineWeather = 9,
CloudyWeather = 10,
Shade = 11,
///
/// D 5700 – 7100K
///
DaylightFluorescent = 12,
///
/// N 4600 – 5400K
///
DayWhiteFluorescent = 13,
///
/// W 3900 – 4500K
///
CoolWhiteFluorescent = 14,
///
/// WW 3200 – 3700K
///
WhiteFluorescent = 15,
StandardLightA = 17,
StandardLightB = 18,
StandardLightC = 19,
D55 = 20,
D65 = 21,
D75 = 22,
D50 = 23,
ISOStudioTungsten = 24,
OtherLightSource = 255
}
[Flags]
public enum Flash : ushort
{
FlashDidNotFire = 0,
StrobeReturnLightNotDetected = 4,
StrobeReturnLightDetected = 2,
FlashFired = 1,
CompulsoryFlashMode = 8,
AutoMode = 16,
NoFlashFunction = 32,
RedEyeReductionMode = 64
}
public enum SensingMethod : ushort
{
NotDefined = 1,
OneChipColorAreaSensor = 2,
TwoChipColorAreaSensor = 3,
ThreeChipColorAreaSensor = 4,
ColorSequentialAreaSensor = 5,
TriLinearSensor = 7,
ColorSequentialLinearSensor = 8
}
public enum FileSource : byte
{
// UNDEFINED
DSC = 3
}
public enum SceneType : byte
{
// UNDEFINED
DirectlyPhotographedImage = 1
}
public enum CustomRendered : ushort
{
NormalProcess = 0,
CustomProcess = 1
}
public enum ExposureMode : ushort
{
Auto = 0,
Manual = 1,
AutoBracket = 2
}
public enum WhiteBalance : ushort
{
Auto = 0,
Manual = 1
}
public enum SceneCaptureType : ushort
{
Standard = 0,
Landscape = 1,
Portrait = 2,
NightScene = 3
}
public enum GainControl : ushort
{
None = 0,
LowGainUp = 1,
HighGainUp = 2,
LowGainDown = 3,
HighGainDown = 4
}
public enum Contrast : ushort
{
Normal = 0,
Soft = 1,
Hard = 2
}
public enum Saturation : ushort
{
Normal = 0,
Low = 1,
High = 2
}
public enum Sharpness : ushort
{
Normal = 0,
Soft = 1,
Hard = 2
}
public enum SubjectDistanceRange : ushort
{
Unknown = 0,
Macro = 1,
CloseView = 2,
DistantView = 3
}
public enum GPSLatitudeRef : byte
{
// ASCII
North = 78,
// 'N'
South = 83
// 'S'
}
public enum GPSLongitudeRef : byte
{
// ASCII
West = 87,
// 'W'
East = 69
// 'E'
}
public enum GPSAltitudeRef : byte
{
AboveSeaLevel = 0,
BelowSeaLevel = 1
}
public enum GPSStatus : byte
{
// ASCII
MeasurementInProgress = 65,
// 'A'
MeasurementInteroperability = 86
// 'V'
}
public enum GPSMeasureMode : byte
{
// ASCII
TwoDimensional = 50,
// '2'
ThreeDimensional = 51
// '3'
}
public enum GPSSpeedRef : byte
{
// ASCII
KilometersPerHour = 75,
// 'K'
MilesPerHour = 77,
// 'M'
Knots = 78
// 'N'
}
public enum GPSDirectionRef : byte
{
// ASCII
TrueDirection = 84,
// 'T'
MagneticDirection = 77
// 'M'
}
public enum GPSDistanceRef : byte
{
// ASCII
Kilometers = 75,
// 'K'
Miles = 77,
// 'M'
Knots = 78
// 'N'
}
public enum GPSDifferential : ushort
{
MeasurementWithoutDifferentialCorrection = 0,
DifferentialCorrectionApplied = 1
}
}
quickroute-linux-upstream-2.5/3rdparty/ExifLibrary/ExifExceptions.cs 0000664 0000000 0000000 00000003545 14462226067 0026042 0 ustar 00root root 0000000 0000000 using System;
namespace ExifLibrary
{
///
/// The exception that is thrown when the format of the JPEG/Exif file
/// could not be understood.
///
public class NotValidExifFileException : Exception
{
public NotValidExifFileException()
: base("Not a valid JPEG/Exif file.")
{
;
}
public NotValidExifFileException(string message)
: base(message)
{
;
}
}
///
/// The exception that is thrown when the IFD section ID could not be understood.
///
public class UnknownIFDSectionException : Exception
{
public UnknownIFDSectionException()
: base("Unknown IFD section.")
{
;
}
public UnknownIFDSectionException(string message)
: base(message)
{
;
}
}
///
/// The exception that is thrown when an invalid enum type is given to an
/// ExifEnumProperty.
///
public class UnknownEnumTypeException : Exception
{
public UnknownEnumTypeException()
: base("Unknown enum type.")
{
;
}
public UnknownEnumTypeException(string message)
: base(message)
{
;
}
}
///
/// The exception that is thrown when the 0th IFD section does not contain any fields.
///
public class IFD0IsEmptyException : Exception
{
public IFD0IsEmptyException()
: base("0th IFD section cannot be empty.")
{
;
}
public IFD0IsEmptyException(string message)
: base(message)
{
;
}
}
}
quickroute-linux-upstream-2.5/3rdparty/ExifLibrary/ExifExtendedProperty.cs 0000664 0000000 0000000 00000034016 14462226067 0027223 0 ustar 00root root 0000000 0000000 using System;
using System.Text;
namespace ExifLibrary
{
///
/// Represents an enumerated value.
///
public class ExifEnumProperty : ExifProperty
{
protected T mValue;
protected bool mIsBitField;
protected override object _Value { get { return Value; } set { Value = (T)value; } }
public new T Value { get { return mValue; } set { mValue = value; } }
public bool IsBitField { get { return mIsBitField; } }
static public implicit operator T(ExifEnumProperty obj) { return (T)obj.mValue; }
public override string ToString() { return mValue.ToString(); }
public ExifEnumProperty(ExifTag tag, T value, bool isbitfield)
: base(tag)
{
mValue = value;
mIsBitField = isbitfield;
}
public ExifEnumProperty(ExifTag tag, T value)
: this(tag, value, false)
{
;
}
public override ExifInterOperability Interoperability
{
get
{
ushort tagid = ExifTagFactory.GetTagID(mTag);
Type type = typeof(T);
Type basetype = Enum.GetUnderlyingType(type);
if (type == typeof(FileSource) || type == typeof(SceneType))
{
// UNDEFINED
return new ExifInterOperability(tagid, 7, 1, new byte[] { (byte)((object)mValue) });
}
else if (type == typeof(GPSLatitudeRef) || type == typeof(GPSLongitudeRef) ||
type == typeof(GPSStatus) || type == typeof(GPSMeasureMode) ||
type == typeof(GPSSpeedRef) || type == typeof(GPSDirectionRef) ||
type == typeof(GPSDistanceRef))
{
// ASCII
return new ExifInterOperability(tagid, 2, 2, new byte[] { (byte)((object)mValue), 0 });
}
else if (basetype == typeof(byte))
{
// BYTE
return new ExifInterOperability(tagid, 1, 1, new byte[] { (byte)((object)mValue) });
}
else if (basetype == typeof(ushort))
{
// SHORT
return new ExifInterOperability(tagid, 3, 1, ExifBitConverter.GetBytes((ushort)((object)mValue), BitConverterEx.SystemByteOrder, BitConverterEx.SystemByteOrder));
}
else
throw new UnknownEnumTypeException();
}
}
}
///
/// Represents an ASCII string. (EXIF Specification: UNDEFINED) Used for the UserComment field.
///
public class ExifEncodedString : ExifProperty
{
protected string mValue;
private Encoding mEncoding;
protected override object _Value { get { return Value; } set { Value = (string)value; } }
public new string Value { get { return mValue; } set { mValue = value; } }
public Encoding Encoding { get { return mEncoding; } set { mEncoding = value; } }
static public implicit operator string(ExifEncodedString obj) { return obj.mValue; }
public override string ToString() { return mValue; }
public ExifEncodedString(ExifTag tag, string value, Encoding encoding)
: base(tag)
{
mValue = value;
mEncoding = encoding;
}
public override ExifInterOperability Interoperability
{
get
{
string enc = "";
if (mEncoding == null)
enc = "\0\0\0\0\0\0\0\0";
else if (mEncoding.EncodingName == "US-ASCII")
enc = "ASCII\0\0\0";
else if (mEncoding.EncodingName == "Japanese (JIS 0208-1990 and 0212-1990)")
enc = "JIS\0\0\0\0\0";
else if (mEncoding.EncodingName == "Unicode")
enc = "Unicode\0";
else
enc = "\0\0\0\0\0\0\0\0";
byte[] benc = Encoding.ASCII.GetBytes(enc);
byte[] bstr = (mEncoding == null ? Encoding.ASCII.GetBytes(mValue) : mEncoding.GetBytes(mValue));
byte[] data = new byte[benc.Length + bstr.Length];
Array.Copy(benc, 0, data, 0, benc.Length);
Array.Copy(bstr, 0, data, benc.Length, bstr.Length);
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, (uint)data.Length, data);
}
}
}
///
/// Represents an ASCII string formatted as DateTime. (EXIF Specification: ASCII) Used for the date time fields.
///
public class ExifDateTime : ExifProperty
{
protected DateTime mValue;
protected override object _Value { get { return Value; } set { Value = (DateTime)value; } }
public new DateTime Value { get { return mValue; } set { mValue = value; } }
static public implicit operator DateTime(ExifDateTime obj) { return obj.mValue; }
public override string ToString() { return mValue.ToString("yyyy.MM.dd HH:mm:ss"); }
public ExifDateTime(ExifTag tag, DateTime value)
: base(tag)
{
mValue = value;
}
public override ExifInterOperability Interoperability
{
get
{
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 2, (uint)20, ExifBitConverter.GetBytes(mValue, true));
}
}
}
///
/// Represents the exif version as a 4 byte ASCII string. (EXIF Specification: UNDEFINED)
/// Used for the ExifVersion, FlashpixVersion, InteroperabilityVersion and GPSVersionID fields.
///
public class ExifVersion : ExifProperty
{
protected string mValue;
protected override object _Value { get { return Value; } set { Value = (string)value; } }
public new string Value { get { return mValue; } set { mValue = value.Substring(0, 4); } }
public ExifVersion(ExifTag tag, string value)
: base(tag)
{
if (value.Length > 4)
mValue = value.Substring(0, 4);
else if (value.Length < 4)
mValue = value + new string(' ', 4 - value.Length);
else
mValue = value;
}
public override string ToString()
{
return mValue;
}
public override ExifInterOperability Interoperability
{
get
{
if (mTag == ExifTag.ExifVersion || mTag == ExifTag.FlashpixVersion || mTag == ExifTag.InteroperabilityVersion)
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, 4, Encoding.ASCII.GetBytes(mValue));
else
{
byte[] data = new byte[4];
for (int i = 0; i < 4; i++)
data[i] = byte.Parse(mValue[0].ToString());
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, 4, data);
}
}
}
}
///
/// Represents the location and area of the subject (EXIF Specification: 2xSHORT)
/// The coordinate values, width, and height are expressed in relation to the
/// upper left as origin, prior to rotation processing as per the Rotation tag.
///
public class ExifPointSubjectArea : ExifUShortArray
{
protected new ushort[] Value { get { return mValue; } set { mValue = value; } }
public ushort X { get { return mValue[0]; } set { mValue[0] = value; } }
public ushort Y { get { return mValue[1]; } set { mValue[1] = value; } }
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("({0:d}, {1:d})", mValue[0], mValue[1]);
return sb.ToString();
}
public ExifPointSubjectArea(ExifTag tag, ushort[] value)
: base(tag, value)
{
;
}
public ExifPointSubjectArea(ExifTag tag, ushort x, ushort y)
: base(tag, new ushort[] { x, y })
{
;
}
}
///
/// Represents the location and area of the subject (EXIF Specification: 3xSHORT)
/// The coordinate values, width, and height are expressed in relation to the
/// upper left as origin, prior to rotation processing as per the Rotation tag.
///
public class ExifCircularSubjectArea : ExifPointSubjectArea
{
public ushort Diamater { get { return mValue[2]; } set { mValue[2] = value; } }
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("({0:d}, {1:d}) {2:d}", mValue[0], mValue[1], mValue[2]);
return sb.ToString();
}
public ExifCircularSubjectArea(ExifTag tag, ushort[] value)
: base(tag, value)
{
;
}
public ExifCircularSubjectArea(ExifTag tag, ushort x, ushort y, ushort d)
: base(tag, new ushort[] { x, y, d })
{
;
}
}
///
/// Represents the location and area of the subject (EXIF Specification: 4xSHORT)
/// The coordinate values, width, and height are expressed in relation to the
/// upper left as origin, prior to rotation processing as per the Rotation tag.
///
public class ExifRectangularSubjectArea : ExifPointSubjectArea
{
public ushort Width { get { return mValue[2]; } set { mValue[2] = value; } }
public ushort Height { get { return mValue[3]; } set { mValue[3] = value; } }
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("({0:d}, {1:d}) ({2:d} x {3:d})", mValue[0], mValue[1], mValue[2], mValue[3]);
return sb.ToString();
}
public ExifRectangularSubjectArea(ExifTag tag, ushort[] value)
: base(tag, value)
{
;
}
public ExifRectangularSubjectArea(ExifTag tag, ushort x, ushort y, ushort w, ushort h)
: base(tag, new ushort[] { x, y, w, h })
{
;
}
}
///
/// Represents GPS latitudes and longitudes (EXIF Specification: 3xRATIONAL)
///
public class GPSLatitudeLongitude : ExifURationalArray
{
protected new MathEx.UFraction32[] Value { get { return mValue; } set { mValue = value; } }
public MathEx.UFraction32 Degrees { get { return mValue[0]; } set { mValue[0] = value; } }
public MathEx.UFraction32 Minutes { get { return mValue[1]; } set { mValue[1] = value; } }
public MathEx.UFraction32 Seconds { get { return mValue[2]; } set { mValue[2] = value; } }
public static explicit operator float(GPSLatitudeLongitude obj) { return obj.ToFloat(); }
public float ToFloat()
{
return (float)Degrees + ((float)Minutes) / 60.0f + ((float)Seconds) / 3600.0f;
}
public override string ToString()
{
return string.Format("{0:F2}°{1:F2}'{2:F2}\"", (float)Degrees, (float)Minutes, (float)Seconds);
}
public GPSLatitudeLongitude(ExifTag tag, MathEx.UFraction32[] value)
: base(tag, value)
{
;
}
public GPSLatitudeLongitude(ExifTag tag, float d, float m, float s)
: base(tag, new MathEx.UFraction32[] { new MathEx.UFraction32(d), new MathEx.UFraction32(m), new MathEx.UFraction32(s) })
{
;
}
}
///
/// Represents a GPS time stamp as UTC (EXIF Specification: 3xRATIONAL)
///
public class GPSTimeStamp : ExifURationalArray
{
protected new MathEx.UFraction32[] Value { get { return mValue; } set { mValue = value; } }
public MathEx.UFraction32 Hour { get { return mValue[0]; } set { mValue[0] = value; } }
public MathEx.UFraction32 Minute { get { return mValue[1]; } set { mValue[1] = value; } }
public MathEx.UFraction32 Second { get { return mValue[2]; } set { mValue[2] = value; } }
public override string ToString()
{
return string.Format("{0:F2}:{1:F2}:{2:F2}\"", (float)Hour, (float)Minute, (float)Second);
}
public GPSTimeStamp(ExifTag tag, MathEx.UFraction32[] value)
: base(tag, value)
{
;
}
public GPSTimeStamp(ExifTag tag, float h, float m, float s)
: base(tag, new MathEx.UFraction32[] { new MathEx.UFraction32(h), new MathEx.UFraction32(m), new MathEx.UFraction32(s) })
{
;
}
}
///
/// Represents an ASCII string. (EXIF Specification: BYTE)
/// Used by Windows XP.
///
public class WindowsByteString : ExifProperty
{
protected string mValue;
protected override object _Value { get { return Value; } set { Value = (string)value; } }
public new string Value { get { return mValue; } set { mValue = value; } }
static public implicit operator string(WindowsByteString obj) { return obj.mValue; }
public override string ToString() { return mValue; }
public WindowsByteString(ExifTag tag, string value)
: base(tag)
{
mValue = value;
}
public override ExifInterOperability Interoperability
{
get
{
byte[] data = Encoding.Unicode.GetBytes(mValue);
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 1, (uint)data.Length, data);
}
}
}
}
quickroute-linux-upstream-2.5/3rdparty/ExifLibrary/ExifFileTypeDescriptor.cs 0000664 0000000 0000000 00000010473 14462226067 0027477 0 ustar 00root root 0000000 0000000 using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace ExifLibrary
{
///
/// Provides a custom type descriptor for an ExifFile instance.
///
internal sealed class ExifFileTypeDescriptionProvider : TypeDescriptionProvider
{
public ExifFileTypeDescriptionProvider()
: this(TypeDescriptor.GetProvider(typeof(ImageFile)))
{
}
public ExifFileTypeDescriptionProvider(TypeDescriptionProvider parent)
: base(parent)
{
}
///
/// Gets a custom type descriptor for the given type and object.
///
/// The type of object for which to retrieve the type descriptor.
/// An instance of the type. Can be null if no instance was passed to the .
///
/// An that can provide metadata for the type.
///
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
{
return new ExifFileTypeDescriptor(base.GetTypeDescriptor(objectType, instance), instance);
}
}
///
/// Expands ExifProperty objects contained in an ExifFile as seperate properties.
///
internal sealed class ExifFileTypeDescriptor : CustomTypeDescriptor
{
ImageFile owner;
public ExifFileTypeDescriptor(ICustomTypeDescriptor parent, object instance)
: base(parent)
{
owner = (ImageFile)instance;
}
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
return GetProperties();
}
///
/// Returns a collection of property descriptors for the object represented by this type descriptor.
///
///
/// A containing the property descriptions for the object represented by this type descriptor. The default is .
///
public override PropertyDescriptorCollection GetProperties()
{
// Enumerate the original set of properties and create our new set with it
List properties = new List();
foreach (ExifProperty prop in owner.Properties)
{
ExifPropertyDescriptor pd = new ExifPropertyDescriptor(prop);
properties.Add(pd);
}
// Finally return the list
return new PropertyDescriptorCollection(properties.ToArray(), true);
}
}
internal sealed class ExifPropertyDescriptor : PropertyDescriptor
{
object originalValue;
ExifProperty linkedProperty;
public ExifPropertyDescriptor(ExifProperty property)
: base(property.Name, new Attribute[] { new BrowsableAttribute(true) })
{
linkedProperty = property;
originalValue = property.Value;
}
public override bool CanResetValue(object component)
{
return true;
}
public override Type ComponentType
{
get { return typeof(JPEGFile); }
}
public override object GetValue(object component)
{
return linkedProperty.Value;
}
public override bool IsReadOnly
{
get { return false; }
}
public override Type PropertyType
{
get { return linkedProperty.Value.GetType(); }
}
public override void ResetValue(object component)
{
linkedProperty.Value = originalValue;
}
public override void SetValue(object component, object value)
{
linkedProperty.Value = value;
}
public override bool ShouldSerializeValue(object component)
{
return false;
}
}
}
quickroute-linux-upstream-2.5/3rdparty/ExifLibrary/ExifInterOperability.cs 0000664 0000000 0000000 00000004351 14462226067 0027202 0 ustar 00root root 0000000 0000000 using System;
using System.Collections.Generic;
using System.Text;
namespace ExifLibrary
{
///
/// Represents interoperability data for an exif tag in the platform byte order.
///
public struct ExifInterOperability
{
private ushort mTagID;
private ushort mTypeID;
private uint mCount;
private byte[] mData;
///
/// Gets the tag ID defined in the Exif standard.
///
public ushort TagID { get { return mTagID; } }
///
/// Gets the type code defined in the Exif standard.
///
/// - 1 = BYTE (byte)
/// - 2 = ASCII (byte array)
/// - 3 = SHORT (ushort)
/// - 4 = LONG (uint)
/// - 5 = RATIONAL (2 x uint: numerator, denominator)
/// - 6 = BYTE (sbyte)
/// - 7 = UNDEFINED (byte array)
/// - 8 = SSHORT (short)
/// - 9 = SLONG (int)
/// - 10 = SRATIONAL (2 x int: numerator, denominator)
/// - 11 = FLOAT (float)
/// - 12 = DOUBLE (double)
///
///
public ushort TypeID { get { return mTypeID; } }
///
/// Gets the byte count or number of components.
///
public uint Count { get { return mCount; } }
///
/// Gets the field value as an array of bytes.
///
public byte[] Data { get { return mData; } }
///
/// Returns the string representation of this instance.
///
///
public override string ToString()
{
return string.Format("Tag: {0}, Type: {1}, Count: {2}, Data Length: {3}", mTagID, mTypeID, mCount, mData.Length);
}
public ExifInterOperability(ushort tagid, ushort typeid, uint count, byte[] data)
{
mTagID = tagid;
mTypeID = typeid;
mCount = count;
mData = data;
}
}
}
quickroute-linux-upstream-2.5/3rdparty/ExifLibrary/ExifLibrary.csproj 0000664 0000000 0000000 00000007574 14462226067 0026226 0 ustar 00root root 0000000 0000000
Debug
AnyCPU
8.0.30703
2.0
{C29BA585-E27B-4AD0-9AD1-490B5E0E2A5E}
Library
Properties
ExifLibrary
ExifLibrary
512
false
Manina.snk
2.0
v2.0
true
full
false
bin\Debug\
DEBUG;TRACE
prompt
4
pdbonly
true
bin\Release\
TRACE
prompt
4