Spectral (CVSpectral.dll) 14.1
MetaData Handling

Meta data exports. More...

Enumerations

enum  CVSField {
  CVSFI_Interleave = 0 , CVSFI_Samples = 1 , CVSFI_Lines = 2 , CVSFI_Bands = 3 ,
  CVSFI_DataType = 4 , CVSFI_ByteOrder = 5 , CVSFI_FileType = 6 , CVSFI_HeaderOffset = 7 ,
  CVSFI_Wavelength = 8 , CVSFI_WavelengthUnit = 9 , CVSFI_Fwhm = 10
}
 Field index to access fields in the MetaData handle. More...
 
enum  CVSFieldType {
  CVSFT_Invalid = -1 , CVSFT_String = 0 , CVSFT_Float = 1 , CVSFT_Integer = 2 ,
  CVSFT_StringArray = 3 , CVSFT_FloatArray = 4 , CVSFT_IntegerArray = 5
}
 Data Type of a field. More...
 

Functions

cvbres_t CVSCreateMetaData (CVSMETADATA &MetaData)
 Creates an empty meta data handle. More...
 
cvbres_t CVSMetaDataAddToFloatArray (CVSMETADATA MetaData, CVSField FieldEnum, double Element)
 Append a double element to a MetaData field of type double array. More...
 
cvbres_t CVSMetaDataAddToIntegerArray (CVSMETADATA MetaData, CVSField FieldEnum, cvbint64_t Element)
 Append an integer element to a MetaData field of type integer array. More...
 
cvbres_t CVSMetaDataAddToStringArray (CVSMETADATA MetaData, CVSField FieldEnum, const char *String)
 Append a string element to a meta data field of type string array. More...
 
cvbres_t CVSMetaDataAddToStringArrayW (CVSMETADATA MetaData, CVSField FieldEnum, const wchar_t *String)
 Append a wstring element to a meta data field of type wstring array. More...
 
cvbres_t CVSMetaDataClearField (CVSMETADATA MetaData, CVSField FieldEnum)
 Clears the specified field. More...
 
cvbres_t CVSMetaDataGetArraySize (CVSMETADATA MetaData, CVSField FieldEnum, size_t &NumberOfElements)
 Retrieves the array size of a field. More...
 
cvbres_t CVSMetaDataGetAsFloat (CVSMETADATA MetaData, CVSField FieldEnum, double &Value)
 Retrieve a field value as double. More...
 
cvbres_t CVSMetaDataGetAsFloatArray (CVSMETADATA MetaData, CVSField FieldEnum, cvbval_t ElementIndex, double &Element)
 Retrieves a double element from an array in a meta data field. More...
 
cvbres_t CVSMetaDataGetAsInteger (CVSMETADATA MetaData, CVSField FieldEnum, cvbint64_t &Value)
 Retrieve a field value as integer. More...
 
cvbres_t CVSMetaDataGetAsIntegerArray (CVSMETADATA MetaData, CVSField FieldEnum, cvbval_t ElementIndex, cvbint64_t &Element)
 Retrieves an integer element from an array in a meta data field. More...
 
cvbres_t CVSMetaDataGetAsString (CVSMETADATA MetaData, CVSField FieldEnum, char *Value, size_t &ValueSize)
 Retrieve a field value as string. More...
 
cvbres_t CVSMetaDataGetAsStringArray (CVSMETADATA MetaData, CVSField FieldEnum, cvbval_t ElementIndex, char *String, size_t &StringLength)
 Retrieves a string element of a meta data field. More...
 
cvbres_t CVSMetaDataGetAsStringArrayW (CVSMETADATA MetaData, CVSField FieldEnum, cvbval_t ElementIndex, wchar_t *String, size_t &StringLength)
 Retrieves a wstring element of a meta data field. More...
 
cvbres_t CVSMetaDataGetAsStringW (CVSMETADATA MetaData, CVSField FieldEnum, wchar_t *Value, size_t &ValueSize)
 Retrieve a field value as wstring. More...
 
