flagflag  

different_proc anchor.png

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   Freeze Diff Backup Copy Rename Reload   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)
Counter: 1282, today: 1, yesterday: 0
Last-modified: 2011-07-30 (Sat) 23:16:57 (JST) (4664d) by iseki

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

80 user(s) are online (9 user(s) are browsing xpwiki)

Members: 0
Guests: 80

more...

Access Counter

Today : 9407940794079407
Yesterday : 1631416314163141631416314
Total : 2352218223522182235221822352218223522182235221822352218223522182
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com