flagflag  
1: 2011-07-30 (Sat) 23:16:04 iseki source
Line 1: Line 1:
 +*** different_proc [#m51b2aa5]
 + DIFFERENT_API MSGraph<sWord>* different_proc(MSGraph<sWord>* vp)
 + {
 +   MSGraph<sWord>* xp = NULL;
 +   ////////////////////////////////////////​/
 +   // 以下に処理コードを書く
 +   //        入力 vp, 出力 xp
 +   ////////////////////////////////////////​/
 +
 +   /**/////////////////////////////////////​////////////////////////////////////////​//
 +   //
 +   xp = new MSGraph<sWord>(vp->xs, vp->ys, vp->zs);
 +
 +   for (int j=1; j<vp->ys-1; j++) {
 +       for (int i=1; i<vp->xs-1; i++) {
 +           xp->point(i, j) = (vp->point(i+1, j) - vp->point(i-1, j))/2;
 +       }
 +   }
 +
 +
 +   /*//////////////////////////////////////​////////////////////////////////////////​//
 +   // フィルターによる計算
 +   sWord mask[] = {  0,  0,  0,
 +                     -1,  0,  1,
 +                     0,  0,  0  };
 +
 +   // Filterの作成
 +   MSGraph<sWord>* filter = new MSGraph<sWord>(3, 3);    // フィルターのサイズを正確に指定する
 +   filter->set_array(mask);                            // フィルターへコピー
 +   filter->norm = 2.0;                                    // 規格化の係数
 +
 +   xp  = new MSGraph<sWord>();
 +   *xp = MSMaskFilter(*vp, *filter);
 +
 +   // Filterの開放
 +   filter->free();
 +   delete(filter);
 +   /**/
 +
 +
 +   /**/////////////////////////////////////​////////////////////////////////////////​//
 +   // 絶対値の計算
 +   for (int j=0; j<vp->ys; j++) {
 +       for (int i=0; i<vp->xs; i++) {
 +           if (xp->point(i, j)<0) xp->point(i, j) = - xp->point(i, j);
 +       }
 +   }
 +   /**/
 +
 +   ////////////////////////////////////////​/
 +   // 処理コードはここまで
 +   ////////////////////////////////////////​/
 +
 +   return xp;
 + }


Front page   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthMay 2024Next Month
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Today

Who's Online

48 user(s) are online (14 user(s) are browsing xpwiki)

Members: 0
Guests: 48

more...

Access Counter

Today : 8318831883188318
Yesterday : 1361113611136111361113611
Total : 2364672523646725236467252364672523646725236467252364672523646725
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com