cvbres_t CVSMetaDataGetFieldnameAsString (CVSMETADATA MetaData, CVSField FieldEnum, char *FieldName, size_t &FieldNameSize)
 Retrieve the field name as string. More...
 
cvbres_t CVSMetaDataGetFieldnameAsStringW (CVSMETADATA MetaData, CVSField FieldEnum, wchar_t *FieldName, size_t &FieldNameSize)
 Retrieve the field name as wstring. More...
 
cvbres_t CVSMetaDataGetFieldType (CVSMETADATA MetaData, CVSField FieldEnum, CVSFieldType &Type)
 Get data type of meta data field. More...
 
cvbres_t CVSMetaDataGetNumberOfFields (CVSMETADATA MetaData, size_t &NumberOfFields)
 Get the total number of fields. More...
 
cvbres_t CVSMetaDataIsFieldDefined (CVSMETADATA MetaData, CVSField FieldEnum, cvbbool_t &IsDefined)
 Check if a field is defined. More...
 
cvbres_t CVSMetaDataSetAsFloat (CVSMETADATA MetaData, CVSField FieldEnum, double Value)
 Set meta data field as double. More...
 
cvbres_t CVSMetaDataSetAsInteger (CVSMETADATA MetaData, CVSField FieldEnum, cvbint64_t Value)
 Set a meta data field as integer. More...
 
cvbres_t CVSMetaDataSetAsString (CVSMETADATA MetaData, CVSField FieldEnum, const char *Value)
 Set meta data field as string. More...
 
cvbres_t CVSMetaDataSetAsStringW (CVSMETADATA MetaData, CVSField FieldEnum, const wchar_t *Value)
 Set meta data field as wstring. More...
 

Detailed Description

Meta data exports.

Version
0.2.0.0 For details see function documentation.

Enumeration Type Documentation

◆ CVSField

enum CVSField

Field index to access fields in the MetaData handle.

Enumerator
CVSFI_Interleave 

Defines the way the spectral data of the buffer is ordered, see also https://www.l3harrisgeospatial.com/docs/enviimagefiles.html:

  • BSQ: band sequential
  • BIL: band interleaved by line
  • BIP: band interleaved by pixel
CVSFI_Samples 

The number of samples.

CVSFI_Lines 

The number of lines.

CVSFI_Bands 

The number of bands.

CVSFI_DataType 

Envi data type (not CVB data type!), see also https://www.l3harrisgeospatial.com/docs/enviheaderfiles.html:
1 = Byte: 8-bit unsigned integer
2 = Integer: 16-bit signed integer

3 = Long: 32-bit signed integer
4 = Floating-point: 32-bit single-precision
5 = Double-precision: 64-bit double-precision floating-point
6 = Complex: Real-imaginary pair of single-precision floating-point
9 = Double-precision complex: Real-imaginary pair of double precision floating-point
12 = Unsigned integer: 16-bit
13 = Unsigned long integer: 32-bit
14 = 64-bit long integer (signed)
15 = 64-bit unsigned long integer (unsigned)

CVSFI_ByteOrder 

Byte order

  • 0 = Least significant byte first (LSF)
  • 1 = Most significant byte first (MSF)
CVSFI_FileType 

File type: Default value: "ENVI Standard"

CVSFI_HeaderOffset 

Header offset in bytes Number of bytes to skip when reading the ENVI-binary file

CVSFI_Wavelength 

Array of wavelengths with the unit given in CVSFI_WavelengthUnit.

CVSFI_WavelengthUnit 

Wavelength unit

  • Micrometers
  • um
  • Nanometers
  • nm
  • Millimeters
  • mm
  • Centimeters
  • cm
  • Meters
  • m
  • Wavenumber
  • Angstroms
  • GHz
  • MHz
  • Index
  • Unknown
CVSFI_Fwhm 

Array of Full-width-half-maximum values The same unit as in CVSFI_WavelengthUnit

◆ CVSFieldType

Data Type of a field.

Enumerator
CVSFT_Invalid 

Invalid field for when the field has not been defined yet.

