1#ifndef __JBXL_CPP_MORPHOLOGY_H_
2#define __JBXL_CPP_MORPHOLOGY_H_
24#define SPHERE_ELEMENT 1
77 int i, j, k, ks, cz, cy, cx, ps;
80 if (wp.
isNull())
return wp;
83 for (k=0; k<vp.
zs; k++) {
85 for (j=0; j<vp.
ys; j++) {
87 for (i=0; i<vp.
xs; i++) {
107 int i, j, k, cx, cy, cz;
108 int xx, yy, zz, ax, ay, az;
110 for (k=0; k<xp.
zs; k++) {
111 zz = z + k - xp.
zs/2;
113 if (zz>vp.
zs-1) zz = vp.
zs-1;
116 for (j=0; j<xp.
ys; j++) {
117 yy = y + j - xp.
ys/2;
120 for (i=0; i<xp.
xs; i++) {
121 xx = x + i - xp.
xs/2;
125 if (!(xx>=0&&xx<vp.xs&&yy>=0&&yy<vp.
ys))
return false;
126 if (vp.
gp[ax]<cc)
return false;
142 int i, j, k, cx, cy, cz;
143 int xx, yy, zz, ax, ay, az;
145 for (k=0; k<xp.
zs; k++) {
146 zz = z + k - xp.
zs/2;
149 for (j=0; j<xp.
ys; j++) {
150 yy = y + j - xp.
ys/2;
153 for (i=0; i<xp.
xs; i++) {
154 xx = x + i - xp.
xs/2;
157 if (xx>=0&&xx<vp.xs&&yy>=0&&yy<vp.ys&&zz>=0&&zz<vp.
zs){
158 if (xp.
gp[cx]>0) vp.
gp[ax] = xp.
gp[cx];
173 int i, j, k, ps, cz, cy, cx;
176 if (wp.
isNull())
return wp;
179 for (k=0; k<vp.
zs; k++) {
181 for (j=0; j<vp.
ys; j++) {
183 for (i=0; i<vp.
xs; i++) {
201 int i, j, k, cx, cy, cz;
202 int xx, yy, zz, ax, ay, az;
204 for (k=0; k<xp.
zs; k++) {
205 zz = z + k - xp.
zs/2;
207 if (zz>vp.
zs-1) zz = vp.
zs-1;
210 for (j=0; j<xp.
ys; j++) {
211 yy = y + j - xp.
ys/2;
214 for (i=0; i<xp.
xs; i++) {
215 xx = x + i - xp.
xs/2;
219 if (xx>=0&&xx<vp.xs&&yy>=0&&yy<vp.
ys) {
220 if (vp.
gp[ax]>=cc)
return true;
237 int *p, n, m, r, c, i, j, k, z;
239 double s, sn, cs, dr, dt, df, th, fi, rx, zz;
250 vp.
getm(xs, xs, (
int)(xs*s+0.5));
251 if (vp.
isNull())
return vp;
257 for (z=0; z<vp.
zs; z++) {
260 ir = (int)(sqrt(
Max(r*r-zz*zz, 0.0))+0.5);
261 circle(xp, r, r, ir, c,
ON);
int zs
zサイズ. 4Byte. 2Dの場合は 1.
bool isNull(void)
グラフィックデータを持っていないか?
void getm(int x, int y, int z=1, T v=(T) 0)
グラフィックメモリを獲得する
MSGraph< T > fat_object_morph(MSGraph< T > vp, MSGraph< T > xp, int cc)
MSGraph< T > Morphology(MSGraph< T > vp, MSGraph< T > xp, int cc, int mode)
void copy_morph_element(MSGraph< T > vp, int x, int y, int z, MSGraph< T > xp)
bool point_fat_object_morph(MSGraph< T > vp, int x, int y, int z, MSGraph< T > xp, int cc)
MSGraph< T > make_element_morph(Parameter32 x)
bool point_open_morph(MSGraph< T > vp, int x, int y, int z, MSGraph< T > xp, int cc)
MSGraph< T > opening_morph(MSGraph< T > vp, MSGraph< T > xp, int cc)