?? epr_api.h
字號:
/* * $Id: epr_api.h,v 1.3 2003/03/21 16:11:46 norman Exp $ * * Copyright (C) 2002 by Brockmann Consult (info@brockmann-consult.de) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation. This program is distributed in the hope it will * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#ifndef EPR_API_H_INCL#define EPR_API_H_INCL #ifdef __cplusplusextern "C" {#endif/* to make the FILE structure available */#include <stdio.h> /* to make dynamic arrays available*/#include "epr_ptrarray.h"#define EPR_PRODUCT_API_NAME_STR "ENVISAT Product Reader API"#define EPR_PRODUCT_API_VERSION_STR "2.0.1"/** * The <code>EPR_DataTypeId</code> enumeration lists all possible data * types for field elements in ENVISAT dataset records. */enum EPR_DataTypeId{ /** The ID for unknown types. */ e_tid_unknown = 0, /** An array of unsigned 8-bit integers, C type is <code>uchar*</code> */ e_tid_uchar = 1, /** An array of signed 8-bit integers, C type is <code>char*</code> */ e_tid_char = 2, /** An array of unsigned 16-bit integers, C type is <code>ushort*</code> */ e_tid_ushort = 3, /** An array of signed 16-bit integers, C type is <code>short*</code> */ e_tid_short = 4, /** An array of unsigned 32-bit integers, C type is <code>ulong*</code> */ e_tid_ulong = 5, /** An array of signed 32-bit integers, C type is <code>long*</code> */ e_tid_long = 6, /** An array of 32-bit floating point numbers, C type is <code>float*</code> */ e_tid_float = 7, /** An array of 64-bit floating point numbers, C type is <code>double*</code> */ e_tid_double = 8, /** A zero-terminated ASCII string, C type is <code>char*</code> */ e_tid_string = 11, /** An array of unsigned character, C type is <code>uchar*</code> */ e_tid_spare = 13, /** A time (MJD) structure, C type is <code>EPR_Time</code> */ e_tid_time = 21};/** * The <code>EPR_ErrCode</code> enumeration lists all possible error * codes for the ENVISAT product reader API. */enum EPR_ErrCode{ /* Not an error */ e_err_none = 0, /* Low level errors */ e_err_null_pointer = 1, e_err_illegal_arg = 2, e_err_illegal_state = 3, e_err_out_of_memory = 4, e_err_index_out_of_range = 5, e_err_illegal_conversion = 6, e_err_illegal_data_type = 7, /* I/O errors */ e_err_file_not_found = 101, e_err_file_access_denied = 102, e_err_file_read_error = 103, e_err_file_write_error = 104, e_err_file_open_failed = 105, e_err_file_close_failed = 106, /* API related errors */ e_err_api_not_initialized = 201, e_err_invalid_product_id = 203, e_err_invalid_record = 204, e_err_invalid_band = 205, e_err_invalid_raster = 206, e_err_invalid_dataset_name = 207, e_err_invalid_field_name = 208, e_err_invalid_record_name = 209, e_err_invalid_product_name = 210, e_err_invalid_band_name = 211, e_err_invalid_data_format = 212, e_err_invalid_value = 213, e_err_invalid_keyword_name = 214, e_err_unknown_endian_order = 216, /* Bitmask term errors */ e_err_flag_not_found = 301, /* DDDB errors */ e_err_invalid_ddbb_format = 402};/** * The <code>EPR_LogLevel</code> enumeration lists possible log levels * for the ENVISAT product reader API. */enum EPR_LogLevel{ e_log_debug = -1, e_log_info = 0, e_log_warning = 1, e_log_error = 2};enum EPR_SampleModel{ e_smod_1OF1 = 0, e_smod_1OF2 = 1, e_smod_2OF2 = 2, e_smod_3TOI = 3, e_smod_2TOF = 4};enum EPR_ScalingMethod{ e_smid_non = 0, e_smid_lin = 1, e_smid_log = 2};struct EPR_ProductId;struct EPR_DatasetId;struct EPR_BandId;struct EPR_Record;struct EPR_RecordInfo;struct EPR_Field;struct EPR_FieldInfo;struct EPR_ProductInfo;struct EPR_DSD;struct EPR_Raster;struct EPR_DatasetRef;struct EPR_Flag;struct EPR_BandId;struct EPR_ParamElem;struct EPR_Time;typedef enum EPR_DataTypeId EPR_EDataTypeId;typedef enum EPR_ErrCode EPR_EErrCode;typedef enum EPR_LogLevel EPR_ELogLevel;typedef enum EPR_SampleModel EPR_ESampleModel;typedef enum EPR_ScalingMethod EPR_EScalingMethod;typedef struct EPR_ProductId EPR_SProductId;typedef struct EPR_DatasetId EPR_SDatasetId;typedef struct EPR_BandId EPR_SBandId;typedef struct EPR_Record EPR_SRecord;typedef struct EPR_RecordInfo EPR_SRecordInfo;typedef struct EPR_Field EPR_SField;typedef struct EPR_FieldInfo EPR_SFieldInfo;typedef struct EPR_DSD EPR_SDSD;typedef struct EPR_Raster EPR_SRaster;typedef struct EPR_FlagDef EPR_SFlagDef;typedef struct EPR_ParamElem EPR_SParamElem;typedef struct EPR_Time EPR_STime;typedef struct EPR_DatasetRef EPR_SDatasetRef;typedef struct EPR_BitmaskTerm EPR_SBitmaskTerm;typedef struct EPR_FlagSet EPR_SFlagSet;typedef void (*EPR_FErrHandler)(EPR_EErrCode err_code, const char* err_message);typedef void (*EPR_FLogHandler)(EPR_ELogLevel log_level, const char* log_message);typedef int boolean;typedef unsigned char uchar;typedef unsigned short ushort;typedef unsigned int uint;typedef unsigned long ulong;typedef long EPR_Magic;#define EPR_MAGIC_PRODUCT_ID 0xCAFFEE64#define EPR_MAGIC_DATASET_ID 0xEFEABDCA#define EPR_MAGIC_BAND_ID 0xFEC21ABD#define EPR_MAGIC_RECORD 0x7BABACAE#define EPR_MAGIC_FIELD 0xBA0BABBA#define EPR_MAGIC_RASTER 0x0BABA0EB#define EPR_MAGIC_FLAG_DEF 0xCABA11AD#define TRUE 1#define FALSE 0#define EPR_PRODUCT_ID_STRLEN 48/*************************************************************************//******************************** STRUCTURES *****************************//*************************************************************************//** * The <code>EPR_ProductId</code> structure contains information * about an ENVISAT product file which has been opened with the * <code>epr_open_product()</code> function. * * @see epr_open_product */struct EPR_ProductId{ /** * The magic number for this structure. * IMPORTANT: This must always be the first member of this structure. */ EPR_Magic magic; /** * The file's path including the file name. */ char* file_path; /** * The input stream as returned by the ANSI C <code>fopen</code> * function for the given file path. */ FILE* istream; /** * The total size in bytes of the product file. */ uint tot_size; /** * The total width of product's scene raster in pixels. */ uint scene_width; /** * The total height of product's scene raster in pixels. */ uint scene_height; /** * The product identifier string obtained from the MPH * parameter 'PRODUCT'. * <p>The first 10 characters of this string identify the * the product type, e.g. "MER_1P__FR" for a MERIS Level 1b * full resolution product. The rest of the string decodes * product instance properties. */ char id_string[EPR_PRODUCT_ID_STRLEN + 1]; /** * The record representing the main product header (MPH). */ EPR_SRecord* mph_record; /** * The record representing the specific product header (SPH). */ EPR_SRecord* sph_record; /** * An array containing all (!) DSDs read from the product's * specific product header (SPH). */ EPR_SPtrArray* dsd_array; /** * Cache for record infos. Contains all record infos read * from the database for this file so far. * * The reason for caching record infos on a per-file-base is that * a some record infos instances can contain file related content * such as the number of pixels in a measurecment dataset record * (MDSR). */ EPR_SPtrArray* record_info_cache; /** * A table containing dynamic field info parameters. * Dynamic field info parameters are created at runtime because * the are derived from the product file contents and can * not be staically stored in the record info database. */ EPR_SPtrArray* param_table; /** * Contains and array of all dataset IDs for the product (type EPR_SDatasetId*) */ EPR_SPtrArray* dataset_ids; /** * Contains and array of all band IDs for the product (type EPR_SBandId*) */ EPR_SPtrArray* band_ids; /** * For MERIS L1b and RR and FR to provide backward compatibility */ int meris_iodd_version;};/** * The <code>EPR_DatasetId</code> structure contains information * about a dataset within an ENVISAT product file which has been opened with the * <code>epr_open_product()</code> API function. * * A new <code>EPR_DatasetId</code> instance can be obtained with the * <code>epr_get_dataset_id()</code> or <code>epr_get_dataset_id_at()</code> API functions. * * @see epr_open_product * @see epr_get_dataset_id * @see epr_get_dataset_id_at */struct EPR_DatasetId{ /** * The magic number for this structure. * IMPORTANT: This must always be the first member of this structure. */ EPR_Magic magic; /** * The ID of the product to which this dataset belongs to. */ EPR_SProductId* product_id; /** * The name as presented to the user in a dsd selection dialog */ char* dsd_name; /** * The dataset descriptor obtained from the current product. */ const EPR_SDSD* dsd; /** * The name as presented to the user in a dataset selection dialog */ char* dataset_name; /** * The record descriptor found in the DDDB for this dataset. */ const struct RecordDescriptor* record_descriptor;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -