C# Class BitMiracle.LibTiff.Classic.FieldValue

Show file Open project: Core-Techs/TiffLibrary Class Usage Examples

Public Methods

Method Description
GetBytes ( ) : byte[]

Retrieves value converted to byte array.

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.

ToByte ( ) : byte

Retrieves value converted to byte.

ToByteArray ( ) : byte[]

Retrieves value converted to array of bytes.

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.

ToDouble ( ) : double

Retrieves value converted to double.

ToDoubleArray ( ) : double[]

Retrieves value converted to array of double values.

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.

ToFloat ( ) : float

Retrieves value converted to float.

ToFloatArray ( ) : float[]

Retrieves value converted to array of float values.

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.

ToInt ( ) : int

Retrieves value converted to int.

ToIntArray ( ) : int[]

Retrieves value converted to array of int values.

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.

ToShort ( ) : short

Retrieves value converted to short.

ToShortArray ( ) : short[]

Retrieves value converted to array of short values.

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.

ToString ( ) : string

Retrieves value converted to string.

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

Private Methods

Method Description
FieldValue ( object o ) : System
FromParams ( ) : BitMiracle.LibTiff.Classic.FieldValue[]
Set ( object o ) : void
ToUInt ( ) : uint
ToUIntArray ( ) : uint[]
ToUShort ( ) : ushort
ToUShortArray ( ) : ushort[]

Method Details

GetBytes() public method

Retrieves value converted to byte array.

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.

public GetBytes ( ) : byte[]
return byte[]

ToByte() public method

Retrieves value converted to byte.
public ToByte ( ) : byte
return byte

ToByteArray() public method

Retrieves value converted to array of bytes.

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.

public ToByteArray ( ) : byte[]
return byte[]

ToDouble() public method

Retrieves value converted to double.
public ToDouble ( ) : double
return double

ToDoubleArray() public method

Retrieves value converted to array of double values.

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.

public ToDoubleArray ( ) : double[]
return double[]

ToFloat() public method

Retrieves value converted to float.
public ToFloat ( ) : float
return float

ToFloatArray() public method

Retrieves value converted to array of float values.

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.

public ToFloatArray ( ) : float[]
return float[]

ToInt() public method

Retrieves value converted to int.
public ToInt ( ) : int
return int

ToIntArray() public method

Retrieves value converted to array of int values.

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.

public ToIntArray ( ) : int[]
return int[]

ToShort() public method

Retrieves value converted to short.
public ToShort ( ) : short
return short

ToShortArray() public method

Retrieves value converted to array of short values.

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.

public ToShortArray ( ) : short[]
return short[]

ToString() public method

Retrieves value converted to string.
If value is a byte array, then it gets converted to string using Latin1 encoding encoder.
public ToString ( ) : string
return string