CVSFT_String 

Field contains string value.

CVSFT_Float 

Field contains floating point value.

CVSFT_Integer 

Field contains integer value.

CVSFT_StringArray 

Field contains string array value.

CVSFT_FloatArray 

Field contains floating point array value.

CVSFT_IntegerArray 

Field contains integer array value.

Function Documentation

◆ CVSCreateMetaData()

cvbres_t CVSCreateMetaData ( CVSMETADATA &  MetaData)

Creates an empty meta data handle.

An empty meta data Handle is created. All mandatory ENVI fields are initialized with the following default values CVSFI_Interleave = BandInterleavedByLine CVSFI_Samples = 0 CVSFI_Lines = 0 CVSFI_Bands = 0 CVSFI_DataType = 0 CVSFI_ByteOrder = 0 CVSFI_FileType = ENVI Standard CVSFI_HeaderOffset = 0

Parameters
[out]MetaDataMeta data handle
Attention
Release the returned object handle with ReleaseObject if not needed anymore.
Returns
CVC_E_OK on success, CVC_E_ERROR otherwise

◆ CVSMetaDataAddToFloatArray()

cvbres_t CVSMetaDataAddToFloatArray ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
double  Element 
)

Append a double element to a MetaData field of type double array.

Field needs to be undefined or have the suitable data type Call CVSMetaDataClearField to clear field.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]ElementDouble element to add to field of type double array
Returns
See also
CVSMetaDataGetAsFloatArray CVSMetaDataSetAsFloat CVSMetaDataClearField

◆ CVSMetaDataAddToIntegerArray()

cvbres_t CVSMetaDataAddToIntegerArray ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
cvbint64_t  Element 
)

Append an integer element to a MetaData field of type integer array.

Field needs to be undefined or have the suitable data type Call CVSMetaDataClearField to clear field.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]ElementInteger element to add to field of type integer array
Returns
See also
CVSMetaDataGetAsIntegerArray CVSMetaDataSetAsInteger CVSMetaDataClearField

◆ CVSMetaDataAddToStringArray()

cvbres_t CVSMetaDataAddToStringArray ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
const char *  String 
)

Append a string element to a meta data field of type string array.

Field needs to be undefined or have the suitable data type Call CVSMetaDataClearField to clear field.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]StringString Element to add to field of type string array
Returns
See also
CVSMetaDataGetAsStringArray CVSMetaDataAddToArrayAsStringW CVSMetaDataSetAsString CVSMetaDataClearField

◆ CVSMetaDataAddToStringArrayW()

cvbres_t CVSMetaDataAddToStringArrayW ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
const wchar_t *  String 
)

Append a wstring element to a meta data field of type wstring array.

Field needs to be undefined or have the suitable data type Call CVSMetaDataClearField to clear field.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]StringWString Element to add to field of type wstring array
Returns
See also
CVSMetaDataGetAsStringArrayW CVSMetaDataAddToArrayAsString CVSMetaDataSetAsStringW CVSMetaDataClearField

◆ CVSMetaDataClearField()

cvbres_t CVSMetaDataClearField ( CVSMETADATA  MetaData,
CVSField  FieldEnum 
)

Clears the specified field.

The specified field is cleared. Afterwards this field is undefined

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
Returns
See also
CVSMetaDataIsFieldDefined CVSMetaDataGetFieldType

◆ CVSMetaDataGetArraySize()

cvbres_t CVSMetaDataGetArraySize ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
size_t &  NumberOfElements 
)

Retrieves the array size of a field.

In case that field does not contain an array the number of elements is set to 0

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[out]NumberOfElementsNumber of elements in that field
Returns
See also
CVSMetaDataGetFieldType CVSMetaDataGetAsStringArray CVSMetaDataGetAsStringArrayW CVSMetaDataGetAsIntegerArray CVSMetaDataGetAsFloatArray

◆ CVSMetaDataGetAsFloat()

cvbres_t CVSMetaDataGetAsFloat ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
double &  Value 
)

Retrieve a field value as double.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[out]ValueField value as double
Returns
See also
CVSMetaDataSetAsFloat CVSMetaDataGetAsFloatArray

◆ CVSMetaDataGetAsFloatArray()

cvbres_t CVSMetaDataGetAsFloatArray ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
cvbval_t  ElementIndex,
double &  Element 
)

Retrieves a double element from an array in a meta data field.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]ElementIndexIndex of the double array in the range [0, CVSMetaDataGetArraySize[
[out]ElementElement of the double array at given index
Returns
See also
CVSMetaDataGetArraySize CVSMetaDataAddToArrayAsFloat CVSMetaDataGetAsFloat

◆ CVSMetaDataGetAsInteger()

cvbres_t CVSMetaDataGetAsInteger ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
cvbint64_t &  Value 
)

Retrieve a field value as integer.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[out]ValueField value as integer
Returns
See also
CVSMetaDataSetAsInteger CVSMetaDataGetAsIntegerArray

◆ CVSMetaDataGetAsIntegerArray()

cvbres_t CVSMetaDataGetAsIntegerArray ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
cvbval_t  ElementIndex,
cvbint64_t &  Element 
)

Retrieves an integer element from an array in a meta data field.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]ElementIndexIndex of the int array in the range [0, CVSMetaDataGetArraySize[
[out]ElementElement of the int array at given index
Returns
See also
CVSMetaDataGetArraySize CVSMetaDataAddToArrayAsInteger CVSMetaDataGetAsInteger

◆ CVSMetaDataGetAsString()

cvbres_t CVSMetaDataGetAsString ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
char *  Value,
size_t &  ValueSize 
)

Retrieve a field value as string.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in,out]ValueField value as char array. To get the array size, set Value to nullptr
[in,out]ValueSizeSize of the char array. To get the array size, set Value to nullptr
Returns
See also
CVSMetaDataSetAsString CVSMetaDataGetAsStringW CVSMetaDataGetAsStringArray

◆ CVSMetaDataGetAsStringArray()

cvbres_t CVSMetaDataGetAsStringArray ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
cvbval_t  ElementIndex,
char *  String,
size_t &  StringLength 
)

Retrieves a string element of a meta data field.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]ElementIndexIndex of the string array in the range [0, CVSMetaDataGetArraySize[
[out]StringThis pointer to pointer holds an array of strings. The user has to allocate char-pointer array and then to allocate char array.
[in,out]StringLengthThis array contains the size in the string array. To get ElementSize pass Array as nullptr and allocate the suitable space for ElementSize using CVSMetaDataGetArraySize
Returns
See also
CVSMetaDataGetArraySize CVSMetaDataAddToArrayAsString CVSMetaDataGetAsString

◆ CVSMetaDataGetAsStringArrayW()

cvbres_t CVSMetaDataGetAsStringArrayW ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
cvbval_t  ElementIndex,
wchar_t *  String,
size_t &  StringLength 
)

Retrieves a wstring element of a meta data field.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumEnum to address a field in MetaData
[in]ElementIndexIndex of the wstring array in the range [0, CVSMetaDataGetArraySize[
[in,out]StringElement as allocated wchar array. To get the wstring size of the field element, set Element to NULL
[in,out]StringLengthSize of the allocated wstring element. To get the wstring size of the field element, set Element to NULL
Returns
See also
CVSMetaDataGetArraySize CVSMetaDataAddToArrayAsStringW CVSMetaDataSetAsStringW

◆ CVSMetaDataGetAsStringW()

cvbres_t CVSMetaDataGetAsStringW ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
wchar_t *  Value,
size_t &  ValueSize 
)

Retrieve a field value as wstring.

Parameters
[in]MetaDatahandle
[in]FieldEnumField index
[in,out]ValueField value as wchar array. To get the array size, set Value to nullptr
[in,out]ValueSizeSize of the allocated wchar array. To get the array size, set Value to nullptr
Returns
See also
CVSMetaDataSetAsStringW CVSMetaDataGetAsString CVSMetaDataGetAsStringArrayW

◆ CVSMetaDataGetFieldnameAsString()

cvbres_t CVSMetaDataGetFieldnameAsString ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
char *  FieldName,
size_t &  FieldNameSize 
)

Retrieve the field name as string.

The field name is used when exporting or importing the meta data eg. in the ENVI-format

Parameters
[in]MetaDatahandle
[in]FieldEnumEnum to address a field in MetaData
[in,out]FieldNameField name as char array. To get the array size of field name set FieldName to nullptr
[in,out]FieldNameSizeSize of the allocated field name char array. To get the array size of field name set FieldName to nullptr
Returns
See also
CVSMetaDataIsFieldDefined

◆ CVSMetaDataGetFieldnameAsStringW()

cvbres_t CVSMetaDataGetFieldnameAsStringW ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
wchar_t *  FieldName,
size_t &  FieldNameSize 
)

