ocssw
V2022
|
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "epr_api.h"
#include "epr_core.h"
#include "epr_string.h"
#include "epr_ptrarray.h"
#include "epr_swap.h"
#include "epr_field.h"
#include "epr_record.h"
#include "epr_param.h"
#include "epr_dsd.h"
#include "epr_msph.h"
#include "epr_band.h"
#include "epr_bitmask.h"
#include "epr_dddb.h"
Go to the source code of this file.
Functions | |
EPR_SPtrArray * | epr_create_band_ids (EPR_SProductId *product_id) |
epr_uint | epr_get_num_bands (EPR_SProductId *product_id) |
EPR_SBandId * | epr_get_band_id_at (EPR_SProductId *product_id, epr_uint index) |
EPR_SBandId * | epr_get_band_id (EPR_SProductId *product_id, const char *band_name) |
const char * | epr_get_band_name (EPR_SBandId *band_id) |
void | epr_free_band_id (EPR_SBandId *band_id) |
float | epr_get_scaling_params (EPR_SProductId *product_id, const char *str) |
float | epr_get_scaling_factor (EPR_SProductId *product_id, const char *str) |
EPR_SDatasetRef | epr_get_ref_struct (EPR_SProductId *product_id, const char *str) |
EPR_EScalingMethod | epr_str_to_scaling_method (const char *str) |
EPR_ESampleModel | epr_str_to_sample_offset (const char *str) |
EPR_SRaster * | epr_create_bitmask_raster (epr_uint source_width, epr_uint source_height, epr_uint source_step_x, epr_uint source_step_y) |
EPR_SRaster * | epr_create_raster (EPR_EDataTypeId data_type, epr_uint source_width, epr_uint source_height, epr_uint source_step_x, epr_uint source_step_y) |
EPR_SRaster * | epr_create_compatible_raster (EPR_SBandId *band_id, epr_uint source_width, epr_uint source_height, epr_uint source_step_x, epr_uint source_step_y) |
void | epr_free_raster (EPR_SRaster *raster) |
int | epr_read_band_raster (EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster) |
int | epr_read_band_measurement_data (EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster) |
int | epr_read_band_annotation_data (EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster) |
epr_uint | epr_get_raster_elem_size (const EPR_SRaster *raster) |
void * | epr_get_raster_elem_addr (const EPR_SRaster *raster, epr_uint offset) |
void * | epr_get_raster_pixel_addr (const EPR_SRaster *raster, epr_uint x, epr_uint y) |
void * | epr_get_raster_line_addr (const EPR_SRaster *raster, epr_uint y) |
epr_uint | epr_get_raster_width (EPR_SRaster *raster) |
epr_uint | epr_get_raster_height (EPR_SRaster *raster) |
EPR_FLineDecoder | select_line_decode_function (EPR_EDataTypeId band_tid, EPR_ESampleModel band_smod, EPR_EDataTypeId raw_tid) |
EPR_FArrayTransformer | select_transform_array_function (EPR_EDataTypeId band_tid, EPR_EDataTypeId raw_tid) |
void | decode_line_uchar_1_of_1_to_float (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_char_1_of_1_to_float (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_ushort_1_of_1_to_float (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_short_1_of_1_to_float (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_short_1_of_2_to_float (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_short_2_of_2_to_float (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_uchar_1_of_1_to_uchar (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_uchar_1_of_2_to_uchar (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_uchar_2_of_2_to_uchar (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_ushort_1_of_1_to_ushort (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_uchar_2_to_f_to_float (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_uchar_1_of_2_to_float (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_uchar_2_of_2_to_float (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_line_uchar_3_to_i_to_uint (void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos) |
void | decode_tiepoint_band (float *sa_beg, float *sa_end, epr_uint samples_per_tie_pt, epr_uint num_elems, EPR_SBandId *band_id, int offset_x, float scan_offset_x, float y_mod, int raster_width, int s_x, float *raster_buffer, int raster_pos) |
float | epr_interpolate2D (float wi, float wj, float x00, float x10, float x01, float x11) |
void | transform_array_short_to_float (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel) |
void | transform_array_ushort_to_float (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel) |
void | transform_array_int_to_float (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel) |
void | transform_array_uint_to_float (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel) |
void | mirror_float_array (float *raster_buffer, epr_uint raster_width, epr_uint raster_height) |
void | mirror_uchar_array (epr_uchar *raster_buffer, epr_uint raster_width, epr_uint raster_height) |
void | mirror_ushort_array (epr_ushort *raster_buffer, epr_uint raster_width, epr_uint raster_height) |
void | mirror_uint_array (epr_uint *raster_buffer, epr_uint raster_width, epr_uint raster_height) |
void | epr_zero_invalid_pixels (EPR_SRaster *raster, EPR_SRaster *bm_raster) |
Function Documentation
◆ decode_line_char_1_of_1_to_float()
void decode_line_char_1_of_1_to_float | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1203 of file epr_band.c.
◆ decode_line_short_1_of_1_to_float()
void decode_line_short_1_of_1_to_float | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1263 of file epr_band.c.
◆ decode_line_short_1_of_2_to_float()
void decode_line_short_1_of_2_to_float | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1292 of file epr_band.c.
◆ decode_line_short_2_of_2_to_float()
void decode_line_short_2_of_2_to_float | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1322 of file epr_band.c.
◆ decode_line_uchar_1_of_1_to_float()
void decode_line_uchar_1_of_1_to_float | ( | void * | sourceArray, |
EPR_SBandId * | band_id, | ||
int | xo, | ||
int | raster_width, | ||
int | s_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
This group of functions is for scaling the field element for a physical measurement values.
The type is located in the field info.
One field must have one type only.
- Parameters
-
sourceArray the sourse array identifier (to be scaled) band_id the band ID with the information about the field's physical properties xo [PIXEL] X-coordinate (0-bazed) of the upper right corner raster to search raster_width [PIXEL] the width of the raster is been research s_x X-step to get the next raster to search raster_buffer [BYTE] the memory buffer to save information was scaled raster_pos shows the point of filling of the array raster_buffer
Definition at line 1173 of file epr_band.c.
◆ decode_line_uchar_1_of_1_to_uchar()
void decode_line_uchar_1_of_1_to_uchar | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1352 of file epr_band.c.
◆ decode_line_uchar_1_of_2_to_float()
void decode_line_uchar_1_of_2_to_float | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1461 of file epr_band.c.
◆ decode_line_uchar_1_of_2_to_uchar()
void decode_line_uchar_1_of_2_to_uchar | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1371 of file epr_band.c.
◆ decode_line_uchar_2_of_2_to_float()
void decode_line_uchar_2_of_2_to_float | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1492 of file epr_band.c.
◆ decode_line_uchar_2_of_2_to_uchar()
void decode_line_uchar_2_of_2_to_uchar | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1391 of file epr_band.c.
◆ decode_line_uchar_2_to_f_to_float()
void decode_line_uchar_2_to_f_to_float | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1429 of file epr_band.c.
◆ decode_line_uchar_3_to_i_to_uint()
void decode_line_uchar_3_to_i_to_uint | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1521 of file epr_band.c.
◆ decode_line_ushort_1_of_1_to_float()
void decode_line_ushort_1_of_1_to_float | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1233 of file epr_band.c.
◆ decode_line_ushort_1_of_1_to_ushort()
void decode_line_ushort_1_of_1_to_ushort | ( | void * | source_array, |
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
int | raster_width, | ||
int | step_x, | ||
void * | raster_buffer, | ||
int | raster_pos | ||
) |
Definition at line 1410 of file epr_band.c.
◆ decode_tiepoint_band()
void decode_tiepoint_band | ( | float * | sa_beg, |
float * | sa_end, | ||
epr_uint | samples_per_tie_pt, | ||
epr_uint | num_elems, | ||
EPR_SBandId * | band_id, | ||
int | offset_x, | ||
float | scan_offset_x, | ||
float | y_mod, | ||
int | raster_width, | ||
int | s_x, | ||
float * | raster_buffer, | ||
int | raster_pos | ||
) |
Computes the physical values for the annotation data.
- Parameters
-
sa_beg the float array of tie points "before" Y-coordinate of the point to search sa_end the float array of tie points "after" Y-coordinate of the point to search samples_per_tie_pt the "distance" between two neighbour tie points (in scan-line direction) num_elems number of elements in one tie point scan-line band_id the information about properties and quantities of ENVISAT data. offset_x [PIXEL] X-coordinate (0-based) of the upper right raster corner to search y_mod [PIXEL] relative location of the point is being searched for (in flight direction) raster_width [PIXEL] the width of the raster is being searched for s_x [PIXEL] X-step to get the next point (in source coordinates) to search raster_buffer the float user array to be filled with physical values raster_pos the actual "filled" position in raster_buffer-array
Definition at line 1557 of file epr_band.c.
◆ epr_create_band_ids()
EPR_SPtrArray* epr_create_band_ids | ( | EPR_SProductId * | product_id | ) |
Obtains all bands infos from the dddb.
Definition at line 43 of file epr_band.c.
◆ epr_free_band_id()
void epr_free_band_id | ( | EPR_SBandId * | band_id | ) |
Release the memory allocated through a band ID.
- Parameters
-
band the dataset description identifier, if NULL
the function immediately returns zero.
- Returns
- zero for success, an error code otherwise
Definition at line 284 of file epr_band.c.
◆ epr_get_ref_struct()
EPR_SDatasetRef epr_get_ref_struct | ( | EPR_SProductId * | product_id, |
const char * | str | ||
) |
Gets the dataset_id, field_index and elem_index
- Parameters
-
product_id the the product file identifier str the string with the name, separator ('.') and indexes.
- Returns
- the dataset_id, field_index and elem_index (-1 if no).
NULL
if correspondent dataset name was not found.
Definition at line 383 of file epr_band.c.
◆ epr_get_scaling_factor()
float epr_get_scaling_factor | ( | EPR_SProductId * | product_id, |
const char * | str | ||
) |
Gets the scaling factor by the given dataset_id, field_index, elem_index
- Parameters
-
product_id the the product file identifier str the string with the name, separator ('.') and indexes.
- Returns
- the dataset_id, field_index and elem_index (-1 if no).
NULL
if correspondent dataset name was not found.
Definition at line 352 of file epr_band.c.
◆ epr_get_scaling_params()
float epr_get_scaling_params | ( | EPR_SProductId * | product_id, |
const char * | str | ||
) |
Gets the scaling params: factor or offset by the given dataset_id, field_index, elem_index
- Parameters
-
product_id the the product file identifier str the string with the name, separator ('.') and indexes.
- Returns
- the dataset_id, field_index and elem_index (-1 if no).
NULL
if correspondent dataset name was not found.
Definition at line 320 of file epr_band.c.
◆ epr_interpolate2D()
float epr_interpolate2D | ( | float | wi, |
float | wj, | ||
float | x00, | ||
float | x10, | ||
float | x01, | ||
float | x11 | ||
) |
Two dimenzional interpolation
- Parameters
-
wi the interpolation point location in [0,1] in "horizontal" direction wj the interpolation point location in [0,1] in "vertical" direction x00 the first point in "horizontal" direction x10 the second point in "horizontal" direction x01 the first point in "vertical" direction x11 the second point in "vertical" direction
- Returns
- float interpolated value
Definition at line 1639 of file epr_band.c.
◆ epr_read_band_annotation_data()
int epr_read_band_annotation_data | ( | EPR_SBandId * | band_id, |
int | offset_x, | ||
int | offset_y, | ||
EPR_SRaster * | raster | ||
) |
Reads the annotation data and converts its into physical values.
- Parameters
-
band_id the information about properties and quantities of ENVISAT data. offset_x X-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search offset_y Y-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search raster the instance to the buffer information was used
- Returns
- zero for success, an error code otherwise
! was 0.5F !!
! was 0.5F !!
! EPR-7: was 0.5F !!
Definition at line 820 of file epr_band.c.
◆ epr_read_band_measurement_data()
int epr_read_band_measurement_data | ( | EPR_SBandId * | band_id, |
int | offset_x, | ||
int | offset_y, | ||
EPR_SRaster * | raster | ||
) |
Reads the measurement data and converts its into physical values.
- Parameters
-
band_id the information about properties and quantities of ENVISAT data. offset_x X-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search offset_y Y-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search raster the instance to the buffer information was used
- Returns
- zero for success, an error code otherwise
Definition at line 689 of file epr_band.c.
◆ epr_str_to_sample_offset()
EPR_ESampleModel epr_str_to_sample_offset | ( | const char * | str | ) |
Converts the given string into a sample offset identifier.
- Parameters
-
str the string to be converted.
- Returns
- the sample offset identifier represented by the given string. If the string is equal of '*' the value
e_none_samoff
is returned.
Definition at line 448 of file epr_band.c.
◆ epr_str_to_scaling_method()
EPR_EScalingMethod epr_str_to_scaling_method | ( | const char * | str | ) |
Converts the given string into a scaling method identifier.
- Parameters
-
str the string to be converted.
- Returns
- the scaling method identifier represented by the given string. If the string is equal of '*' the value
e_non_smid
is returned.
Definition at line 429 of file epr_band.c.
◆ epr_zero_invalid_pixels()
void epr_zero_invalid_pixels | ( | EPR_SRaster * | raster, |
EPR_SRaster * | bm_raster | ||
) |
Masks the band information out. The band information will be masked dependent on bit mask filter for the same selected area (described in raster).
- Parameters
-
raster selected and physically processed the ENVISAT product data band information bm_raster selected the ENVISAT flag bit mask filter
Definition at line 1752 of file epr_band.c.
◆ mirror_float_array()
This group of functions is for mirroring the scaled line of a physical MERIS values.
- Parameters
-
raster_buffer [BYTE] the memory buffer to be Y-mirrored raster_width [PIXEL] the width of the raster is been Y-mirrored raster_height [PIXEL] the height of the raster is been Y-mirrored
Definition at line 1692 of file epr_band.c.
◆ mirror_uchar_array()
void mirror_uchar_array | ( | epr_uchar * | raster_buffer, |
epr_uint | raster_width, | ||
epr_uint | raster_height | ||
) |
Definition at line 1707 of file epr_band.c.
◆ mirror_uint_array()
Definition at line 1737 of file epr_band.c.
◆ mirror_ushort_array()
void mirror_ushort_array | ( | epr_ushort * | raster_buffer, |
epr_uint | raster_width, | ||
epr_uint | raster_height | ||
) |
Definition at line 1722 of file epr_band.c.
◆ select_line_decode_function()
EPR_FLineDecoder select_line_decode_function | ( | EPR_EDataTypeId | band_daty, |
EPR_ESampleModel | band_smod, | ||
EPR_EDataTypeId | daty_id | ||
) |
Selects the line decode function, depended on measurement data type.
Definition at line 1088 of file epr_band.c.
◆ select_transform_array_function()
EPR_FArrayTransformer select_transform_array_function | ( | EPR_EDataTypeId | band_daty, |
EPR_EDataTypeId | daty_id | ||
) |
Selects the transform array function, dependent on annotation data type.
Definition at line 1155 of file epr_band.c.
◆ transform_array_int_to_float()
void transform_array_int_to_float | ( | void * | sourceArray, |
EPR_SBandId * | band_id, | ||
float * | raster_buffer, | ||
epr_uint | nel | ||
) |
Definition at line 1668 of file epr_band.c.
◆ transform_array_short_to_float()
void transform_array_short_to_float | ( | void * | sourceArray, |
EPR_SBandId * | band_id, | ||
float * | raster_buffer, | ||
epr_uint | nel | ||
) |
This group of functions is for scaling the field element for a physical annotation values.
The type is located in the field info.
One field must have one type only.
- Parameters
-
sourceArray the sourse array identifier (to be scaled) band_id the band ID with the information about the field's physical properties raster_buffer [BYTE] the memory buffer to save information was scaled nel number of element to scale
Definition at line 1644 of file epr_band.c.
◆ transform_array_uint_to_float()
void transform_array_uint_to_float | ( | void * | sourceArray, |
EPR_SBandId * | band_id, | ||
float * | raster_buffer, | ||
epr_uint | nel | ||
) |
Definition at line 1680 of file epr_band.c.
◆ transform_array_ushort_to_float()
void transform_array_ushort_to_float | ( | void * | sourceArray, |
EPR_SBandId * | band_id, | ||
float * | raster_buffer, | ||
epr_uint | nel | ||
) |
Definition at line 1656 of file epr_band.c.