Show / Hide Table of Contents

Struct FieldValue

Holds a value of a Tiff tag.

Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: BitMiracle.LibTiff.Classic
Assembly: BitMiracle.LibTiff.NET.dll
Syntax
public struct FieldValue
Remarks

Simply put, it is a wrapper around System.Object, that helps to deal with unboxing and conversion of types a bit easier.

Please take a look at: http://blogs.msdn.com/ericlippert/archive/2009/03/19/representation-and-identity.aspx

Properties

| Improve this Doc View Source

Value

Gets the value.

Declaration
public object Value { get; }
Property Value
Type Description
System.Object

The value.

Methods

| Improve this Doc View Source

GetBytes()

Retrieves value converted to byte array.

Declaration
public byte[] GetBytes()
Returns
Type Description
System.Byte[]

Value converted to byte array.

Remarks

If value is byte array then it retrieved unaltered.

If value is array of short, ushort, int, uint, float or double values then this array is converted to byte array

If value is a string then it gets converted to byte array using Latin1 encoding encoder.

If value is of any other type then null is returned.

| Improve this Doc View Source

ToByte()

Retrieves value converted to byte.

Declaration
public byte ToByte()
Returns
Type Description
System.Byte

The value converted to byte.

| Improve this Doc View Source

ToByteArray()

Retrieves value converted to array of bytes.

Declaration
public byte[] ToByteArray()
Returns
Type Description
System.Byte[]

Value converted to array of bytes.

Remarks

If value is array of bytes then it retrieved unaltered.

If value is array of short, ushort, int or uint values then each element of field value gets converted to byte and added to resulting array.

If value is string then it gets converted to byte[] using Latin1 encoding encoder.

If value is of any other type then null is returned.

| Improve this Doc View Source

ToDouble()

Retrieves value converted to double.

Declaration
public double ToDouble()
Returns
Type Description
System.Double

The value converted to double.

| Improve this Doc View Source

ToDoubleArray()

Retrieves value converted to array of double values.

Declaration
public double[] ToDoubleArray()
Returns
Type Description
System.Double[]

Value converted to array of double values.

Remarks

If value is array of double values then it retrieved unaltered.

If value is array of bytes then each 8 bytes are converted to double and added to resulting array. If value contains amount of bytes that can't be divided by 8 without remainder, then null is returned.

If value is array of float values then each element of field value gets converted to double and added to resulting array.

If value is of any other type then null is returned.

| Improve this Doc View Source

ToFloat()

Retrieves value converted to float.

Declaration
public float ToFloat()
Returns
Type Description
System.Single

The value converted to float.

| Improve this Doc View Source

ToFloatArray()

Retrieves value converted to array of float values.

Declaration
public float[] ToFloatArray()
Returns
Type Description
System.Single[]

Value converted to array of float values.

Remarks

If value is array of float values then it retrieved unaltered.

If value is array of bytes then each 4 bytes are converted to float and added to resulting array. If value contains amount of bytes that can't be divided by 4 without remainder, then null is returned.

If value is array of double values then each element of field value gets converted to float and added to resulting array.

If value is of any other type then null is returned.

| Improve this Doc View Source

ToInt()

Retrieves value converted to int.

Declaration
public int ToInt()
Returns
Type Description
System.Int32

The value converted to int.

| Improve this Doc View Source

ToIntArray()

Retrieves value converted to array of int values.

Declaration
public int[] ToIntArray()
Returns
Type Description
System.Int32[]

Value converted to array of int values.

Remarks

If value is array of int values then it retrieved unaltered.

If value is array of bytes then each 4 bytes are converted to int and added to resulting array. If value contains amount of bytes that can't be divided by 4 without remainder, then null is returned.

If value is array of short, ushort or uint values then each element of field value gets converted to int and added to resulting array.

If value is of any other type then null is returned.

| Improve this Doc View Source

ToLong()

Retrieves value converted to long.

Declaration
public long ToLong()
Returns
Type Description
System.Int64

The value converted to long.

| Improve this Doc View Source

TolongArray()

Retrieves value converted to array of long values.

Declaration
public long[] TolongArray()
Returns
Type Description
System.Int64[]

Value converted to array of long values.

Remarks

If value is array of long values then it retrieved unaltered.

If value is array of bytes then each 8 bytes are converted to uint and added to resulting array. If value contains amount of bytes that can't be divided by 8 without remainder, then null is returned.

If value is array of short, ushort or int values then each element of field value gets converted to long and added to resulting array.

If value is of any other type then null is returned.

| Improve this Doc View Source

ToShort()

Retrieves value converted to short.

Declaration
public short ToShort()
Returns
Type Description
System.Int16

The value converted to short.

| Improve this Doc View Source

ToShortArray()

Retrieves value converted to array of short values.

Declaration
public short[] ToShortArray()
Returns
Type Description
System.Int16[]

Value converted to array of short values.

Remarks

If value is array of short values then it retrieved unaltered.

If value is array of bytes then each pair of bytes is converted to short and added to resulting array. If value contains odd amount of bytes, then null is returned.

If value is array of ushort, int or uint values then each element of field value gets converted to short and added to resulting array.

If value is of any other type then null is returned.

| Improve this Doc View Source

ToString()

Retrieves value converted to string.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents this instance.

Overrides
System.ValueType.ToString()
Remarks

If value is a byte array, then it gets converted to string using Latin1 encoding encoder.

| Improve this Doc View Source

ToUInt()

Retrieves value converted to uint.

Declaration
[CLSCompliant(false)]
public uint ToUInt()
Returns
Type Description
System.UInt32

The value converted to uint.

| Improve this Doc View Source

ToUIntArray()

Retrieves value converted to array of uint values.

Declaration
[CLSCompliant(false)]
public uint[] ToUIntArray()
Returns
Type Description
System.UInt32[]

Value converted to array of uint values.

Remarks

If value is array of uint values then it retrieved unaltered.

If value is array of bytes then each 4 bytes are converted to uint and added to resulting array. If value contains amount of bytes that can't be divided by 4 without remainder, then null is returned.

If value is array of short, ushort or int values then each element of field value gets converted to uint and added to resulting array.

If value is of any other type then null is returned.

| Improve this Doc View Source

ToUShort()

Retrieves value converted to ushort.

Declaration
[CLSCompliant(false)]
public ushort ToUShort()
Returns
Type Description
System.UInt16

The value converted to ushort.

| Improve this Doc View Source

ToUShortArray()

Retrieves value converted to array of ushort values.

Declaration
[CLSCompliant(false)]
public ushort[] ToUShortArray()
Returns
Type Description
System.UInt16[]

Value converted to array of ushort values.

Remarks

If value is array of ushort values then it retrieved unaltered.

If value is array of bytes then each pair of bytes is converted to ushort and added to resulting array. If value contains odd amount of bytes, then null is returned.

If value is array of short, int or uint values then each element of field value gets converted to ushort and added to resulting array.

If value is of any other type then null is returned.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX