JunkBox_Lib 1.10.1
Loading...
Searching...
No Matches
gdata.h File Reference

グラフィックデータ定義用ヘッダ More...

#include "gheader.h"
#include "matrix.h"
Include dependency graph for gdata.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BSGraph
 
struct  WSGraph
 
struct  ISGraph
 
struct  FSGraph
 
struct  VSGraph
 
struct  MSGraph
 
struct  IRBound
 
struct  DRBound
 

Macros

#define unset_RZxy()   {ChkRZxy=OFF;}
 
#define free_Graph(v)   {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
 vのバッファ部を解放する.
 
#define free_WSGraph(v)   {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
 
#define free_BSGraph(v)   {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
 
#define free_FSGraph(v)   {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
 
#define free_ISGraph(v)   {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
 
#define free_VSGraph(v)   {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
 
#define free_MSGraph(v)   {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=(v)->depth=0; (v)->state=JBXL_NORMAL;}}
 
#define del_Graph(v)   {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
 
#define del_WSGraph(v)   {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
 
#define del_BSGraph(v)   {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
 
#define del_FSGraph(v)   {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
 
#define del_ISGraph(v)   {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
 
#define del_VSGraph(v)   {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
 
#define del_MSGraph(v)   {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
 
#define Lx(v, i)   ((v).gp[(i)])
 1次元画像データ vの (i) のデータを参照する.
 
#define Px(v, i, j)   ((v).gp[(i)+(v).xs*(j)])
 2次元画像データ vの (i, j) のデータを参照する.
 
#define Vx(v, i, j, k)   ((v).gp[(i)+(v).xs*(j)+(v).xs*(v).ys*(k)])
 3次元画像データ vの (i, j, k) のデータを参照する.
 
#define pLx(v, i)   ((v)->gp[(i)])
 1次元画像データ vの (i) のデータを参照する.
 
#define pPx(v, i, j)   ((v)->gp[(i)+(v)->xs*(j)])
 2次元画像データ vの (i, j) のデータを参照する.
 
#define pVx(v, i, j, k)   ((v)->gp[(i)+(v)->xs*(j)+(v)->xs*(v)->ys*(k)])
 3次元画像データ vの (i, j, k) のデータを参照する.
 
#define Lxt(v, i)   ((v).gp[((i)-1)])
 座標を 1 から数える.
 
#define Pxt(v, i, j)   ((v).gp[((i)-1)+(v).xs*((j)-1)])
 
#define Vxt(v, i, j, k)   ((v).gp[((i)-1)+(v).xs*((j)-1)+(v).xs*(v).ys*((k)-1)])
 
#define pLxt(v, i)   ((v)->gp[((i)-1)])
 座標を 1 から数える.
 
#define pPxt(v, i, j)   ((v)->gp[((i)-1)+(v)->xs*((j)-1)])
 
#define pVxt(v, i, j, k)   ((v)->gp[((i)-1)+(v)->xs*((j)-1)+(v)->xs*(v).ys->((k)-1)])
 

Functions

WSGraph B2WSGraph (BSGraph vp)
 
WSGraph I2WSGraph (ISGraph vp)
 
WSGraph F2WSGraph (FSGraph vp)
 
ISGraph W2ISGraph (WSGraph vp)
 
FSGraph W2FSGraph (WSGraph vp)
 
WSGraph V2WSGraph (VSGraph vp)
 
FSGraph V2FSGraph (VSGraph vp)
 
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)
 
BSGraphnew_BSGraph (int xs, int ys, int zs)
 
WSGraphnew_WSGraph (int xs, int ys, int zs)
 
FSGraphnew_FSGraph (int xs, int ys, int zs)
 
ISGraphnew_ISGraph (int xs, int ys, int zs)
 
VSGraphnew_VSGraph (int xs, int ys, int zs)
 
MSGraphnew_MSGraph (int xs, int ys, int zs, int depth)
 
WSGraph zoom_WSGraph (WSGraph vp, int zm, int mode)
 
WSGraph grab_WSGraph (WSGraph vp, int x1, int y1, int x2, int y2)
 
void copy_WSGraph (WSGraph src, WSGraph dst)
 
int chk_RZxy (void)
 
void set_RZxy (double rzm)
 
void init_IRBound (IRBound *rb)
 
void init_DRBound (DRBound *rb)
 
void free_CmnHead (CmnHead *hd)
 
void init_CmnHead (CmnHead *hd)
 

Variables

int ZeroBase
 
double RZxy
 
int ChkRZxy
 

Detailed Description

Version
3.0
Author
Fumi.Iseki (C)
Date
2002 8/27

Definition in file gdata.h.

Macro Definition Documentation

◆ del_BSGraph

#define del_BSGraph ( v)    {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}

Definition at line 185 of file gdata.h.

◆ del_FSGraph

#define del_FSGraph ( v)    {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}

Definition at line 186 of file gdata.h.

◆ del_Graph

#define del_Graph ( v)    {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}

Definition at line 183 of file gdata.h.

◆ del_ISGraph

#define del_ISGraph ( v)    {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}

Definition at line 187 of file gdata.h.

◆ del_MSGraph

#define del_MSGraph ( v)    {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}

Definition at line 189 of file gdata.h.

◆ del_VSGraph

#define del_VSGraph ( v)    {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}

Definition at line 188 of file gdata.h.

◆ del_WSGraph

#define del_WSGraph ( v)    {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}

Definition at line 184 of file gdata.h.

◆ free_BSGraph

#define free_BSGraph ( v)    {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}

Definition at line 177 of file gdata.h.

◆ free_FSGraph

#define free_FSGraph ( v)    {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}

Definition at line 178 of file gdata.h.

Referenced by fNabra().

◆ free_Graph

#define free_Graph ( v)    {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}