Retrieve the field name as wstring.

The field name is used when exporting or importing the meta data

Parameters
[in]MetaDatahandle
[in]FieldEnumEnum to address a field in MetaData
[in,out]FieldNameField name as wchar array. To get the array size of field name set FieldName to nullptr
[in,out]FieldNameSizeSize of the allocated field name wchar array. To get the array size of field name set FieldName to nullptr
Returns
See also
CVSMetaDataIsFieldDefined

◆ CVSMetaDataGetFieldType()

cvbres_t CVSMetaDataGetFieldType ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
CVSFieldType Type 
)

Get data type of meta data field.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumEnum to address a field in MetaData
[out]TypeEnum containing the data type of the field
Returns
See also
CVSMetaDataClearField CVSMetaDataGetFieldnameAsString

◆ CVSMetaDataGetNumberOfFields()

cvbres_t CVSMetaDataGetNumberOfFields ( CVSMETADATA  MetaData,
size_t &  NumberOfFields 
)

Get the total number of fields.

Returns the number of all fields. Fields which are not defined are counted as well

Parameters
[in]MetaDataMeta data handle
[out]NumberOfFieldsMaximum number of fields in the MetaData handle
Returns
See also
CVSMetaDataIsFieldDefined

◆ CVSMetaDataIsFieldDefined()

cvbres_t CVSMetaDataIsFieldDefined ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
cvbbool_t &  IsDefined 
)

Check if a field is defined.

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumEnum to address a field in MetaData
[out]IsDefinedtrue if field is defined, false if field is undefined
Returns
See also
CVSMetaDataClearField CVSMetaDataGetFieldType

◆ CVSMetaDataSetAsFloat()

cvbres_t CVSMetaDataSetAsFloat ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
double  Value 
)

Set meta data field as double.

Any previous value of the field is discarded

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]ValueDouble value
Returns
See also
CVSMetaDataGetAsFloat CVSMetaDataAddToArrayAsFloat

◆ CVSMetaDataSetAsInteger()

cvbres_t CVSMetaDataSetAsInteger ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
cvbint64_t  Value 
)

Set a meta data field as integer.

Any previous value of the field is discarded

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]ValueInteger value
Returns
See also
CVSMetaDataGetAsInteger CVSMetaDataAddToArrayAsInteger

◆ CVSMetaDataSetAsString()

cvbres_t CVSMetaDataSetAsString ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
const char *  Value 
)

Set meta data field as string.

Any previous value of the field is discarded

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]Valuestring value
Returns
See also
CVSMetaDataGetAsString CVSMetaDataSetAsStringW CVSMetaDataAddToArrayAsString

◆ CVSMetaDataSetAsStringW()

cvbres_t CVSMetaDataSetAsStringW ( CVSMETADATA  MetaData,
CVSField  FieldEnum,
const wchar_t *  Value 
)

Set meta data field as wstring.

Any previous value of the field is discarded

Parameters
[in]MetaDataMeta data handle
[in]FieldEnumField index
[in]Valuewstring value
Returns
See also
CVSMetaDataGetAsStringW CVSMetaDataSetAsString CVSMetaDataAddToArrayAsStringW