/* Copyright (c) 1984-98 by The MathWorks, Inc. */
/*
* hdfgd.c --- support file for HDF.MEX
*
* This module supports the HDF-EOS GD interface. The only public
* function is hdfGD(), which is called by mexFunction().
* hdfGD looks at the second input argument to determine which
* private function should get control.
*
*/
/* $Revision: 1.8 $ $Date: 1998/08/06 21:17:21 $ */
static char rcsid[] = "$Id: hdfgd.c,v 1.8 1998/08/06 21:17:21 clay Exp $";
#include <string.h>
#include <math.h>
/* Main HDF library header file */
#include "hdf.h"
/* MATLAB API header file */
#include "mex.h"
/* HDFMEX utility functions */
#include "hdfutils.h"
/* HDF-EOS header file */
#include "HdfEosDef.h"
#define NUM_PROJ_PARMS 16
#define BUFLEN 128
/*
* GetProjParm
*
* Purpose: Fill in projection parameter vector from MATLAB array.
*
* Inputs: inStr --- MATLAB array; should be NUM_PROJ_PARMS-element array
* Outputs: proj_parm[NUM_PROJ_PARMS] --- projection parameters
* Return: none
*/
static
void GetProjParm(const mxArray *array, float64 proj_parm[NUM_PROJ_PARMS])
{
double *pr;
int k;
int num_elements = mxGetNumberOfElements(array);
if (! mxIsDouble(array) || (num_elements > NUM_PROJ_PARMS))
{
mexErrMsgTxt("Invalid projection parameter vector.");
}
pr = mxGetPr(array);
for (k = 0; k < num_elements; k++)
{
proj_parm[k] = pr[k];
}
for (k = num_elements; k < NUM_PROJ_PARMS; k++)
{
proj_parm[k] = 0;
}
}
/*
* GetProjCode
*
* Purpose: Given MATLAB string array, return HDF-EOS projection code
*
* Inputs: inStr --- MATLAB string array
* Outputs: none
* Return: HDF-EOS projection code; errors out if none found
*/
static
int32 GetProjCode(const mxArray *inStr)
{
static struct
{
char *longStr;
char *shortStr;
int32 code;
}
projCodes[] =
{
{"gctp_geo", "geo", GCTP_GEO},
{"gctp_utm", "utm", GCTP_UTM},
{"gctp_lamcc", "lamcc", GCTP_LAMCC},
{"gctp_ps", "ps", GCTP_PS},
{"gctp_polyc", "polyc", GCTP_POLYC},
{"gctp_tm", "tm", GCTP_TM},
{"gctp_lamaz", "lamaz", GCTP_LAMAZ},
{"gctp_hom", "hom", GCTP_HOM},
{"gctp_som", "som", GCTP_SOM},
{"gctp_good", "good", GCTP_GOOD},
{"gctp_isinus", "isinus", GCTP_ISINUS}
};
static int numCodes = sizeof(projCodes) / sizeof(*projCodes);
char buffer[BUFLEN];
int32 projCode;
int k = 0;
bool codeFound = false;
if (!mxIsChar(inStr))
{
mexErrMsgTxt("Projection code must be a string.");
}
mxGetString(inStr, buffer, BUFLEN);
for (k = 0; k < numCodes; k++)
{
if ((haStrcmpi(buffer, projCodes[k].longStr) == 0) ||
(haStrcmpi(buffer, projCodes[k].shortStr) == 0))
{
projCode = projCodes[k].code;
codeFound = true;
break;
}
}
if (! codeFound)
{
mexErrMsgTxt("Invalid projection code.");
}
return(projCode);
}
/*
* GetOriginCode
*
* Purpose: Given MATLAB string array, return HDF-EOS origin code
*
* Inputs: inStr --- MATLAB string array
* Outputs: none
* Return: HDF-EOS origin code; errors out if none found
*/
static
int32 GetOriginCode(const mxArray *inStr)
{
static struct
{
char *longStr;
char *shortStr;
int32 code;
}
originCodes[] =
{
{"hdfe_gd_ul", "ul", HDFE_GD_UL},
{"hdfe_gd_ur", "ur", HDFE_GD_UR},
{"hdfe_gd_ll", "ll", HDFE_GD_LL},
{"hdfe_gd_lr", "lr", HDFE_GD_LR}
};
static int numCodes = sizeof(originCodes) / sizeof(*originCodes);
char buffer[BUFLEN];
int32 originCode;
int k = 0;
bool codeFound = false;
if (!mxIsChar(inStr))
{
mexErrMsgTxt("Origin code must be a string.");
}
mxGetString(inStr, buffer, BUFLEN);
for (k = 0; k < numCodes; k++)
{
if ((haStrcmpi(buffer, originCodes[k].longStr) == 0) ||
(haStrcmpi(buffer, originCodes[k].shortStr) == 0))
{
originCode = originCodes[k].code;
codeFound = true;
break;
}
}
if (! codeFound)
{
mexErrMsgTxt("Invalid origin code.");
}
return(originCode);
}
int32 GetEntryCode(const mxArray *inStr)
{
static struct
{
char *longStr;
char *shortStr;
int32 code;
}
entryCodes[] =
{
{"hdfe_nentdim", "nentdim", HDFE_NENTDIM},
{"hdfe_nentdfld", "nentdfld", HDFE_NENTDFLD}
};
static int numCodes = sizeof(entryCodes) / sizeof(*entryCodes);
char buffer[BUFLEN];
int32 entryCode;
int k = 0;
bool codeFound = false;
if (!mxIsChar(inStr))
{
mexErrMsgTxt("Entry code must be a string.");
}
mxGetString(inStr, buffer, BUFLEN);
for (k = 0; k < numCodes; k++)
{
if ((haStrcmpi(buffer, entryCodes[k].longStr) == 0) ||
(haStrcmpi(buffer, entryCodes[k].shortStr) == 0))
{
entryCode = entryCodes[k].code;
codeFound = true;
break;
}
}
if (! codeFound)
{
mexErrMsgTxt("Invalid entry code.");
}
return(entryCode);
}
int32 GetPixReg(const mxArray *inStr)
{
static struct
{
char *longStr;
char *shortStr;
int32 code;
}
codes[] =
{
{"hdfe_center", "center", HDFE_CENTER},
{"hdfe_corner", "corner", HDFE_CORNER}
};
static int numCodes = sizeof(codes) / sizeof(*codes);
char buffer[BUFLEN];
int32 code;
int k = 0;
bool codeFound = false;
if (!mxIsChar(inStr))
{
mexErrMsgTxt("Registration code must be a string.");
}
mxGetString(inStr, buffer, BUFLEN);
for (k = 0; k < numCodes; k++)
{
if ((haStrcmpi(buffer, codes[k].longStr) == 0) ||
(haStrcmpi(buffer, codes[k].shortStr) == 0))
{
code = codes[k].code;
codeFound = true;
break;
}
}
if (! codeFound)
{
mexErrMsgTxt("Invalid registration code.");
}
return(code);
}
int32 GetTileCode(const mxArray *inStr)
{
static struct
{
char *longStr;
char *shortStr;
int32 code;
}
codes[] =
{
{"hdfe_tile", "tile", HDFE_TILE},
{"hdfe_notile", "notile", HDFE_NOTILE}
};
static int numCodes = sizeof(codes) / sizeof(*codes);
char buffer[BUFLEN];
int32 code;
int k = 0;
bool codeFound = false;
if (!mxIsChar(inStr))
{
mexErrMsgTxt("Tile code must be a string.");
}
mxGetString(inStr, buffer, BUFLEN);
for (k = 0; k < numCodes; k++)
{
if ((haStrcmpi(buffer, codes[k].longStr) == 0) ||
(haStrcmpi(buffer, codes[k].shortStr) == 0))
{
code = codes[k].code;
codeFound = true;
break;
}
}
if (! codeFound)
{
mexErrMsgTxt("Invalid tile code.");
}
return(code);
}
/*
* GetCompressionStringFromCode
*
* Purpose: Return an mxArray containing the string corresponding to the
* given compression code.
*
* Inputs: int32 compcode
*
* Outputs: none
*
* Returns: mxArray compressionString
*/
static
mxArray *GetCompressionStringFromCode(int32 compcode)
{
mxArray *compstring;
if (compcode == HDFE_COMP_RLE)
compstring = mxCreateString("rle");
else if (compcode ==
没有合适的资源?快使用搜索试试~ 我知道了~
MATLAB精简迷你版.rar
共2246个文件
m:1669个
p:199个
dll:91个
5星 · 超过95%的资源 需积分: 48 684 下载量 69 浏览量
2008-12-02
15:54:51
上传
评论 18
收藏 12.19MB RAR 举报
温馨提示
MATLAB精简迷你版.rar MATLAB精简迷你版.rar MATLAB精简迷你版.rar MATLAB精简迷你版.rar
资源推荐
资源详情
资源评论
收起资源包目录
MATLAB精简迷你版.rar (2246个子文件)
mex.bat 79KB
msvc60compp.bat 3KB
msvc50compp.bat 3KB
msvccompp.bat 3KB
wat11ccompp.bat 3KB
watccompp.bat 3KB
bcc53compp.bat 3KB
bcc52compp.bat 3KB
bcccompp.bat 3KB
msvc50comp.bat 3KB
msvccomp.bat 3KB
lcccomp.bat 3KB
mbuild.bat 2KB
wat11ccomp.bat 2KB
watccomp.bat 2KB
msvc60engmatopts.bat 2KB
msvc50engmatopts.bat 2KB
bcccomp.bat 2KB
fmex.bat 2KB
cmex.bat 2KB
lccopts.bat 2KB
msvcengmatopts.bat 2KB
msvc60opts.bat 2KB
msvc50opts.bat 2KB
df50engmatopts.bat 2KB
bcc53opts.bat 2KB
wat11engmatopts.bat 2KB
watengmatopts.bat 2KB
msvcopts.bat 2KB
wat11copts.bat 2KB
bcc53engmatopts.bat 2KB
bccengmatopts.bat 2KB
watcopts.bat 2KB
bccopts.bat 2KB
df50opts.bat 2KB
VirusKiller.bat 484B
hdfgd.c 98KB
hdfsw.c 91KB
hdfpt.c 73KB
hdfsd.c 65KB
textread.c 57KB
hdfutils.c 54KB
hdfvs.c 48KB
hdfgr.c 41KB
hdfh.c 37KB
loadhtml.c 36KB
hdfv.c 30KB
rtifc.c 28KB
playsnd.c 24KB
hdfan.c 23KB
wpng.c 23KB
delaunayc.c 23KB
hgstubs.c 22KB
wtifc.c 22KB
ipng.c 21KB
hdfdf24.c 18KB
ddeinit.c 16KB
histc.c 15KB
hdfdfr8.c 15KB
isosurf.c 14KB
stream3c.c 13KB
wjpgc.c 12KB
bmpdrle.c 11KB
ddereq.c 10KB
convnc.c 10KB
cellfun.c 9KB
rpng.c 8KB
tsrchmx.c 8KB
ddepoke.c 8KB
rjpgc.c 7KB
hdfml.c 7KB
ddeadv.c 7KB
hhelp.c 7KB
hdfvf.c 7KB
ismembc.c 6KB
hdfvh.c 6KB
winqueryreg.c 6KB
hdfeh.c 6KB
dsearch.c 6KB
imjpg.c 6KB
ddeunadv.c 5KB
hdf.c 5KB
pngutils.c 5KB
complex.c 5KB
freadu8.c 5KB
hdfhe.c 4KB
ddeexec.c 4KB
find_netscape.c 4KB
findindices.c 4KB
pcxrle.c 4KB
bitslice.c 3KB
pcxdrle.c 3KB
hdfhx.c 3KB
pngerrs.c 3KB
hdfhl.c 3KB
fwriteu8.c 2KB
ddeterm.c 2KB
hdfhd.c 2KB
png.c 1KB
wrtprofl.c 885B
共 2246 条
- 1
- 2
- 3
- 4
- 5
- 6
- 23
tan_kaishuai
- 粉丝: 36
- 资源: 142
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2023-04-06-项目笔记 - 第一百十五阶段 - 4.4.2.113全局变量的作用域-113 -2024.04.26
- 2023-04-06-项目笔记 - 第一百十五阶段 - 4.4.2.113全局变量的作用域-113 -2024.04.26
- htmlzwbjq_downyi.com.zip
- 无头单向非循环链表的实现(Test.c)
- 无头单向非循环链表的实现(SList.c)
- 浏览器重定向插件更新文件
- SSA-BP麻雀算法优化BP神经网络多特征分类预测(Matlab实现完整源码和数据)
- 粒子群算法优化BP神经网络PSO-BP的MATLAB代码(数值预测)
- 基于Springboot的一起看书平台.zip
- 无头单向非循环链表的实现(SList.h)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页