C# Класс BitMiracle.LibTiff.Classic.FieldValue

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
FieldValue ( object o ) : System
FromParams ( ) : BitMiracle.LibTiff.Classic.FieldValue[]
Set ( object o ) : void
ToUInt ( ) : uint
ToUIntArray ( ) : uint[]
ToUShort ( ) : ushort
ToUShortArray ( ) : ushort[]

Описание методов

GetBytes() публичный Метод

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[]
Результат byte[]

ToByte() публичный Метод

Retrieves value converted to byte.
public ToByte ( ) : byte
Результат byte

ToByteArray() публичный Метод

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[]
Результат byte[]

ToDouble() публичный Метод

Retrieves value converted to double.
public ToDouble ( ) : double
Результат double

ToDoubleArray() публичный Метод

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[]
Результат double[]

ToFloat() публичный Метод

Retrieves value converted to float.
public ToFloat ( ) : float
Результат float

ToFloatArray() публичный Метод

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[]
Результат float[]

ToInt() публичный Метод

Retrieves value converted to int.
public ToInt ( ) : int
Результат int

ToIntArray() публичный Метод

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[]
Результат int[]

ToShort() публичный Метод

Retrieves value converted to short.
public ToShort ( ) : short
Результат short

ToShortArray() публичный Метод

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[]
Результат short[]

ToString() публичный Метод

Retrieves value converted to string.
If value is a byte array, then it gets converted to string using Latin1 encoding encoder.
public ToString ( ) : string
Результат string