Skip to content

FieldValue

Namespace: ThinkGeo.Core.LibTiff

Holds a value of a Tiff tag.

public struct FieldValue

Inheritance ObjectValueTypeFieldValue

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

Value

Gets the value.

public object Value { get; }

Property Value

Object
The value.

Methods

FromParams(Object[])

FieldValue[] FromParams(Object[] list)

Parameters

list Object[]

Returns

FieldValue[]

Set(Object)

void Set(object o)

Parameters

o Object

ToByte()

Retrieves value converted to byte.

byte ToByte()

Returns

Byte
The value converted to byte.

ToShort()

Retrieves value converted to short.

short ToShort()

Returns

Int16
The value converted to short.

ToUShort()

Retrieves value converted to ushort.

ushort ToUShort()

Returns

UInt16
The value converted to ushort.

ToInt()

Retrieves value converted to int.

int ToInt()

Returns

Int32
The value converted to int.

ToUInt()

Retrieves value converted to uint.

uint ToUInt()

Returns

UInt32
The value converted to uint.

ToLong()

Retrieves value converted to long.

long ToLong()

Returns

Int64
The value converted to long.

ToFloat()

Retrieves value converted to float.

float ToFloat()

Returns

Single
The value converted to float.

ToDouble()

Retrieves value converted to double.

double ToDouble()

Returns

Double
The value converted to double.

ToString()

Retrieves value converted to string.

string ToString()

Returns

String

        A  that represents this instance.

Remarks:

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

GetBytes()

Retrieves value converted to byte array.

Byte[] GetBytes()

Returns

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.

ToByteArray()

Retrieves value converted to array of bytes.

Byte[] ToByteArray()

Returns

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.

ToShortArray()

Retrieves value converted to array of short values.

Int16[] ToShortArray()

Returns

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.

ToUShortArray()

Retrieves value converted to array of ushort values.

UInt16[] ToUShortArray()

Returns

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.

ToIntArray()

Retrieves value converted to array of int values.

Int32[] ToIntArray()

Returns

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.

ToUIntArray()

Retrieves value converted to array of uint values.

UInt32[] ToUIntArray()

Returns

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.

TolongArray()

Retrieves value converted to array of long values.

Int64[] TolongArray()

Returns

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.

ToFloatArray()

Retrieves value converted to array of float values.

Single[] ToFloatArray()

Returns

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.

ToDoubleArray()

Retrieves value converted to array of double values.

Double[] ToDoubleArray()

Returns

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.