亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? epr_product.c

?? Insar圖像處理軟件
?? C
字號(hào):
/* * $Id: epr_product.c,v 1.2 2003/03/21 16:08:08 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. */#include <assert.h>#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.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_dataset.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"ulong epr_compute_scene_width(const EPR_SProductId* product_id);ulong epr_compute_scene_height(const EPR_SProductId* product_id);/*********************************** PRODUCT ***********************************//*   Function:    epr_open_product   Access:      public API   Changelog:   2002/01/05  nf initial version *//** * Opens the ENVISAT product file with the given file path */EPR_SProductId* epr_open_product(const char* product_file_path){    EPR_SProductId* product_id = NULL;    char message_buffer[80];        int s_par;    ulong compare_ok = 0;    epr_clear_err();    if (!epr_check_api_init_flag()) {        return NULL;    }    if (product_file_path == NULL) {            epr_set_err(e_err_null_pointer,                     "epr_open_product: product file path must not be NULL");        return NULL;    }    product_id = (EPR_SProductId*) calloc(1, sizeof (EPR_SProductId));    if (product_id == NULL) {        epr_set_err(e_err_out_of_memory,                     "epr_open_product: out of memory");        return NULL;    }    product_id->magic = EPR_MAGIC_PRODUCT_ID;    epr_assign_string(&product_id->file_path, product_file_path);    if (product_id->file_path == NULL) {        epr_set_err(e_err_out_of_memory,                     "epr_open_product: out of memory");        return NULL;    }    /* Convert to OS compatible path */    epr_make_os_compatible_path(product_id->file_path);    product_id->istream = fopen(epr_trim_string(product_id->file_path), "rb");    if (product_id->istream == NULL) {                if (errno == ENOENT) {            epr_set_err(e_err_file_not_found,                         "epr_open_product: file not found");        } else {            epr_set_err(e_err_file_access_denied,                         "epr_open_product: file open failed");        }        return NULL;    }    epr_log(e_log_debug, "Product:");    epr_log(e_log_debug, epr_trim_string(product_id->file_path));         /* Set file pointer to start of product identifier */    if (fseek(product_id->istream, EPR_PRODUCT_ID_OFFSET, SEEK_SET) != 0) {        epr_set_err(e_err_file_access_denied,                     "epr_open_product: file seek failed");        return NULL;    }    if (fread(product_id->id_string,               1,               EPR_PRODUCT_ID_STRLEN,               product_id->istream) != (uint) EPR_PRODUCT_ID_STRLEN) {        epr_set_err(e_err_file_access_denied,                     "epr_open_product: file read failed");        return NULL;    }       /* Product identifier filter*/    if ((strncmp(EPR_ENVISAT_PRODUCT_MERIS, product_id->id_string, 3) != 0) &&        (strncmp(EPR_ENVISAT_PRODUCT_ASAR,  product_id->id_string, 3) != 0) &&        (strncmp(EPR_ENVISAT_PRODUCT_AATSR, product_id->id_string, 3) != 0)){        epr_set_err(e_err_invalid_product_id,                     "epr_open_product: invalid product identifier");        return NULL;    }    /* Set file to end of file in order to determine file size */    if (fseek(product_id->istream, 0, SEEK_END) != 0)    {        epr_set_err(e_err_file_access_denied,                     "epr_open_product: file seek failed");        return NULL;    }    /* Get file size */    product_id->tot_size = (uint) ftell(product_id->istream);    if (product_id->tot_size == (uint) -1) {        epr_set_err(e_err_file_access_denied,                     "epr_open_product: failed to determine file size");        return NULL;    }    sprintf(message_buffer, "product size: %u", product_id->tot_size);    epr_log(e_log_debug, message_buffer);        /* Set file pointer back to start */    if (fseek(product_id->istream, 0, SEEK_SET) != 0) {        epr_set_err(e_err_file_access_denied,                     "epr_open_product: file seek failed");        return NULL;    }    product_id->record_info_cache = epr_create_ptr_array(32);    product_id->param_table = epr_create_param_table();    epr_log(e_log_info, "reading MPH");    product_id->mph_record = epr_read_mph(product_id);    epr_log(e_log_info, "reading SPH");    product_id->sph_record = epr_read_sph(product_id);    s_par = epr_set_dyn_dddb_params(product_id);    epr_log(e_log_info, "reading all DSDs");    product_id->dsd_array = epr_read_all_dsds(product_id);    compare_ok = epr_compare_param(product_id);    if (compare_ok == 0) {        epr_set_err(e_err_invalid_value,                     "epr_open_product: MPH_SIZE+SPH_SIZE must be equal to DSD[0].DS_OFFSET");        return NULL;    }    epr_log(e_log_info, "detect iodd version");	product_id->meris_iodd_version = epr_detect_meris_iodd_version(product_id);	if (product_id->meris_iodd_version == -1) {        epr_set_err(e_err_invalid_value,                     "epr_open_product: unknown product format");        return NULL;    }    epr_log(e_log_info, "creating dataset identifiers");    product_id->dataset_ids = epr_create_dataset_ids(product_id);    epr_log(e_log_info, "creating band identifiers");    product_id->band_ids = epr_create_band_ids(product_id);    /* Get scene size */    product_id->scene_width = epr_compute_scene_width(product_id);    product_id->scene_height = epr_compute_scene_height(product_id);    sprintf(message_buffer, "product scene raster size: %u x %u", product_id->scene_width, product_id->scene_height);    epr_log(e_log_debug, message_buffer);    return product_id;}/*   Function:    epr_close_product   Access:      public API   Changelog:   2002/01/05  nf initial version *//** * Closes the ENVISAT product file determined by the gibven file identifier. */int epr_close_product(EPR_SProductId* product_id){    /* Nothing to close, return */    if (product_id == NULL) {        return e_err_none;    }    epr_clear_err();    if (!epr_check_api_init_flag()) {        return epr_get_last_err_code();    }    assert(product_id->istream != NULL);    if (fclose(product_id->istream) != 0) {        epr_set_err(e_err_file_close_failed,                     "epr_close_product: product file close failed");        return epr_get_last_err_code();    }    product_id->istream = NULL;    epr_log(e_log_info, "product closed: file path: ");    epr_log(e_log_info, product_id->file_path);    epr_free_product_id(product_id);    return e_err_none;}/*   Function:    epr_free_product_id   Access:      private API implementation helper   Changelog:   2002/01/05  nf initial version *//** * Destructor for an <code>EPR_SProductId</code> structure instance. *  * @param product_id the product file identifier to be destructed */void epr_free_product_id(EPR_SProductId* product_id){    if (product_id == NULL)        return;    product_id->istream = NULL;    epr_free_string(product_id->file_path);    product_id->file_path = NULL;    product_id->id_string[0] = '\0';        epr_free_param_table(product_id->param_table);    product_id->param_table = NULL;    if (product_id->record_info_cache != NULL) {        EPR_SRecordInfo* record_info = NULL;        uint record_info_index = 0;        for (record_info_index = 0; record_info_index < product_id->record_info_cache->length; record_info_index++) {            record_info = (EPR_SRecordInfo*)epr_get_ptr_array_elem_at(product_id->record_info_cache, record_info_index);            epr_free_record_info(record_info);        }        epr_free_ptr_array(product_id->record_info_cache);        product_id->record_info_cache = NULL;    }    if (product_id->dsd_array != NULL) {        EPR_SDSD* dsd = NULL;        uint dsd_index = 0;        for (dsd_index = 0; dsd_index < product_id->dsd_array->length; dsd_index++) {            dsd = (EPR_SDSD*)epr_get_ptr_array_elem_at(product_id->dsd_array, dsd_index);            epr_free_dsd(dsd);        }        epr_free_ptr_array(product_id->dsd_array);        product_id->dsd_array = NULL;    }    if (product_id->mph_record != NULL) {        epr_free_record(product_id->mph_record);        product_id->mph_record = NULL;    }    if (product_id->sph_record != NULL) {        epr_free_record(product_id->sph_record);        product_id->sph_record = NULL;    }    if (product_id->dataset_ids != NULL) {        EPR_SDatasetId* dataset_id = NULL;        uint d_index = 0;        for (d_index = 0; d_index < product_id->dataset_ids->length; d_index++) {            dataset_id = (EPR_SDatasetId*)epr_get_ptr_array_elem_at(product_id->dataset_ids, d_index);            epr_free_dataset_id(dataset_id);        }        epr_free_ptr_array(product_id->dataset_ids);        product_id->dataset_ids = NULL;    }    if (product_id->band_ids != NULL) {        EPR_SBandId* band_id = NULL;        uint b_index = 0;        for (b_index = 0; b_index < product_id->band_ids->length; b_index++) {            band_id = (EPR_SBandId*)epr_get_ptr_array_elem_at(product_id->band_ids, b_index);            epr_free_band_id(band_id);        }        epr_free_ptr_array(product_id->band_ids);        product_id->band_ids = NULL;    }    product_id->tot_size = 0;        free(product_id);}/** * Gets the scene width in pixel. * * @param product_id the product identifier, must not be <code>NULL</code> * @return width pixel number, or <code>0</code> if an error occured. */ulong epr_get_scene_width(const EPR_SProductId* product_id){    epr_clear_err();    if (product_id == NULL) {            epr_set_err(e_err_null_pointer,                     "epr_get_scene_width: product_id must not be NULL");        return (ulong)0;    }    return product_id->scene_width;}/** * Gets the scene height in pixel. * * @param product_id the product identifier, must not be <code>NULL</code> * @return height pixel number, or <code>0</code> if an error occured. */ulong epr_get_scene_height(const EPR_SProductId* product_id){    epr_clear_err();    if (product_id == NULL) {            epr_set_err(e_err_null_pointer,                     "epr_get_scene_height: product_id must not be NULL");        return (ulong)0;    }    return product_id->scene_height;}/*********************************** RECORD ***********************************/EPR_SRecord* epr_get_sph(const EPR_SProductId* product_id){    epr_clear_err();    if (product_id == NULL) {        epr_set_err(e_err_null_pointer,                     "epr_get_sph: product-identifier must not be NULL");        return NULL;        }    return product_id->sph_record;}EPR_SRecord* epr_get_mph(const EPR_SProductId* product_id){    epr_clear_err();    if (product_id == NULL) {        epr_set_err(e_err_null_pointer,                     "epr_get_mph: product-identifier must not be NULL");        return NULL;        }    return product_id->mph_record;}/** * Gets the scene width in pixel. * * @param product_id the product identifier, must not be <code>NULL</code> * * @return width pixel number, or <code>0</code> if an error occured. */ulong epr_compute_scene_width(const EPR_SProductId* product_id){    EPR_SRecord* sph_record = NULL;    ulong scan_line_length;    if (product_id == NULL) {        epr_set_err(e_err_null_pointer,                     "epr_compute_scene_width: product ID must not be NULL");        return (ulong)0;        }    sph_record = product_id->sph_record;    if (strncmp(EPR_ENVISAT_PRODUCT_MERIS, product_id->id_string, 3) == 0){        const EPR_SField* field = field = epr_get_field(sph_record, "LINE_LENGTH");        scan_line_length = epr_get_field_elem_as_ulong(field, 0);    } else if (strncmp(EPR_ENVISAT_PRODUCT_AATSR, product_id->id_string, 3) == 0){        scan_line_length = EPR_ATS_LINE_LENGTH;    } else if (strncmp(EPR_ENVISAT_PRODUCT_ASAR, product_id->id_string, 3) == 0){        const EPR_SField* field = field = epr_get_field(sph_record, "LINE_LENGTH");        scan_line_length = epr_get_field_elem_as_ulong(field, 0);    } else {        epr_set_err(e_err_illegal_arg,                     "epr_compute_scene_width: unknown product type");        scan_line_length = (ulong)0;    }    return scan_line_length;}/** * Computes the scene height in pixel of a product. The scene height is * the minimum number of records in all measurement datasets. * * @param product_id the product identifier, must not be <code>NULL</code> * @return height pixel number, or <code>0</code> if an error occured. */ulong epr_compute_scene_height(const EPR_SProductId* product_id){    EPR_SDSD* dsd = NULL;    uint min_num_mds_recs = 0;    uint dsd_index;    if (product_id == NULL) {        epr_set_err(e_err_null_pointer,                     "epr_compute_scene_height: product ID must not be NULL");        return (ulong)0;        }    for (dsd_index = 0; dsd_index < product_id->dsd_array->length; dsd_index++) {        dsd = (EPR_SDSD*)epr_get_ptr_array_elem_at(product_id->dsd_array, dsd_index);        if (epr_equal_names(dsd->ds_type, "M")) {            if (dsd->num_dsr > min_num_mds_recs) {                min_num_mds_recs = dsd->num_dsr;            }        }    }    if (min_num_mds_recs == 0) {        epr_set_err(e_err_invalid_data_format,                     "epr_compute_scene_height: product height was zero");        }    return min_num_mds_recs;}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
大美女一区二区三区| 色噜噜狠狠色综合中国| 亚洲免费在线观看视频| 欧美精品日韩一本| 成人av中文字幕| 秋霞午夜鲁丝一区二区老狼| 国产日韩欧美一区二区三区综合| 欧美日韩一级片网站| 高清国产一区二区| 青椒成人免费视频| 亚洲一区二区综合| 中文字幕精品三区| xf在线a精品一区二区视频网站| 欧美在线视频不卡| 9人人澡人人爽人人精品| 男女激情视频一区| 亚洲一区二区精品视频| 国产精品理论片| 精品成人私密视频| 制服视频三区第一页精品| 99精品偷自拍| 国产不卡一区视频| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲国产欧美一区二区三区丁香婷| 国产精品无遮挡| 亚洲精品在线三区| 日韩欧美国产小视频| 欧美日韩精品三区| 色老汉av一区二区三区| 高清视频一区二区| 国产精品996| 国产一区二区三区香蕉| 另类欧美日韩国产在线| 日韩电影在线一区| 午夜成人免费电影| 午夜久久久影院| 天天操天天干天天综合网| 亚洲综合色自拍一区| 亚洲人精品午夜| 中文字幕一区二区三区不卡在线| 中文字幕免费观看一区| 国产精品三级电影| 欧美国产精品久久| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 国产精品免费久久| 国产拍揄自揄精品视频麻豆| 精品国产亚洲在线| 亚洲精品一线二线三线| 久久精品亚洲一区二区三区浴池| www欧美成人18+| 久久久99精品免费观看| 国产日韩视频一区二区三区| 国产日韩欧美电影| 国产精品福利av| 综合久久久久综合| 亚洲综合精品自拍| 日韩成人免费在线| 精品在线亚洲视频| 成人午夜激情视频| 一本一道波多野结衣一区二区| 欧美在线视频全部完| 欧美日本精品一区二区三区| 91精品午夜视频| 精品成人一区二区三区| 欧美高清在线一区| 一区二区三区四区蜜桃| 三级亚洲高清视频| 极品少妇一区二区| 成人aaaa免费全部观看| 在线观看亚洲a| 日韩小视频在线观看专区| 久久久另类综合| 国产精品理伦片| 亚洲成人av免费| 国产伦精品一区二区三区视频青涩| 国产91丝袜在线观看| 色妞www精品视频| 91精品国产91热久久久做人人| 2017欧美狠狠色| 亚洲人成人一区二区在线观看| 亚洲大尺度视频在线观看| 免费亚洲电影在线| www.欧美.com| 日韩一区二区中文字幕| 日本一区二区久久| 亚洲成人动漫一区| 成人精品高清在线| 欧美日韩一区 二区 三区 久久精品| 日韩欧美国产午夜精品| ...av二区三区久久精品| 天天做天天摸天天爽国产一区| 国产精品一区二区久激情瑜伽| 91在线观看污| 日韩精品一区二区三区swag| 自拍偷拍国产亚洲| 久久精工是国产品牌吗| 色诱视频网站一区| 久久这里只精品最新地址| 亚洲欧洲综合另类| 国产精品资源在线看| 欧美日韩免费一区二区三区 | 亚洲一区二区三区自拍| 国模一区二区三区白浆| 欧美日韩电影在线播放| 国产精品私人影院| 久久精品久久综合| 日本乱码高清不卡字幕| 国产日韩欧美麻豆| 久久国产精品免费| 欧美乱熟臀69xxxxxx| 亚洲欧美日韩一区二区| 国产主播一区二区三区| 欧美高清dvd| 亚洲黄色av一区| 成人性生交大片免费看中文网站| 欧美一激情一区二区三区| 亚洲欧美日韩在线播放| 成人午夜大片免费观看| 欧美成人猛片aaaaaaa| 午夜精品福利久久久| 色婷婷国产精品综合在线观看| 国产日韩精品一区二区三区| 久久se精品一区二区| 日韩午夜精品视频| 日韩精品国产欧美| 欧美亚洲国产怡红院影院| 亚洲免费在线播放| 色婷婷综合在线| 亚洲卡通欧美制服中文| 99久久精品免费看国产| 自拍偷自拍亚洲精品播放| 99久久精品免费| 国产精品传媒在线| 91亚洲精品久久久蜜桃| 亚洲丝袜制服诱惑| 91免费版在线| 一区二区三区中文字幕| 9i看片成人免费高清| 亚洲男女毛片无遮挡| 色综合久久天天| 一区视频在线播放| av在线不卡网| 欧美三级在线看| 日本免费在线视频不卡一不卡二| 欧美图片一区二区三区| 综合中文字幕亚洲| 日本精品一级二级| 亚洲伦在线观看| 日本道精品一区二区三区| 亚洲国产精品激情在线观看| 成人精品免费视频| 国产精品你懂的在线| 成人中文字幕电影| 欧美不卡一区二区三区四区| 看电视剧不卡顿的网站| 日韩三级.com| 久久精品久久精品| 日韩女优电影在线观看| 国产精品一区2区| 久久久久久麻豆| 高清不卡在线观看av| 国产精品女主播av| 欧美亚洲另类激情小说| 午夜精品久久一牛影视| 欧美电影一区二区| 日韩成人午夜精品| 国产精品女上位| 色视频欧美一区二区三区| 一区二区三区在线视频免费 | 精品日韩一区二区三区免费视频| 蜜桃视频在线观看一区二区| 日韩欧美成人激情| 久久99国产精品久久| 国产精品国产三级国产普通话99| 99久久精品国产观看| 亚洲一区二区三区在线看 | 日韩欧美123| 国产成人精品免费在线| 亚洲少妇中出一区| 欧美一区二区美女| 成人午夜免费视频| 亚洲免费观看高清完整版在线 | 视频一区中文字幕| 精品国产一区二区在线观看| 国产精品一区一区| 亚洲激情在线激情| 制服视频三区第一页精品| 另类人妖一区二区av| 亚洲欧美国产毛片在线| 91.xcao| 精品一区二区综合| 国产精品进线69影院| 日韩精品中午字幕| 成人av网站在线观看| 性做久久久久久免费观看欧美| 欧美成人一区二区| 欧美主播一区二区三区美女| 韩国精品久久久| 夜色激情一区二区| 日韩精品一区二区三区三区免费 |