グラフィックデータ定義 More...
#include "gdata.h"
#include "jbxl_state.h"
Go to the source code of this file.
Functions | |
void | free_CmnHead (CmnHead *hd) |
void | init_CmnHead (CmnHead *hd) |
BSGraph | make_BSGraph (int xs, int ys, int zs) |
WSGraph | make_WSGraph (int xs, int ys, int zs) |
FSGraph | make_FSGraph (int xs, int ys, int zs) |
ISGraph | make_ISGraph (int xs, int ys, int zs) |
VSGraph | make_VSGraph (int xs, int ys, int zs) |
MSGraph | make_MSGraph (int xs, int ys, int zs, int depth) |
BSGraph * | new_BSGraph (int xs, int ys, int zs) |
WSGraph * | new_WSGraph (int xs, int ys, int zs) |
FSGraph * | new_FSGraph (int xs, int ys, int zs) |
ISGraph * | new_ISGraph (int xs, int ys, int zs) |
VSGraph * | new_VSGraph (int xs, int ys, int zs) |
MSGraph * | new_MSGraph (int xs, int ys, int zs, int depth) |
ISGraph | W2ISGraph (WSGraph vp) |
FSGraph | W2FSGraph (WSGraph vp) |
WSGraph | B2WSGraph (BSGraph vp) |
WSGraph | I2WSGraph (ISGraph vp) |
WSGraph | F2WSGraph (FSGraph vp) |
FSGraph | V2FSGraph (VSGraph vp) |
WSGraph | V2WSGraph (VSGraph vp) |
void | init_IRBound (IRBound *rb) |
void | init_DRBound (DRBound *rb) |
void | set_RZxy (double rzm) |
int | chk_RZxy (void) |
Variables | |
int | ZeroBase = 0 |
double | RZxy = 1.0 |
int | ChkRZxy = OFF |
Definition in file gdata.c.
uByte型単純グラフィックデータ(ISGraph)を sWord型単純グラフィック データ(WSGraph)に変換する.
vp | 変換する int型単純グラフィックデータ |
Definition at line 677 of file gdata.c.
References BSGraph::gp, WSGraph::gp, JBXL_GRAPH_MEMORY_ERROR, BSGraph::state, WSGraph::state, BSGraph::xs, WSGraph::xs, BSGraph::ys, WSGraph::ys, BSGraph::zs, and WSGraph::zs.
00678 { 00679 int i; 00680 WSGraph ix; 00681 00682 ix.xs = vp.xs; 00683 ix.ys = vp.ys; 00684 ix.zs = vp.zs; 00685 ix.state = vp.state; 00686 00687 ix.gp = (sWord*)malloc(ix.xs*ix.ys*ix.zs*sizeof(sWord)); 00688 if (ix.gp==NULL) { 00689 memset(&ix, 0, sizeof(WSGraph)); 00690 ix.state = JBXL_GRAPH_MEMORY_ERROR; 00691 return ix; 00692 } 00693 00694 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (sWord)vp.gp[i]; 00695 return ix; 00696 }
int chk_RZxy | ( | void | ) |
int chk_RZxy(void)
z軸のひずみを設定が設定されているかどうかをチェックする.
Definition at line 868 of file gdata.c.
References ChkRZxy, DEBUG_MODE, FALSE, OFF, PRINT_MESG, and TRUE.
Referenced by get_wdat(), set_wdat(), write_ct_file(), and write_file_rb().
00869 { 00870 if (ChkRZxy==OFF) { 00871 DEBUG_MODE PRINT_MESG("CHK_RZXY: WARNING: undefined RZxy!!!\n"); 00872 //exit(1); 00873 return FALSE; 00874 } 00875 return TRUE; 00876 }
double型単純グラフィックデータ(FSGraph)を sWord型単純グラフィック データ(WSGraph)に変換する.
vp | 変換する double型単純グラフィックデータ |
Definition at line 741 of file gdata.c.
References FSGraph::gp, WSGraph::gp, JBXL_GRAPH_MEMORY_ERROR, FSGraph::state, WSGraph::state, FSGraph::xs, WSGraph::xs, FSGraph::ys, WSGraph::ys, FSGraph::zs, and WSGraph::zs.
00742 { 00743 int i; 00744 WSGraph ix; 00745 00746 ix.xs = vp.xs; 00747 ix.ys = vp.ys; 00748 ix.zs = vp.zs; 00749 ix.state = vp.state; 00750 00751 ix.gp = (sWord*)malloc(ix.xs*ix.ys*ix.zs*sizeof(sWord)); 00752 if (ix.gp==NULL) { 00753 memset(&ix, 0, sizeof(WSGraph)); 00754 ix.state = JBXL_GRAPH_MEMORY_ERROR; 00755 return ix; 00756 } 00757 00758 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (sWord)vp.gp[i]; 00759 return ix; 00760 }
void free_CmnHead | ( | CmnHead * | hd | ) |
void free_CmnHead(CmnHead* hd)
共通ヘッダのメモリ領域を開放する.cmnHead.kind は HEADER_NONE になる. init_CmnHead()を内包している.
hd | 開放する共通ヘッダ |
Definition at line 28 of file gdata.c.
References CmnHead::buf, CmnHead::grptr, and init_CmnHead().
Referenced by read_cmn_file(), read_ct_data(), read_ras_data(), read_ras_file(), read_user_data(), and read_wsg_file().
00029 { 00030 if (hd!=NULL) { 00031 if (hd->buf!=NULL) free(hd->buf); 00032 if (hd->grptr!=NULL) free(hd->grptr); 00033 init_CmnHead(hd); 00034 } 00035 }
int型単純グラフィックデータ(ISGraph)を sWord型単純グラフィック データ(WSGraph)に変換する.
vp | 変換する int型単純グラフィックデータ |
Definition at line 709 of file gdata.c.
References ISGraph::gp, WSGraph::gp, JBXL_GRAPH_MEMORY_ERROR, ISGraph::state, WSGraph::state, ISGraph::xs, WSGraph::xs, ISGraph::ys, WSGraph::ys, ISGraph::zs, and WSGraph::zs.
00710 { 00711 int i; 00712 WSGraph ix; 00713 00714 ix.xs = vp.xs; 00715 ix.ys = vp.ys; 00716 ix.zs = vp.zs; 00717 ix.state = vp.state; 00718 00719 ix.gp = (sWord*)malloc(ix.xs*ix.ys*ix.zs*sizeof(sWord)); 00720 if (ix.gp==NULL) { 00721 memset(&ix, 0, sizeof(WSGraph)); 00722 ix.state = JBXL_GRAPH_MEMORY_ERROR; 00723 return ix; 00724 } 00725 00726 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (sWord)vp.gp[i]; 00727 return ix; 00728 }
void init_CmnHead | ( | CmnHead * | hd | ) |
void init_CmnHead(CmnHead* hd)
共通ヘッダのメモリ領域を初期化する.cmnHead.kind は HEADER_NONE になる.
hd | 初期化する共通ヘッダ |
Definition at line 46 of file gdata.c.
References HEADER_NONE, and CmnHead::kind.
Referenced by free_CmnHead(), read_cmn_file(), read_cmn_header(), read_ct_data(), read_ras_data(), read_user_data(), read_xxx_file(), write_file_rb(), and write_ras_file().
00047 { 00048 if (hd!=NULL) { 00049 memset(hd, 0, sizeof(CmnHead)); 00050 hd->kind = HEADER_NONE; 00051 } 00052 }
void init_DRBound | ( | DRBound * | rb | ) |
void init_DRBound(DRBound* rb)
2D境界データ構造体を初期化する.
[out] | rb | 初期化する境界データ. |
Definition at line 836 of file gdata.c.
References DRBound::misc, OFF, DRBound::xmax, DRBound::xmin, DRBound::ymax, DRBound::ymin, DRBound::zmax, and DRBound::zmin.
void init_IRBound | ( | IRBound * | rb | ) |
void init_IRBound(IRBound* rb)
境界データ構造体を初期化する.
[out] | rb | 初期化する境界データ. |
Definition at line 820 of file gdata.c.
References IRBound::misc, OFF, SINTMAX, IRBound::xmax, IRBound::xmin, IRBound::ymax, IRBound::ymin, IRBound::zmax, and IRBound::zmin.
Referenced by cut_object().
00821 { 00822 rb->xmax = rb->ymax = rb->zmax = 0; 00823 rb->xmin = rb->ymin = rb->zmin = SINTMAX; 00824 rb->misc = OFF; 00825 }
BSGraph make_BSGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
BSGraph make_BSGraph(int xs, int ys, int zs)
Byte型単純グラフィックデータ(BSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 69 of file gdata.c.
References BSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, BSGraph::state, BSGraph::xs, BSGraph::ys, and BSGraph::zs.
Referenced by jp2k_toBSGraph(), JPEGImage2BSGraph(), and read_shape_main_file().
00070 { 00071 int i; 00072 BSGraph vp; 00073 00074 memset(&vp, 0, sizeof(BSGraph)); 00075 if (xs==0 || ys==0) { 00076 vp.state = JBXL_GRAPH_IVDARG_ERROR; 00077 return vp; 00078 } 00079 00080 vp.xs = xs; 00081 vp.ys = ys; 00082 if (zs>0) vp.zs = zs; 00083 else vp.zs = 1; 00084 vp.state = JBXL_NORMAL; 00085 00086 vp.gp = (uByte*)malloc(vp.xs*vp.ys*vp.zs*sizeof(uByte)); 00087 if (vp.gp==NULL) { 00088 memset(&vp, 0, sizeof(BSGraph)); 00089 vp.state = JBXL_GRAPH_MEMORY_ERROR; 00090 return vp; 00091 } 00092 00093 for (i=0; i<vp.xs*vp.ys*vp.zs; i++) vp.gp[i] = 0; 00094 00095 return vp; 00096 }
FSGraph make_FSGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
FSGraph make_FSGraph(int xs, int ys, int zs)
double 型単純グラフィックデータ(FSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 157 of file gdata.c.
References FSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, FSGraph::state, FSGraph::xs, FSGraph::ys, and FSGraph::zs.
Referenced by fNabra(), fxSobel(), fxxSobel(), fySobel(), fyySobel(), fzSobel(), fzzSobel(), and V2FSGraph().
00158 { 00159 int i; 00160 FSGraph vp; 00161 00162 memset(&vp, 0, sizeof(FSGraph)); 00163 if (xs==0 || ys==0) { 00164 vp.state = JBXL_GRAPH_IVDARG_ERROR; 00165 return vp; 00166 } 00167 00168 vp.xs = xs; 00169 vp.ys = ys; 00170 if (zs>0) vp.zs = zs; 00171 else vp.zs = 1; 00172 vp.state = JBXL_NORMAL; 00173 00174 vp.gp = (double*)malloc(vp.xs*vp.ys*vp.zs*sizeof(double)); 00175 if (vp.gp==NULL) { 00176 memset(&vp, 0, sizeof(FSGraph)); 00177 vp.state = JBXL_GRAPH_MEMORY_ERROR; 00178 return vp; 00179 } 00180 00181 for (i=0; i<vp.xs*vp.ys*vp.zs; i++) vp.gp[i] = 0.0; 00182 00183 return vp; 00184 }
ISGraph make_ISGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
ISGraph make_ISGraph(int xs, int ys, int zs)
int型単純グラフィックデータ(ISGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 201 of file gdata.c.
References ISGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, ISGraph::state, ISGraph::xs, ISGraph::ys, and ISGraph::zs.
Referenced by euclid_distance().
00202 { 00203 int i; 00204 ISGraph vp; 00205 00206 memset(&vp, 0, sizeof(ISGraph)); 00207 if (xs==0 || ys==0) { 00208 vp.state = JBXL_GRAPH_IVDARG_ERROR; 00209 return vp; 00210 } 00211 00212 vp.xs = xs; 00213 vp.ys = ys; 00214 if (zs>0) vp.zs = zs; 00215 else vp.zs = 1; 00216 vp.state = JBXL_NORMAL; 00217 00218 vp.gp = (int*)malloc(vp.xs*vp.ys*vp.zs*sizeof(int)); 00219 if (vp.gp==NULL) { 00220 memset(&vp, 0, sizeof(ISGraph)); 00221 vp.state = JBXL_GRAPH_MEMORY_ERROR; 00222 return vp; 00223 } 00224 00225 for (i=0; i<vp.xs*vp.ys*vp.zs; i++) vp.gp[i] = 0; 00226 00227 return vp; 00228 }
MSGraph make_MSGraph | ( | int | xs, | |
int | ys, | |||
int | zs, | |||
int | depth | |||
) |
MSGraph make_MSGraph(int xs, int ys, int zs, int depth)
単純グラフィックデータ(MSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. | |
depth | カラーデプス(bit) |
Definition at line 290 of file gdata.c.
References MSGraph::depth, MSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, MSGraph::state, MSGraph::xs, MSGraph::ys, and MSGraph::zs.
Referenced by proc_tiff_ifd().
00291 { 00292 MSGraph vp; 00293 00294 memset(&vp, 0, sizeof(MSGraph)); 00295 if (xs==0 || ys==0) { 00296 vp.state = JBXL_GRAPH_IVDARG_ERROR; 00297 return vp; 00298 } 00299 00300 vp.xs = xs; 00301 vp.ys = ys; 00302 if (zs>0) vp.zs = zs; 00303 else vp.zs = 1; 00304 if (depth>0) vp.depth = depth; 00305 else vp.depth = 1; 00306 vp.state = JBXL_NORMAL; 00307 00308 vp.gp = (unsigned char*)malloc(xs*ys*zs*((depth+7)/8)); 00309 if (vp.gp==NULL) { 00310 memset(&vp, 0, sizeof(MSGraph)); 00311 vp.state = JBXL_GRAPH_MEMORY_ERROR; 00312 return vp; 00313 } 00314 00315 memset(vp.gp, 0, xs*ys*zs*((depth+7)/8)); 00316 return vp; 00317 }
VSGraph make_VSGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
VSGraph make_VSGraph(int xs, int ys, int zs)
vector型単純グラフィックデータ(VSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 245 of file gdata.c.
References VSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, set_vector(), VSGraph::state, VSGraph::xs, VSGraph::ys, and VSGraph::zs.
Referenced by curvature(), curvature3D(), vfNabra(), and vNabra().
00246 { 00247 int i; 00248 VSGraph vp; 00249 00250 memset(&vp, 0, sizeof(VSGraph)); 00251 if (xs==0 || ys==0) { 00252 vp.state = JBXL_GRAPH_IVDARG_ERROR; 00253 return vp; 00254 } 00255 00256 vp.xs = xs; 00257 vp.ys = ys; 00258 if (zs>0) vp.zs = zs; 00259 else vp.zs = 1; 00260 vp.state = JBXL_NORMAL; 00261 00262 vp.gp = (vector*)malloc(xs*ys*zs*sizeof(vector)); 00263 if (vp.gp==NULL) { 00264 memset(&vp, 0, sizeof(VSGraph)); 00265 vp.state = JBXL_GRAPH_MEMORY_ERROR; 00266 return vp; 00267 } 00268 00269 for (i=0; i<xs*ys*zs; i++) vp.gp[i] = set_vector(0.0, 0.0, 0.0); 00270 00271 return vp; 00272 }
WSGraph make_WSGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
WSGraph make_WSGraph(int xs, int ys, int zs)
sWord型単純グラフィックデータ(WSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 113 of file gdata.c.
References WSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, WSGraph::state, WSGraph::xs, WSGraph::ys, and WSGraph::zs.
Referenced by circle3d(), curv2WSGraph(), cut_object(), edge_enhance(), euclid_distance(), grab_WSGraph(), imask(), JPEGImage2WSGraph(), Laplacian(), median(), Nabra(), pool(), read_dicom_file(), to2d(), torus(), V2WSGraph(), x_reverse_wsg(), xSobel(), xxSobel(), ySobel(), yySobel(), zoom_WSGraph(), zSobel(), and zzSobel().
00114 { 00115 int i; 00116 WSGraph vp; 00117 00118 memset(&vp, 0, sizeof(WSGraph)); 00119 if (xs==0 || ys==0) { 00120 vp.state = JBXL_GRAPH_IVDARG_ERROR; 00121 return vp; 00122 } 00123 00124 vp.xs = xs; 00125 vp.ys = ys; 00126 if (zs>0) vp.zs = zs; 00127 else vp.zs = 1; 00128 vp.state = JBXL_NORMAL; 00129 00130 vp.gp = (sWord*)malloc(vp.xs*vp.ys*vp.zs*sizeof(sWord)); 00131 if (vp.gp==NULL) { 00132 memset(&vp, 0, sizeof(WSGraph)); 00133 vp.state = JBXL_GRAPH_MEMORY_ERROR; 00134 return vp; 00135 } 00136 00137 for (i=0; i<vp.xs*vp.ys*vp.zs; i++) vp.gp[i] = 0; 00138 00139 return vp; 00140 }
BSGraph* new_BSGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
BSGraph* new_BSGraph(int xs, int ys, int zs)
Byte型単純グラフィックデータ(BSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 334 of file gdata.c.
References BSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, BSGraph::state, BSGraph::xs, BSGraph::ys, and BSGraph::zs.
00335 { 00336 int i; 00337 BSGraph* vp; 00338 00339 vp = (BSGraph*)malloc(sizeof(BSGraph)); 00340 if (vp==NULL) return NULL; 00341 memset(vp, 0, sizeof(BSGraph)); 00342 00343 if (xs==0 || ys==0) { 00344 vp->state = JBXL_GRAPH_IVDARG_ERROR; 00345 return vp; 00346 } 00347 00348 vp->xs = xs; 00349 vp->ys = ys; 00350 if (zs>0) vp->zs = zs; 00351 else vp->zs = 1; 00352 vp->state = JBXL_NORMAL; 00353 00354 vp->gp = (uByte*)malloc(vp->xs*vp->ys*vp->zs*sizeof(uByte)); 00355 if (vp->gp==NULL) { 00356 memset(vp, 0, sizeof(BSGraph)); 00357 vp->state = JBXL_GRAPH_MEMORY_ERROR; 00358 return vp; 00359 } 00360 00361 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = 0; 00362 00363 return vp; 00364 }
FSGraph* new_FSGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
FSGraph* new_FSGraph(int xs, int ys, int zs)
double 型単純グラフィックデータ(FSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 428 of file gdata.c.
References FSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, FSGraph::state, FSGraph::xs, FSGraph::ys, and FSGraph::zs.
00429 { 00430 int i; 00431 FSGraph* vp; 00432 00433 vp = (FSGraph*)malloc(sizeof(FSGraph)); 00434 if (vp==NULL) return NULL; 00435 memset(vp, 0, sizeof(FSGraph)); 00436 00437 if (xs==0 || ys==0) { 00438 vp->state = JBXL_GRAPH_IVDARG_ERROR; 00439 return vp; 00440 } 00441 00442 vp->xs = xs; 00443 vp->ys = ys; 00444 if (zs>0) vp->zs = zs; 00445 else vp->zs = 1; 00446 vp->state = JBXL_NORMAL; 00447 00448 vp->gp = (double*)malloc(vp->xs*vp->ys*vp->zs*sizeof(double)); 00449 if (vp->gp==NULL) { 00450 memset(vp, 0, sizeof(FSGraph)); 00451 vp->state = JBXL_GRAPH_MEMORY_ERROR; 00452 return vp; 00453 } 00454 00455 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = 0.0; 00456 00457 return vp; 00458 }
ISGraph* new_ISGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
ISGraph* new_ISGraph(int xs, int ys, int zs)
int型単純グラフィックデータ(ISGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 475 of file gdata.c.
References ISGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, ISGraph::state, ISGraph::xs, ISGraph::ys, and ISGraph::zs.
00476 { 00477 int i; 00478 ISGraph* vp; 00479 00480 vp = (ISGraph*)malloc(sizeof(ISGraph)); 00481 if (vp==NULL) return NULL; 00482 00483 memset(vp, 0, sizeof(ISGraph)); 00484 if (xs==0 || ys==0) { 00485 vp->state = JBXL_GRAPH_IVDARG_ERROR; 00486 return vp; 00487 } 00488 00489 vp->xs = xs; 00490 vp->ys = ys; 00491 if (zs>0) vp->zs = zs; 00492 else vp->zs = 1; 00493 vp->state = JBXL_NORMAL; 00494 00495 vp->gp = (int*)malloc(vp->xs*vp->ys*vp->zs*sizeof(int)); 00496 if (vp->gp==NULL) { 00497 memset(vp, 0, sizeof(ISGraph)); 00498 vp->state = JBXL_GRAPH_MEMORY_ERROR; 00499 return vp; 00500 } 00501 00502 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = 0; 00503 00504 return vp; 00505 }
MSGraph* new_MSGraph | ( | int | xs, | |
int | ys, | |||
int | zs, | |||
int | depth | |||
) |
MSGraph* new_MSGraph(int xs, int ys, int zs, int depth)
単純グラフィックデータ(MSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. | |
depth | カラーデプス(bit) |
Definition at line 570 of file gdata.c.
References MSGraph::depth, MSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, MSGraph::state, MSGraph::xs, MSGraph::ys, and MSGraph::zs.
00571 { 00572 MSGraph* vp; 00573 00574 vp = (MSGraph*)malloc(sizeof(MSGraph)); 00575 if (vp==NULL) return NULL; 00576 memset(vp, 0, sizeof(MSGraph)); 00577 00578 if (xs==0 || ys==0) { 00579 vp->state = JBXL_GRAPH_IVDARG_ERROR; 00580 return vp; 00581 } 00582 00583 vp->xs = xs; 00584 vp->ys = ys; 00585 if (zs>0) vp->zs = zs; 00586 else vp->zs = 1; 00587 if (depth>0) vp->depth = depth; 00588 else vp->depth = 1; 00589 vp->state = JBXL_NORMAL; 00590 00591 vp->gp = (unsigned char*)malloc(vp->xs*vp->ys*vp->zs*((depth+7)/8)); 00592 if (vp->gp==NULL) { 00593 memset(vp, 0, sizeof(MSGraph)); 00594 vp->state = JBXL_GRAPH_MEMORY_ERROR; 00595 return vp; 00596 } 00597 00598 memset(vp->gp, 0, vp->xs*vp->ys*vp->zs*((depth+7)/8)); 00599 return vp; 00600 }
VSGraph* new_VSGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
VSGraph* new_VSGraph(int xs, int ys, int zs)
vector型単純グラフィックデータ(VSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 522 of file gdata.c.
References VSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, set_vector(), VSGraph::state, VSGraph::xs, VSGraph::ys, and VSGraph::zs.
00523 { 00524 int i; 00525 VSGraph* vp; 00526 00527 vp = (VSGraph*)malloc(sizeof(VSGraph)); 00528 if (vp==NULL) return NULL; 00529 memset(vp, 0, sizeof(VSGraph)); 00530 00531 if (xs==0 || ys==0) { 00532 vp->state = JBXL_GRAPH_IVDARG_ERROR; 00533 return vp; 00534 } 00535 00536 vp->xs = xs; 00537 vp->ys = ys; 00538 if (zs>0) vp->zs = zs; 00539 else vp->zs = 1; 00540 vp->state = JBXL_NORMAL; 00541 00542 vp->gp = (vector*)malloc(vp->xs*vp->ys*vp->zs*sizeof(vector)); 00543 if (vp->gp==NULL) { 00544 memset(vp, 0, sizeof(VSGraph)); 00545 vp->state = JBXL_GRAPH_MEMORY_ERROR; 00546 return vp; 00547 } 00548 00549 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = set_vector(0.0, 0.0, 0.0); 00550 00551 return vp; 00552 }
WSGraph* new_WSGraph | ( | int | xs, | |
int | ys, | |||
int | zs | |||
) |
WSGraph* new_WSGraph(int xs, int ys, int zs)
sWord型単純グラフィックデータ(WSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.
xs | 確保するグラフィックデータの x方向のサイズ. | |
ys | 確保するグラフィックデータの y方向のサイズ. | |
zs | 確保するグラフィックデータの z方向のサイズ. |
Definition at line 381 of file gdata.c.
References WSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, WSGraph::state, WSGraph::xs, WSGraph::ys, and WSGraph::zs.
00382 { 00383 int i; 00384 WSGraph* vp; 00385 00386 vp = (WSGraph*)malloc(sizeof(WSGraph)); 00387 if (vp==NULL) return NULL; 00388 memset(vp, 0, sizeof(WSGraph)); 00389 00390 if (xs==0 || ys==0) { 00391 vp->state = JBXL_GRAPH_IVDARG_ERROR; 00392 return vp; 00393 } 00394 00395 vp->xs = xs; 00396 vp->ys = ys; 00397 if (zs>0) vp->zs = zs; 00398 else vp->zs = 1; 00399 vp->state = JBXL_NORMAL; 00400 00401 vp->gp = (sWord*)malloc(vp->xs*vp->ys*vp->zs*sizeof(sWord)); 00402 if (vp->gp==NULL) { 00403 memset(vp, 0, sizeof(WSGraph)); 00404 vp->state = JBXL_GRAPH_MEMORY_ERROR; 00405 return vp; 00406 } 00407 00408 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = 0; 00409 00410 return vp; 00411 }
void set_RZxy | ( | double | rzm | ) |
void set_RZxy(double rzm)
z軸のひずみを設定する.デフォルトでは 1.0に設定されている. 設定を無効にするには void unset_RZxy(void) を使用する.
rzm | ひずみの値. |
Definition at line 853 of file gdata.c.
References ChkRZxy, ON, and RZxy.
Referenced by read_dicom_file(), read_wsg_file(), and read_wsg_file_rb().
00854 { 00855 ChkRZxy = ON; 00856 RZxy = rzm; 00857 //fprintf(stderr,"set_RZxy: set RZxy to %f\n", rzm); 00858 }
vector型単純グラフィックデータ(VSGraph)を double型単純グラフィック データ(FSGraph)に変換する.
vp | 変換する vector型単純グラフィックデータ |
Definition at line 773 of file gdata.c.
References VSGraph::gp, FSGraph::gp, make_FSGraph(), vector::n, VSGraph::state, FSGraph::state, FSGraph::xs, VSGraph::xs, FSGraph::ys, VSGraph::ys, FSGraph::zs, and VSGraph::zs.
00774 { 00775 int i; 00776 FSGraph ix; 00777 00778 ix = make_FSGraph(vp.xs, vp.ys, vp.zs); 00779 if (ix.gp==NULL) return ix; 00780 00781 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = vp.gp[i].n; 00782 ix.state = vp.state; 00783 00784 return ix; 00785 }
vector型単純グラフィックデータ(VSGraph)を sWord型単純グラフィックデータ(WSGraph)に変換する.
vp | 変換する vector型単純グラフィックデータ |
Definition at line 797 of file gdata.c.
References VSGraph::gp, WSGraph::gp, make_WSGraph(), vector::n, VSGraph::state, WSGraph::state, WSGraph::xs, VSGraph::xs, WSGraph::ys, VSGraph::ys, WSGraph::zs, and VSGraph::zs.
00798 { 00799 int i; 00800 WSGraph ix; 00801 00802 ix = make_WSGraph(vp.xs, vp.ys, vp.zs); 00803 if (ix.gp==NULL) return ix; 00804 00805 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (sWord)vp.gp[i].n; 00806 ix.state = vp.state; 00807 00808 return ix; 00809 }
sWord型単純グラフィックデータ(WSGraph)を double型単純グラフィック データ(FSGraph)に変換する.
vp | 変換する sWord型単純グラフィックデータ |
Definition at line 645 of file gdata.c.
References WSGraph::gp, FSGraph::gp, JBXL_GRAPH_MEMORY_ERROR, WSGraph::state, FSGraph::state, WSGraph::xs, FSGraph::xs, WSGraph::ys, FSGraph::ys, WSGraph::zs, and FSGraph::zs.
Referenced by WSCurve().
00646 { 00647 int i; 00648 FSGraph ix; 00649 00650 ix.xs = vp.xs; 00651 ix.ys = vp.ys; 00652 ix.zs = vp.zs; 00653 ix.state = vp.state; 00654 00655 ix.gp = (double*)malloc(ix.xs*ix.ys*ix.zs*sizeof(double)); 00656 if (ix.gp==NULL) { 00657 memset(&ix, 0, sizeof(FSGraph)); 00658 ix.state = JBXL_GRAPH_MEMORY_ERROR; 00659 return ix; 00660 } 00661 00662 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i]=(double)vp.gp[i]; 00663 return ix; 00664 }
sWord型単純グラフィックデータ(WSGraph)を int型単純グラフィック データ(ISGraph)に変換する.
vp | 変換する sWord型単純グラフィックデータ |
Definition at line 613 of file gdata.c.
References WSGraph::gp, ISGraph::gp, JBXL_GRAPH_MEMORY_ERROR, WSGraph::state, ISGraph::state, WSGraph::xs, ISGraph::xs, WSGraph::ys, ISGraph::ys, WSGraph::zs, and ISGraph::zs.
00614 { 00615 int i; 00616 ISGraph ix; 00617 00618 ix.xs = vp.xs; 00619 ix.ys = vp.ys; 00620 ix.zs = vp.zs; 00621 ix.state = vp.state; 00622 00623 ix.gp = (int*)malloc(ix.xs*ix.ys*ix.zs*sizeof(int)); 00624 if (ix.gp==NULL) { 00625 memset(&ix, 0, sizeof(ISGraph)); 00626 ix.state = JBXL_GRAPH_MEMORY_ERROR; 00627 return ix; 00628 } 00629 00630 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (int)vp.gp[i]; 00631 return ix; 00632 }
int ChkRZxy = OFF |
Definition at line 17 of file gdata.c.
Referenced by chk_RZxy(), and set_RZxy().
double RZxy = 1.0 |
Definition at line 16 of file gdata.c.
Referenced by get_wdat(), set_RZxy(), set_wdat(), sphere(), write_ct_file(), and write_file_rb().
int ZeroBase = 0 |
Definition at line 15 of file gdata.c.
Referenced by read_wsg_file(), read_wsg_file_rb(), write_ct_file(), and write_file_rb().