Definition at line 175 of file gdata.h.

◆ free_ISGraph

#define free_ISGraph ( v)    {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}

Definition at line 179 of file gdata.h.

◆ free_MSGraph

#define free_MSGraph ( v)    {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=(v)->depth=0; (v)->state=JBXL_NORMAL;}}

Definition at line 181 of file gdata.h.

Referenced by free_TIFF_ifd_dem(), and proc_tiff_ifd().

◆ free_VSGraph

#define free_VSGraph ( v)    {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}

Definition at line 180 of file gdata.h.

Referenced by curvature(), curvature3D(), vfNabra(), and vNabra().

◆ free_WSGraph

#define free_WSGraph ( v)    {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}

Definition at line 176 of file gdata.h.

Referenced by euclid_distance(), and Nabra().

◆ Lx

#define Lx ( v,
i )   ((v).gp[(i)])

Definition at line 191 of file gdata.h.

◆ Lxt

#define Lxt ( v,
i )   ((v).gp[((i)-1)])

Definition at line 199 of file gdata.h.

Referenced by euclid_distance().

◆ pLx

#define pLx ( v,
i )   ((v)->gp[(i)])

Definition at line 195 of file gdata.h.

◆ pLxt

#define pLxt ( v,
i )   ((v)->gp[((i)-1)])

Definition at line 203 of file gdata.h.

◆ pPx

#define pPx ( v,
i,
j )   ((v)->gp[(i)+(v)->xs*(j)])

Definition at line 196 of file gdata.h.

◆ pPxt

#define pPxt ( v,
i,
j )   ((v)->gp[((i)-1)+(v)->xs*((j)-1)])

Definition at line 204 of file gdata.h.

◆ pVx

#define pVx ( v,
i,
j,
k )   ((v)->gp[(i)+(v)->xs*(j)+(v)->xs*(v)->ys*(k)])

Definition at line 197 of file gdata.h.

◆ pVxt

#define pVxt ( v,
i,
j,
k )   ((v)->gp[((i)-1)+(v)->xs*((j)-1)+(v)->xs*(v).ys->((k)-1)])

Definition at line 205 of file gdata.h.

◆ Px

#define Px ( v,
i,
j )   ((v).gp[(i)+(v).xs*(j)])

Definition at line 192 of file gdata.h.

Referenced by grab_WSGraph(), Laplacian(), and triangle().

◆ Pxt

#define Pxt ( v,
i,
j )   ((v).gp[((i)-1)+(v).xs*((j)-1)])

Definition at line 200 of file gdata.h.

◆ unset_RZxy

#define unset_RZxy ( )    {ChkRZxy=OFF;}

Definition at line 170 of file gdata.h.

Referenced by read_dicom_file().

◆ Vx

#define Vx ( v,
i,
j,
k )   ((v).gp[(i)+(v).xs*(j)+(v).xs*(v).ys*(k)])

Definition at line 193 of file gdata.h.

Referenced by fxSobel(), fySobel(), fzSobel(), xSobel(), ySobel(), and zSobel().

◆ Vxt

#define Vxt ( v,
i,
j,
k )   ((v).gp[((i)-1)+(v).xs*((j)-1)+(v).xs*(v).ys*((k)-1)])

Definition at line 201 of file gdata.h.

Referenced by euclid_distance().

Function Documentation

◆ B2WSGraph()

WSGraph B2WSGraph ( BSGraph vp)

WSGraph B2WSGraph(BSGraph vp)

uByte型単純グラフィックデータ(ISGraph)を sWord型単純グラフィック データ(WSGraph)に変換する.

Parameters
vp変換する int型単純グラフィックデータ
Returns
変換された sWord型単純グラフィックデータ(WSGraph).

Definition at line 649 of file gdata.c.

650{
651 int i;
652 WSGraph ix;
653
654 ix.xs = vp.xs;
655 ix.ys = vp.ys;
656 ix.zs = vp.zs;
657 ix.state = vp.state;
658
659 ix.gp = (sWord*)malloc(ix.xs*ix.ys*ix.zs*sizeof(sWord));
660 if (ix.gp==NULL) {
661 memset(&ix, 0, sizeof(WSGraph));
663 return ix;
664 }
665 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (sWord)vp.gp[i];
666
667 return ix;
668}
short sWord
2Byte
Definition common.h:335
#define JBXL_GRAPH_MEMORY_ERROR
メモリエラー
Definition jbxl_state.h:170
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition gdata.h:30
int xs
xサイズ. 4Byte.
Definition gdata.h:28
int state
状態
Definition gdata.h:31
uByte * gp
グラフィックデータへのポインタ. xs*ys*zs*1Byte.
Definition gdata.h:32
int ys
yサイズ. 4Byte.
Definition gdata.h:29
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition gdata.h:45
int xs
xサイズ. 4Byte.
Definition gdata.h:43
int state
状態
Definition gdata.h:46
sWord * gp
グラフィックデータへのポインタ. xs*ys*zs*2Byte.
Definition gdata.h:47
int ys
yサイズ. 4Byte.
Definition gdata.h:44

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.

◆ chk_RZxy()

int chk_RZxy ( void )

int chk_RZxy(void)

z軸のひずみを設定が設定されているかどうかをチェックする.

Definition at line 832 of file gdata.c.

833{
834 if (ChkRZxy==OFF) {
835 DEBUG_MODE PRINT_MESG("CHK_RZXY: WARNING: undefined RZxy!!!\n");
836 //exit(1);
837 return FALSE;
838 }
839 return TRUE;
840}
#define OFF
Definition common.h:231
#define TRUE
Definition common.h:226
#define FALSE
Definition common.h:223
int ChkRZxy
Definition gdata.c:16
#define PRINT_MESG
環境依存用の出力関数.print_message()
Definition tools.h:475
#define DEBUG_MODE
Definition tools.h:502

