JunkBox_Lib  1.10.2
gdata.c File Reference

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

#include "gdata.h"
#include "jbxl_state.h"
Include dependency graph for gdata.c:

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

Detailed Description

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

Definition in file gdata.c.

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
Definition: gdata.h:42
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:

◆ 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:

◆ 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
Definition: gdata.h:27

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 }
Definition: gdata.h:70

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 }
Definition: gdata.h:56

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 }
Definition: gdata.h:98
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
Definition: gdata.h:84
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
Definition: matrix.h:29

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 }
WSGraph make_WSGraph(int xs, int ys, int zs)
Definition: gdata.c:108

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.

Variable Documentation

◆ ChkRZxy

int ChkRZxy = OFF

Definition at line 16 of file gdata.c.

Referenced by chk_RZxy(), and set_RZxy().

◆ RZxy

double RZxy = 1.0

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 = 0

Definition at line 14 of file gdata.c.

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