Exemplo n.º 1
0
        public override ExifInterOperability GetInteroperability(BitConverterEx.ByteOrder fileByteOrder)
        {
            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.ByteOrder.System,
                                                                          BitConverterEx.ByteOrder.System)));
            }
            else
            {
                throw new UnknownEnumTypeException();
            }
        }
Exemplo n.º 2
0
 public override ExifInterOperability GetInteroperability(BitConverterEx.ByteOrder fileByteOrder)
 {
     return(new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 10, (uint)mValue.Length, ExifBitConverter.GetBytes(mValue, BitConverterEx.ByteOrder.System)));
 }
Exemplo n.º 3
0
 public override ExifInterOperability GetInteroperability(BitConverterEx.ByteOrder fileByteOrder)
 {
     return(new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 2, (uint)20, ExifBitConverter.GetBytes(mValue, true)));
 }