References ChkRZxy, DEBUG_MODE, FALSE, OFF, PRINT_MESG, and TRUE.

Referenced by get_wdat(), set_wdat(), write_ct_file(), and write_file_rb().

Here is the caller graph for this function:

◆ copy_WSGraph()

void copy_WSGraph ( WSGraph src,
WSGraph dst )

void copy_WSGraph(WSGraph src, WSGraph dst)

WSGraph型データのバッファ部をコピーする.とにかくコピーする.できるだけコピーする.

コピー元とコピー先のバッファ部のサイズが合わない場合,コピー結果は保証されない.

Parameters
srcコピー元グラフィックデータ
dstコピー先グラフィックデータ

Definition at line 1352 of file graph.c.

1353{
1354 int i, ssz, dsz, sz;
1355
1356 if (src.zs<=0) src.zs = 1;
1357 if (dst.zs<=0) dst.zs = 1;
1358 ssz = src.xs*src.ys*src.zs;
1359 dsz = dst.xs*dst.ys*dst.zs;
1360 sz = Min(ssz, dsz);
1361
1362 for (i=0; i<sz; i++) dst.gp[i] = src.gp[i];
1363 for (i=sz; i<dsz; i++) dst.gp[i] = 0;
1364 return;
1365}
#define Min(x, y)
Definition common.h:250

References WSGraph::gp, Min, WSGraph::xs, WSGraph::ys, and WSGraph::zs.

◆ F2WSGraph()

WSGraph F2WSGraph ( FSGraph vp)

WSGraph F2WSGraph(FSGraph vp)

double型単純グラフィックデータ(FSGraph)を sWord型単純グラフィック データ(WSGraph)に変換する.

Parameters
vp変換する double型単純グラフィックデータ
Returns
変換された sWord型単純グラフィックデータ(WSGraph).

Definition at line 711 of file gdata.c.

712{
713 int i;
714 WSGraph ix;
715
716 ix.xs = vp.xs;
717 ix.ys = vp.ys;
718 ix.zs = vp.zs;
719 ix.state = vp.state;
720
721 ix.gp = (sWord*)malloc(ix.xs*ix.ys*ix.zs*sizeof(sWord));
722 if (ix.gp==NULL) {
723 memset(&ix, 0, sizeof(WSGraph));
725 return ix;
726 }
727 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (sWord)vp.gp[i];
728
729 return ix;
730}
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition gdata.h:73
int xs
xサイズ. 4Byte.
Definition gdata.h:71
int state
状態
Definition gdata.h:74
double * gp
グラフィックデータへのポインタ. xs*ys*zs*sizeof(double)
Definition gdata.h:75
int ys
yサイズ. 4Byte.
Definition gdata.h:72

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.

◆ free_CmnHead()

void free_CmnHead ( CmnHead * hd)

void free_CmnHead(CmnHead* hd)

共通ヘッダのメモリ領域を開放する.CmnHead.kind は HEADER_NONE になる. init_CmnHead()を内包している.

Parameters
hd開放する共通ヘッダ

Definition at line 27 of file gdata.c.

28{
29 if (hd!=NULL) {
30 if (hd->buf!=NULL) free(hd->buf);
31 if (hd->grptr!=NULL) free(hd->grptr);
32 init_CmnHead(hd);
33 }
34}
void init_CmnHead(CmnHead *hd)
Definition gdata.c:44
uByte * buf
Ture Header buffer
Definition gheader.h:137
uByte * grptr
Pointer to Data.
Definition gheader.h:138

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grab_WSGraph()

WSGraph grab_WSGraph ( WSGraph vp,
int x1,
int y1,
int x2,
int y2 )

WSGraph grab_WSGraph(WSGraph vp, int x1, int y1, int x2, int y2)

WSGraph型データの (x1,y1)-(x2,y2)の矩形部分だけを取り出す.

(x1,y1)-(x2,y2)が元のデータのサイズを越える場合は,元のデータに合わせられる.

Parameters
vp操作対象グラフィックデータ
(x1,y1),(x2,y2)矩形の対角の座標.
Returns
取り出したグラフィックデータ.

Definition at line 1311 of file graph.c.

1312{
1313 int i, j, xs, xe, ys, ye, xsize, ysize;
1314 WSGraph xp;
1315
1316 xs = Min(x1, x2);
1317 xe = Max(x1, x2);
1318 xe = Min(xe, vp.xs-1);
1319 ys = Min(y1, y2);
1320 ye = Max(y1, y2);
1321 ye = Min(ye, vp.ys-1);
1322 xsize = xe - xs + 1;
1323 ysize = ye - ys + 1;
1324
1325 xp = make_WSGraph(xsize, ysize, 1);
1326 if (xp.gp==NULL) {
1327 memset(&xp, 0, sizeof(WSGraph));
1329 return xp;
1330 }
1331
1332 for (j=0; j<ysize; j++) {
1333 for (i=0; i<xsize; i++) {
1334 Px(xp, i, j) = Px(vp, i+xs, j+ys);
1335 }
1336 }
1337
1338 return xp;
1339}
#define Max(x, y)
Definition common.h:247
WSGraph make_WSGraph(int xs, int ys, int zs)
Definition gdata.c:108
#define Px(v, i, j)
2次元画像データ vの (i, j) のデータを参照する.
Definition gdata.h:192

References WSGraph::gp, JBXL_GRAPH_MEMORY_ERROR, make_WSGraph(), Max, Min, Px, WSGraph::state, WSGraph::xs, and WSGraph::ys.

Here is the call graph for this function:

◆ I2WSGraph()

WSGraph I2WSGraph ( ISGraph vp)

WSGraph I2WSGraph(ISGraph vp)

