OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
epr_band.h
Go to the documentation of this file.
1 /*
2  * $Id: epr_band.h,v 1.1.1.1 2004-10-28 19:22:22 norman Exp $
3  *
4  * Copyright (C) 2002 by Brockmann Consult (info@brockmann-consult.de)
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation. This program is distributed in the hope it will
9  * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
10  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16  */
17 
18 #ifndef EPR_BAND_H_INCL
19 #define EPR_BAND_H_INCL
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #include "epr_ptrarray.h"
26 
27 #include <stdio.h> /* just to get the ANSI-C type FILE */
28 
29 
39 
40 
50 
51 
60 EPR_SDatasetRef epr_get_ref_struct(EPR_SProductId* product_id, const char* str);
61 
62 
71 float epr_get_scaling_factor(EPR_SProductId* product_id, const char* str);
72 float epr_get_scaling_params(EPR_SProductId* product_id, const char* str);
73 
84 int epr_read_band_measurement_data(EPR_SBandId* band_id, int offset_x, int offset_y, EPR_SRaster* raster);
85 
96 int epr_read_band_annotation_data(EPR_SBandId* band_id,
97  int offset_x,
98  int offset_y,
99  EPR_SRaster* raster);
100 
101 
117 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);
118 void decode_line_ushort_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);
119 void decode_line_short_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);
120 void decode_line_short_1_of_2_to_float(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
121 void decode_line_short_2_of_2_to_float(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
122 void decode_line_char_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);
123 void decode_line_uchar_1_of_1_to_uchar(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
124 void decode_line_uchar_1_of_2_to_uchar(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
125 void decode_line_uchar_2_of_2_to_uchar(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
126 void decode_line_ushort_1_of_1_to_ushort(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
127 void decode_line_uchar_1_of_2_to_float(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
128 void decode_line_uchar_2_of_2_to_float(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
129 void decode_line_uchar_2_to_f_to_float(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
130 void decode_line_uchar_3_to_i_to_uint(void* sourceArray, EPR_SBandId* band_id, int xo, int raster_width, int s_x, void* raster_buffer, int raster_pos);
145 void transform_array_short_to_float(void* sourceArray, EPR_SBandId* band_id, float* raster_buffer, epr_uint nel);
146 void transform_array_ushort_to_float(void* sourceArray, EPR_SBandId* band_id, float* raster_buffer, epr_uint nel);
147 void transform_array_int_to_float(void* sourceArray, EPR_SBandId* band_id, float* raster_buffer, epr_uint nel);
148 void transform_array_uint_to_float(void* sourceArray, EPR_SBandId* band_id, float* raster_buffer, epr_uint nel);
160 void mirror_float_array(float* raster_buffer, epr_uint raster_width, epr_uint raster_height);
161 void mirror_uchar_array(epr_uchar* raster_buffer, epr_uint raster_width, epr_uint raster_height);
162 void mirror_ushort_array(epr_ushort* raster_buffer, epr_uint raster_width, epr_uint raster_height);
163 void mirror_uint_array(epr_uint* raster_buffer, epr_uint raster_width, epr_uint raster_height);
178 float epr_interpolate2D(float wi, float wj, float x00, float x10, float x01, float x11);
179 
196 void decode_tiepoint_band(float* sa_beg,
197  float* sa_end,
198  epr_uint samples_per_tie_pt,
199  epr_uint num_elems,
200  EPR_SBandId* band_id,
201  int xo,
202  float scan_offset_x,
203  float y_mod,
204  int raster_width,
205  int s_x,
206  float* raster_buffer,
207  int raster_pos);
208 typedef void (*EPR_FLineDecoder)(void* sourceArray,
209  EPR_SBandId* band_id,
210  int xo,
211  int raster_width,
212  int s_x,
213  void* raster_buffer,
214  int raster_pos);
215 
220 
221 typedef void (*EPR_FArrayTransformer)(void* sourceArray,
222  EPR_SBandId* band_id,
223  float* raster_buffer,
224  epr_uint nel);
225 
230 
239 void epr_zero_invalid_pixels(EPR_SRaster* raster, EPR_SRaster* bm_raster);
240 
246 void epr_free_band_id(EPR_SBandId* band_id);
247 
248 
249 
250 EPR_SPtrArray* epr_create_band_ids(EPR_SProductId* product_id);
251 
252 
253 
254 #ifdef __cplusplus
255 } /* extern "C" */
256 #endif
257 
258 #endif
259 /* #ifndef EPR_BAND_H_INCL */
void decode_line_short_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)
Definition: epr_band.c:1263
void decode_line_uchar_2_to_f_to_float(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1429
void transform_array_uint_to_float(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.c:1680
int epr_read_band_measurement_data(EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
Definition: epr_band.c:689
void decode_line_uchar_1_of_2_to_uchar(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1371
void transform_array_short_to_float(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.c:1644
void transform_array_int_to_float(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.c:1668
unsigned int epr_uint
Definition: epr_api.h:188
void decode_line_ushort_1_of_1_to_ushort(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1410
unsigned short epr_ushort
Definition: epr_api.h:187
float epr_interpolate2D(float wi, float wj, float x00, float x10, float x01, float x11)
Definition: epr_band.c:1639
EPR_SDatasetRef epr_get_ref_struct(EPR_SProductId *product_id, const char *str)
Definition: epr_band.c:383
EPR_ESampleModel epr_str_to_sample_offset(const char *str)
Definition: epr_band.c:448
void mirror_uchar_array(epr_uchar *raster_buffer, epr_uint raster_width, epr_uint raster_height)
Definition: epr_band.c:1707
void mirror_ushort_array(epr_ushort *raster_buffer, epr_uint raster_width, epr_uint raster_height)
Definition: epr_band.c:1722
void mirror_float_array(float *raster_buffer, epr_uint raster_width, epr_uint raster_height)
Definition: epr_band.c:1692
EPR_FLineDecoder select_line_decode_function(EPR_EDataTypeId band_daty, EPR_ESampleModel band_smod, EPR_EDataTypeId daty_id)
Definition: epr_band.c:1088
void decode_line_uchar_1_of_2_to_float(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1461
void mirror_uint_array(epr_uint *raster_buffer, epr_uint raster_width, epr_uint raster_height)
Definition: epr_band.c:1737
int epr_read_band_annotation_data(EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
Definition: epr_band.c:820
float epr_get_scaling_factor(EPR_SProductId *product_id, const char *str)
Definition: epr_band.c:352
void decode_line_short_2_of_2_to_float(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1322
EPR_FArrayTransformer select_transform_array_function(EPR_EDataTypeId band_daty, EPR_EDataTypeId daty_id)
Definition: epr_band.c:1155
enum EPR_ScalingMethod EPR_EScalingMethod
Definition: epr_api.h:165
float epr_get_scaling_params(EPR_SProductId *product_id, const char *str)
Definition: epr_band.c:320
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)
Definition: epr_band.c:1173
void decode_line_char_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)
Definition: epr_band.c:1203
What value is used by your function when the data value is bad Default is BAD_FLT l2prod product_id[0]
void epr_zero_invalid_pixels(EPR_SRaster *raster, EPR_SRaster *bm_raster)
Definition: epr_band.c:1752
void(* EPR_FLineDecoder)(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.h:208
enum EPR_SampleModel EPR_ESampleModel
Definition: epr_api.h:164
EPR_EScalingMethod epr_str_to_scaling_method(const char *str)
Definition: epr_band.c:429
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 xo, float scan_offset_x, float y_mod, int raster_width, int s_x, float *raster_buffer, int raster_pos)
Definition: epr_band.c:1557
void decode_line_short_1_of_2_to_float(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1292
const char * str
Definition: l1c_msi.cpp:35
void decode_line_uchar_1_of_1_to_uchar(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1352
void decode_line_uchar_3_to_i_to_uint(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1521
void decode_line_uchar_2_of_2_to_uchar(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1391
void decode_line_ushort_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)
Definition: epr_band.c:1233
enum EPR_DataTypeId EPR_EDataTypeId
Definition: epr_api.h:161
void decode_line_uchar_2_of_2_to_float(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1492
void(* EPR_FArrayTransformer)(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.h:221
void epr_free_band_id(EPR_SBandId *band_id)
Definition: epr_band.c:284
unsigned char epr_uchar
Definition: epr_api.h:186
EPR_SPtrArray * epr_create_band_ids(EPR_SProductId *product_id)
Definition: epr_band.c:43
void transform_array_ushort_to_float(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.c:1656