int型単純グラフィックデータ(ISGraph)を sWord型単純グラフィック データ(WSGraph)に変換する.

Parameters
vp変換する int型単純グラフィックデータ
Returns
変換された sWord型単純グラフィックデータ(WSGraph).

Definition at line 680 of file gdata.c.

681{
682 int i;
683 WSGraph ix;
684
685 ix.xs = vp.xs;
686 ix.ys = vp.ys;
687 ix.zs = vp.zs;
688 ix.state = vp.state;
689
690 ix.gp = (sWord*)malloc(ix.xs*ix.ys*ix.zs*sizeof(sWord));
691 if (ix.gp==NULL) {
692 memset(&ix, 0, sizeof(WSGraph));
694 return ix;
695 }
696 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (sWord)vp.gp[i];
697
698 return ix;
699}
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition gdata.h:59
int xs
xサイズ. 4Byte.
Definition gdata.h:57
int state
状態
Definition gdata.h:60
int ys
yサイズ. 4Byte.
Definition gdata.h:58
int * gp
グラフィックデータへのポインタ. xs*ys*zs*4Byte
Definition gdata.h:61

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.

◆ init_CmnHead()

void init_CmnHead ( CmnHead * hd)

void init_CmnHead(CmnHead* hd)

共通ヘッダのメモリ領域を初期化する.CmnHead.kind は HEADER_NONE になる.

Parameters
hd初期化する共通ヘッダ

Definition at line 44 of file gdata.c.

45{
46 if (hd!=NULL) {
47 memset(hd, 0, sizeof(CmnHead));
48 hd->kind = HEADER_NONE;
49 }
50}
#define HEADER_NONE
0x8000 // ヘッダ種別の指定なし
Definition gheader.h:212
int kind
Kind of Graphics Format.
Definition gheader.h:127

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().

Here is the caller graph for this function:

◆ init_DRBound()

void init_DRBound ( DRBound * rb)

void init_DRBound(DRBound* rb)

2D境界データ構造体を初期化する.

Parameters
[out]rb初期化する境界データ.

Definition at line 802 of file gdata.c.

803{
804 rb->xmax = rb->ymax = rb->zmax = 0.0;
805 rb->xmin = rb->ymin = rb->zmin = DBL_MAX;
806 rb->misc = OFF;
807}
double xmax
Definition gdata.h:126
int misc
Definition gdata.h:131
double ymin
Definition gdata.h:127
double zmin
Definition gdata.h:129
double xmin
Definition gdata.h:125
double zmax
Definition gdata.h:130
double ymax
Definition gdata.h:128

References DRBound::misc, OFF, DRBound::xmax, DRBound::xmin, DRBound::ymax, DRBound::ymin, DRBound::zmax, and DRBound::zmin.

◆ init_IRBound()

void init_IRBound ( IRBound * rb)

void init_IRBound(IRBound* rb)

境界データ構造体を初期化する.

Parameters
[out]rb初期化する境界データ.

Definition at line 787 of file gdata.c.

788{
789 rb->xmax = rb->ymax = rb->zmax = 0;
790 rb->xmin = rb->ymin = rb->zmin = SINTMAX;
791 rb->misc = OFF;
792}
#define SINTMAX
Definition common.h:204
int xmax
x軸境界の最大値.
Definition gdata.h:115
int misc
多目的用.
Definition gdata.h:120
int ymax
y軸境界の最大値.
Definition gdata.h:117
int xmin
x軸境界の最小値.
Definition gdata.h:114
int ymin
y軸境界の最小値.
Definition gdata.h:116
int zmax
z軸境界の最大値.
Definition gdata.h:119
int zmin
z軸境界の最小値.
Definition gdata.h:118

References IRBound::misc, OFF, SINTMAX, IRBound::xmax, IRBound::xmin, IRBound::ymax, IRBound::ymin, IRBound::zmax, and IRBound::zmin.

Referenced by cut_object().

Here is the caller graph for this function:

◆ make_BSGraph()

BSGraph make_BSGraph ( int xs,
int ys,
int zs )

BSGraph make_BSGraph(int xs, int ys, int zs)

Byte型単純グラフィックデータ(BSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
BSGraphグラフィックデータ構造体. メモリ領域を獲得できなかった場合,メモリ領域へのポインタは NULLとなる.

Definition at line 66 of file gdata.c.

67{
68 int i;
69 BSGraph vp;
70
71 memset(&vp, 0, sizeof(BSGraph));
72 if (xs==0 || ys==0) {
74 return vp;
75 }
76
77 vp.xs = xs;
78 vp.ys = ys;
79 if (zs>0) vp.zs = zs;
80 else vp.zs = 1;
81 vp.state = JBXL_NORMAL;
82
83 vp.gp = (uByte*)malloc(vp.xs*vp.ys*vp.zs*sizeof(uByte));
84 if (vp.gp==NULL) {
85 memset(&vp, 0, sizeof(BSGraph));
87 return vp;
88 }
89 for (i=0; i<vp.xs*vp.ys*vp.zs; i++) vp.gp[i] = 0;
90
91 return vp;
92}
unsigned char uByte
1Byte
Definition common.h:332
#define JBXL_GRAPH_IVDARG_ERROR
無効な引数
Definition jbxl_state.h:178
#define JBXL_NORMAL
正常
Definition jbxl_state.h:32

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(), PNGImage2BSGraph(), and read_shape_main_file().

Here is the caller graph for this function:

◆ make_FSGraph()

FSGraph make_FSGraph ( int xs,
int ys,
int zs )

FSGraph make_FSGraph(int xs, int ys, int zs)

double 型単純グラフィックデータ(FSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
FSGraphグラフィックデータ構造体.メモリ領域を獲得できなかった場合, メモリ領域へのポインタは NULLとなる.

Definition at line 150 of file gdata.c.

151{
152 int i;
153 FSGraph vp;
154
155 memset(&vp, 0, sizeof(FSGraph));
156 if (xs==0 || ys==0) {
158 return vp;
159 }
160
161 vp.xs = xs;
162 vp.ys = ys;
163 if (zs>0) vp.zs = zs;
164 else vp.zs = 1;
165 vp.state = JBXL_NORMAL;
166
167 vp.gp = (double*)malloc(vp.xs*vp.ys*vp.zs*sizeof(double));
168 if (vp.gp==NULL) {
169 memset(&vp, 0, sizeof(FSGraph));
171 return vp;
172 }
173 for (i=0; i<vp.xs*vp.ys*vp.zs; i++) vp.gp[i] = 0.0;
174
175 return vp;
176}

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().

Here is the caller graph for this function:

◆ make_ISGraph()

ISGraph make_ISGraph ( int xs,
int ys,
int zs )

ISGraph make_ISGraph(int xs, int ys, int zs)

int型単純グラフィックデータ(ISGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
ISGraphグラフィックデータ構造体.メモリ領域を獲得できなかった場合, メモリ領域へのポインタは NULLとなる.

Definition at line 192 of file gdata.c.

193{
194 int i;
195 ISGraph vp;
196
197 memset(&vp, 0, sizeof(ISGraph));
198 if (xs==0 || ys==0) {
200 return vp;
201 }
202
203 vp.xs = xs;
204 vp.ys = ys;
205 if (zs>0) vp.zs = zs;
206 else vp.zs = 1;
207 vp.state = JBXL_NORMAL;
208
209 vp.gp = (int*)malloc(vp.xs*vp.ys*vp.zs*sizeof(int));
210 if (vp.gp==NULL) {
211 memset(&vp, 0, sizeof(ISGraph));
213 return vp;
214 }
215 for (i=0; i<vp.xs*vp.ys*vp.zs; i++) vp.gp[i] = 0;
216
217 return vp;
218}

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().

Here is the caller graph for this function:

◆ make_MSGraph()

MSGraph make_MSGraph ( int xs,
int ys,
int zs,
int depth )

MSGraph make_MSGraph(int xs, int ys, int zs, int depth)

単純グラフィックデータ(MSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
depthカラーデプス(bit)
Returns
MSGraphグラフィックデータ構造体.メモリ領域を獲得できなかった場合, メモリ領域へのポインタは NULLとなる.

Definition at line 277 of file gdata.c.

278{
279 MSGraph vp;
280
281 memset(&vp, 0, sizeof(MSGraph));
282 if (xs==0 || ys==0) {
284 return vp;
285 }
286
287 vp.xs = xs;
288 vp.ys = ys;
289 if (zs>0) vp.zs = zs;
290 else vp.zs = 1;
291 if (depth>0) vp.depth = depth;
292 else vp.depth = 1;
293 vp.state = JBXL_NORMAL;
294
295 vp.gp = (unsigned char*)malloc(xs*ys*zs*((depth+7)/8));
296 if (vp.gp==NULL) {
297 memset(&vp, 0, sizeof(MSGraph));
299 return vp;
300 }
301 memset(vp.gp, 0, xs*ys*zs*((depth+7)/8));
302 return vp;
303}
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition gdata.h:101
int xs
xサイズ. 4Byte.
Definition gdata.h:99
int state
状態
Definition gdata.h:103
unsigned char * gp
グラフィックデータへのポインタ. xs*ys*zs*depth.
Definition gdata.h:104
int depth
Color Depth.
Definition gdata.h:102
int ys
yサイズ. 4Byte.
Definition gdata.h:100

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().

Here is the caller graph for this function:

◆ make_VSGraph()

VSGraph make_VSGraph ( int xs,
int ys,
int zs )

VSGraph make_VSGraph(int xs, int ys, int zs)

vector型単純グラフィックデータ(VSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
VSGraphグラフィックデータ構造体.メモリ領域を獲得できなかった場合, メモリ領域へのポインタは NULLとなる.

Definition at line 234 of file gdata.c.

235{
236 int i;
237 VSGraph vp;
238
239 memset(&vp, 0, sizeof(VSGraph));
240 if (xs==0 || ys==0) {
242 return vp;
243 }
244
245 vp.xs = xs;
246 vp.ys = ys;
247 if (zs>0) vp.zs = zs;
248 else vp.zs = 1;
249 vp.state = JBXL_NORMAL;
250
251 vp.gp = (vector*)malloc(xs*ys*zs*sizeof(vector));
252 if (vp.gp==NULL) {
253 memset(&vp, 0, sizeof(VSGraph));
255 return vp;
256 }
257 for (i=0; i<xs*ys*zs; i++) vp.gp[i] = set_vector(0.0, 0.0, 0.0);
258
259 return vp;
260}
vector set_vector(double x, double y, double z)
Definition matrix.c:82
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition gdata.h:87
int xs
xサイズ. 4Byte.
Definition gdata.h:85
int state
状態
Definition gdata.h:88
vector * gp
グラフィックデータへのポインタ. xs*ys*zs*sizeof(vector).
Definition gdata.h:89
int ys
yサイズ. 4Byte.
Definition gdata.h:86

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_WSGraph()

WSGraph make_WSGraph ( int xs,
int ys,
int zs )

WSGraph make_WSGraph(int xs, int ys, int zs)

sWord型単純グラフィックデータ(WSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
WSGraphグラフィックデータ構造体.メモリ領域を獲得できなかった場合, メモリ領域へのポインタは NULLとなる.

Definition at line 108 of file gdata.c.

109{
110 int i;
111 WSGraph vp;
112
113 memset(&vp, 0, sizeof(WSGraph));
114 if (xs==0 || ys==0) {
116 return vp;
117 }
118
119 vp.xs = xs;
120 vp.ys = ys;
121 if (zs>0) vp.zs = zs;
122 else vp.zs = 1;
123 vp.state = JBXL_NORMAL;
124
125 vp.gp = (sWord*)malloc(vp.xs*vp.ys*vp.zs*sizeof(sWord));
126 if (vp.gp==NULL) {
127 memset(&vp, 0, sizeof(WSGraph));
129 return vp;
130 }
131 for (i=0; i<vp.xs*vp.ys*vp.zs; i++) vp.gp[i] = 0;
132
133 return vp;
134}

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(), PNGImage2WSGraph(), pool(), read_dicom_file(), to2d(), torus(), V2WSGraph(), x_reverse_wsg(), xSobel(), xxSobel(), ySobel(), yySobel(), zoom_WSGraph(), zSobel(), and zzSobel().

Here is the caller graph for this function:

◆ new_BSGraph()

BSGraph * new_BSGraph ( int xs,
int ys,
int zs )

BSGraph* new_BSGraph(int xs, int ys, int zs)

Byte型単純グラフィックデータ(BSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
BSGraphグラフィックデータ構造体へのポインタ.要 del_ メモリ領域を獲得できなかった場合は NULLとなる.

Definition at line 319 of file gdata.c.

320{
321 int i;
322 BSGraph* vp;
323
324 vp = (BSGraph*)malloc(sizeof(BSGraph));
325 if (vp==NULL) return NULL;
326 memset(vp, 0, sizeof(BSGraph));
327
328 if (xs==0 || ys==0) {
330 return vp;
331 }
332
333 vp->xs = xs;
334 vp->ys = ys;
335 if (zs>0) vp->zs = zs;
336 else vp->zs = 1;
337 vp->state = JBXL_NORMAL;
338
339 vp->gp = (uByte*)malloc(vp->xs*vp->ys*vp->zs*sizeof(uByte));
340 if (vp->gp==NULL) {
341 memset(vp, 0, sizeof(BSGraph));
343 return vp;
344 }
345 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = 0;
346
347 return vp;
348}

References BSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, BSGraph::state, BSGraph::xs, BSGraph::ys, and BSGraph::zs.

◆ new_FSGraph()

FSGraph * new_FSGraph ( int xs,
int ys,
int zs )

FSGraph* new_FSGraph(int xs, int ys, int zs)

double 型単純グラフィックデータ(FSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
FSGraphグラフィックデータ構造体へのポインタ. メモリ領域を獲得できなかった場合は NULLとなる.

Definition at line 409 of file gdata.c.

410{
411 int i;
412 FSGraph* vp;
413
414 vp = (FSGraph*)malloc(sizeof(FSGraph));
415 if (vp==NULL) return NULL;
416 memset(vp, 0, sizeof(FSGraph));
417
418 if (xs==0 || ys==0) {
420 return vp;
421 }
422
423 vp->xs = xs;
424 vp->ys = ys;
425 if (zs>0) vp->zs = zs;
426 else vp->zs = 1;
427 vp->state = JBXL_NORMAL;
428
429 vp->gp = (double*)malloc(vp->xs*vp->ys*vp->zs*sizeof(double));
430 if (vp->gp==NULL) {
431 memset(vp, 0, sizeof(FSGraph));
433 return vp;
434 }
435 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = 0.0;
436
437 return vp;
438}

References FSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, FSGraph::state, FSGraph::xs, FSGraph::ys, and FSGraph::zs.

◆ new_ISGraph()

ISGraph * new_ISGraph ( int xs,
int ys,
int zs )

ISGraph* new_ISGraph(int xs, int ys, int zs)

int型単純グラフィックデータ(ISGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
ISGraphグラフィックデータ構造体へのポインタ. メモリ領域を獲得できなかった場合は NULLとなる.

Definition at line 454 of file gdata.c.

455{
456 int i;
457 ISGraph* vp;
458
459 vp = (ISGraph*)malloc(sizeof(ISGraph));
460 if (vp==NULL) return NULL;
461 memset(vp, 0, sizeof(ISGraph));
462
463 if (xs==0 || ys==0) {
465 return vp;
466 }
467
468 vp->xs = xs;
469 vp->ys = ys;
470 if (zs>0) vp->zs = zs;
471 else vp->zs = 1;
472 vp->state = JBXL_NORMAL;
473
474 vp->gp = (int*)malloc(vp->xs*vp->ys*vp->zs*sizeof(int));
475 if (vp->gp==NULL) {
476 memset(vp, 0, sizeof(ISGraph));
478 return vp;
479 }
480 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = 0;
481
482 return vp;
483}

References ISGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, ISGraph::state, ISGraph::xs, ISGraph::ys, and ISGraph::zs.

◆ new_MSGraph()

MSGraph * new_MSGraph ( int xs,
int ys,
int zs,
int depth )

MSGraph* new_MSGraph(int xs, int ys, int zs, int depth)

単純グラフィックデータ(MSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
depthカラーデプス(bit)
Returns
MSGraphグラフィックデータ構造体へのポインタ. メモリ領域を獲得できなかった場合は NULLとなる.

Definition at line 545 of file gdata.c.

546{
547 MSGraph* vp;
548
549 vp = (MSGraph*)malloc(sizeof(MSGraph));
550 if (vp==NULL) return NULL;
551 memset(vp, 0, sizeof(MSGraph));
552
553 if (xs==0 || ys==0) {
555 return vp;
556 }
557
558 vp->xs = xs;
559 vp->ys = ys;
560 if (zs>0) vp->zs = zs;
561 else vp->zs = 1;
562 if (depth>0) vp->depth = depth;
563 else vp->depth = 1;
564 vp->state = JBXL_NORMAL;
565
566 vp->gp = (unsigned char*)malloc(vp->xs*vp->ys*vp->zs*((depth+7)/8));
567 if (vp->gp==NULL) {
568 memset(vp, 0, sizeof(MSGraph));
570 return vp;
571 }
572 memset(vp->gp, 0, vp->xs*vp->ys*vp->zs*((depth+7)/8));
573
574 return vp;
575}

References MSGraph::depth, MSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, MSGraph::state, MSGraph::xs, MSGraph::ys, and MSGraph::zs.

◆ new_VSGraph()

VSGraph * new_VSGraph ( int xs,
int ys,
int zs )

VSGraph* new_VSGraph(int xs, int ys, int zs)

vector型単純グラフィックデータ(VSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
VSGraphグラフィックデータ構造体へのポインタ. メモリ領域を獲得できなかった場合は NULLとなる.

Definition at line 499 of file gdata.c.

500{
501 int i;
502 VSGraph* vp;
503
504 vp = (VSGraph*)malloc(sizeof(VSGraph));
505 if (vp==NULL) return NULL;
506 memset(vp, 0, sizeof(VSGraph));
507
508 if (xs==0 || ys==0) {
510 return vp;
511 }
512
513 vp->xs = xs;
514 vp->ys = ys;
515 if (zs>0) vp->zs = zs;
516 else vp->zs = 1;
517 vp->state = JBXL_NORMAL;
518
519 vp->gp = (vector*)malloc(vp->xs*vp->ys*vp->zs*sizeof(vector));
520 if (vp->gp==NULL) {
521 memset(vp, 0, sizeof(VSGraph));
523 return vp;
524 }
525 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = set_vector(0.0, 0.0, 0.0);
526
527 return vp;
528}

References VSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, set_vector(), VSGraph::state, VSGraph::xs, VSGraph::ys, and VSGraph::zs.

Here is the call graph for this function:

◆ new_WSGraph()

WSGraph * new_WSGraph ( int xs,
int ys,
int zs )

WSGraph* new_WSGraph(int xs, int ys, int zs)

sWord型単純グラフィックデータ(WSGraph)のメモリ領域を確保する. グラフィックデータ部分は 0クリアされる.

Parameters
xs確保するグラフィックデータの x方向のサイズ.
ys確保するグラフィックデータの y方向のサイズ.
zs確保するグラフィックデータの z方向のサイズ.
Returns
WSGraphグラフィックデータ構造体へのポインタ. メモリ領域を獲得できなかった場合は NULLとなる.

Definition at line 364 of file gdata.c.

365{
366 int i;
367 WSGraph* vp;
368
369 vp = (WSGraph*)malloc(sizeof(WSGraph));
370 if (vp==NULL) return NULL;
371 memset(vp, 0, sizeof(WSGraph));
372
373 if (xs==0 || ys==0) {
375 return vp;
376 }
377
378 vp->xs = xs;
379 vp->ys = ys;
380 if (zs>0) vp->zs = zs;
381 else vp->zs = 1;
382 vp->state = JBXL_NORMAL;
383
384 vp->gp = (sWord*)malloc(vp->xs*vp->ys*vp->zs*sizeof(sWord));
385 if (vp->gp==NULL) {
386 memset(vp, 0, sizeof(WSGraph));
388 return vp;
389 }
390 for (i=0; i<vp->xs*vp->ys*vp->zs; i++) vp->gp[i] = 0;
391
392 return vp;
393}

References WSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, JBXL_NORMAL, WSGraph::state, WSGraph::xs, WSGraph::ys, and WSGraph::zs.

◆ set_RZxy()

void set_RZxy ( double rzm)

void set_RZxy(double rzm)

z軸のひずみを設定する.デフォルトでは 1.0に設定されている. 設定を無効にするには void unset_RZxy(void) を使用する.

Parameters
rzmひずみの値.

Definition at line 818 of file gdata.c.

819{
820 ChkRZxy = ON;
821 RZxy = rzm;
822 //fprintf(stderr,"set_RZxy: set RZxy to %f\n", rzm);
823}
#define ON
Definition common.h:230
double RZxy
Definition gdata.c:15

References ChkRZxy, ON, and RZxy.

Referenced by read_dicom_file(), read_wsg_file(), and read_wsg_file_rb().

Here is the caller graph for this function:

◆ V2FSGraph()

FSGraph V2FSGraph ( VSGraph vp)

WSGraph V2FSGraph(VSGraph vp)

vector型単純グラフィックデータ(VSGraph)を double型単純グラフィック データ(FSGraph)に変換する.

Parameters
vp変換する vector型単純グラフィックデータ
Returns
変換された double型単純グラフィックデータ(FSGraph).

Definition at line 742 of file gdata.c.

743{
744 int i;
745 FSGraph ix;
746
747 ix = make_FSGraph(vp.xs, vp.ys, vp.zs);
748 if (ix.gp==NULL) return ix;
749
750 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = vp.gp[i].n;
751 ix.state = vp.state;
752
753 return ix;
754}
FSGraph make_FSGraph(int xs, int ys, int zs)
Definition gdata.c:150
double n
ベクトルの大きさ
Definition matrix.h:33

References FSGraph::gp, VSGraph::gp, make_FSGraph(), vector::n, FSGraph::state, VSGraph::state, FSGraph::xs, VSGraph::xs, FSGraph::ys, VSGraph::ys, FSGraph::zs, and VSGraph::zs.

Here is the call graph for this function:

◆ V2WSGraph()

WSGraph V2WSGraph ( VSGraph vp)

WSGraph V2WSGraph(VSGraph vp)

vector型単純グラフィックデータ(VSGraph)を sWord型単純グラフィックデータ(WSGraph)に変換する.

Parameters
vp変換する vector型単純グラフィックデータ
Returns
変換された sWord型単純グラフィックデータ(WSGraph).

Definition at line 765 of file gdata.c.

766{
767 int i;
768 WSGraph ix;
769
770 ix = make_WSGraph(vp.xs, vp.ys, vp.zs);
771 if (ix.gp==NULL) return ix;
772
773 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (sWord)vp.gp[i].n;
774 ix.state = vp.state;
775
776 return ix;
777}

References WSGraph::gp, VSGraph::gp, make_WSGraph(), vector::n, WSGraph::state, VSGraph::state, WSGraph::xs, VSGraph::xs, WSGraph::ys, VSGraph::ys, WSGraph::zs, and VSGraph::zs.

Here is the call graph for this function:

◆ W2FSGraph()

FSGraph W2FSGraph ( WSGraph vp)

FSGraph W2FSGraph(WSGraph vp)

sWord型単純グラフィックデータ(WSGraph)を double型単純グラフィック データ(FSGraph)に変換する.

Parameters
vp変換する sWord型単純グラフィックデータ
Returns
変換された double型単純グラフィックデータ(FSGraph).

Definition at line 618 of file gdata.c.

619{
620 int i;
621 FSGraph ix;
622
623 ix.xs = vp.xs;
624 ix.ys = vp.ys;
625 ix.zs = vp.zs;
626 ix.state = vp.state;
627
628 ix.gp = (double*)malloc(ix.xs*ix.ys*ix.zs*sizeof(double));
629 if (ix.gp==NULL) {
630 memset(&ix, 0, sizeof(FSGraph));
632 return ix;
633 }
634 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i]=(double)vp.gp[i];
635
636 return ix;
637}

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().

Here is the caller graph for this function:

◆ W2ISGraph()

ISGraph W2ISGraph ( WSGraph vp)

ISGraph W2ISGraph(WSGraph vp)

sWord型単純グラフィックデータ(WSGraph)を int型単純グラフィック データ(ISGraph)に変換する.

Parameters
vp変換する sWord型単純グラフィックデータ
Returns
変換された int型単純グラフィックデータ(ISGraph).

Definition at line 587 of file gdata.c.

588{
589 int i;
590 ISGraph ix;
591
592 ix.xs = vp.xs;
593 ix.ys = vp.ys;
594 ix.zs = vp.zs;
595 ix.state = vp.state;
596
597 ix.gp = (int*)malloc(ix.xs*ix.ys*ix.zs*sizeof(int));
598 if (ix.gp==NULL) {
599 memset(&ix, 0, sizeof(ISGraph));
601 return ix;
602 }
603 for (i=0; i<ix.xs*ix.ys*ix.zs; i++) ix.gp[i] = (int)vp.gp[i];
604
605 return ix;
606}

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.

◆ zoom_WSGraph()

WSGraph zoom_WSGraph ( WSGraph vp,
int zm,
int mode )

WSGraph zoom_WSGraph(WSGraph vp, int zm, int mode)

グラフィックデータ拡大する.

Parameters
vp変換する Word型単純グラフィックデータ.
zm倍率.
modeモード.1: 線形補間拡大,その他: 単純拡大
Returns
拡大したグラフィックデータ.

Definition at line 1245 of file graph.c.

1246{
1247 WSGraph vx;
1248 int i, j, k, l, m, n;
1249 sWord ws, wt;
1250
1251 memset(&vx, 0, sizeof(WSGraph));
1252 if (zm<1) {
1254 return vx;
1255 }
1256
1257 vx = make_WSGraph(vp.xs*zm, vp.ys*zm, 1);
1258 if (vx.gp==NULL) {
1259 memset(&vx, 0, sizeof(WSGraph));
1261 return vx;
1262 }
1263
1264 if (mode==1){
1265 for(j=0; j<vp.ys; j++) {
1266 for(i=0; i<vp.xs; i++) {
1267 m = i + j*vp.xs;
1268 n = (i + j*vx.xs)*zm;
1269 if(i==vp.xs-1) wt = 0;
1270 else wt = (vp.gp[m+1] - vp.gp[m])/zm;
1271 if(j==vp.ys-1) ws = 0;
1272 else ws = (vp.gp[m+vp.xs] - vp.gp[m])/zm;
1273
1274 for(k=0; k<zm; k++) {
1275 for(l=0; l<zm; l++) {
1276 vx.gp[n+l+k*vx.xs] = ws*k + wt*l + vp.gp[m];
1277 }
1278 }
1279 }
1280 }
1281 }
1282 else {
1283 for(j=0; j<vp.ys; j++) {
1284 for(i=0; i<vp.xs; i++) {
1285 m = i + j*vp.xs;
1286 n = (i + j*vx.xs)*zm;
1287 for(k=0; k<zm; k++) {
1288 for(l=0; l<zm; l++) {
1289 vx.gp[n+l+k*vx.xs] = vp.gp[m];
1290 }
1291 }
1292 }
1293 }
1294 }
1295 return vx;
1296}

References WSGraph::gp, JBXL_GRAPH_IVDARG_ERROR, JBXL_GRAPH_MEMORY_ERROR, make_WSGraph(), WSGraph::state, WSGraph::xs, and WSGraph::ys.

Here is the call graph for this function:

Variable Documentation

◆ ChkRZxy

int ChkRZxy
extern

Definition at line 16 of file gdata.c.

Referenced by chk_RZxy(), and set_RZxy().

◆ RZxy

double RZxy
extern

Definition at line 15 of file gdata.c.

Referenced by get_wdat(), set_RZxy(), set_wdat(), sphere(), write_ct_file(), and write_file_rb().

◆ ZeroBase

int ZeroBase
extern

Definition at line 14 of file gdata.c.

Referenced by read_wsg_file(), read_wsg_file_rb(), write_ct_file(), and write_file_rb().