小球碰撞-粘球问题

所属分类:其他
开发工具:C/C++
文件大小:7060KB
下载次数:3
上传日期:2018-04-06 20:32:31
上 传 者牛2
说明:  小球碰撞问题,MFC 模拟,十分有参考意义
(Small ball collision problem, MFC simulation)

文件列表:
小球碰撞-粘球问题\Ball.cpp (3885, 2007-05-07)
小球碰撞-粘球问题\Ball.h (815, 2007-05-07)
小球碰撞-粘球问题\Balls.aps (29488, 2010-07-04)
小球碰撞-粘球问题\Balls.clw (2925, 2010-07-04)
小球碰撞-粘球问题\Balls.cpp (4191, 2004-12-13)
小球碰撞-粘球问题\Balls.dsp (4784, 2004-12-13)
小球碰撞-粘球问题\Balls.dsw (348, 2018-04-05)
小球碰撞-粘球问题\Balls.h (1345, 2004-12-13)
小球碰撞-粘球问题\Balls.ncb (33792, 2018-04-05)
小球碰撞-粘球问题\Balls.opt (37888, 2018-04-05)
小球碰撞-粘球问题\Balls.plg (2117, 2010-07-04)
小球碰撞-粘球问题\Balls.rc (12449, 2004-12-13)
小球碰撞-粘球问题\BallsDoc.cpp (1736, 2004-12-13)
小球碰撞-粘球问题\BallsDoc.h (1515, 2004-12-14)
小球碰撞-粘球问题\BallsView.cpp (3292, 2007-05-07)
小球碰撞-粘球问题\BallsView.h (1822, 2004-12-13)
小球碰撞-粘球问题\Debug\ball.obj (19096, 2010-07-04)
小球碰撞-粘球问题\Debug\Balls.exe (127047, 2010-07-04)
小球碰撞-粘球问题\Debug\Balls.ilk (372164, 2010-07-04)
小球碰撞-粘球问题\Debug\Balls.obj (22912, 2010-07-04)
小球碰撞-粘球问题\Debug\Balls.pch (5492816, 2010-07-04)
小球碰撞-粘球问题\Debug\Balls.pdb (369664, 2010-07-04)
小球碰撞-粘球问题\Debug\Balls.res (7676, 2010-07-04)
小球碰撞-粘球问题\Debug\BallsDoc.obj (16458, 2010-07-04)
小球碰撞-粘球问题\Debug\BallsView.obj (22095, 2010-07-04)
小球碰撞-粘球问题\Debug\MainFrm.obj (21958, 2010-07-04)
小球碰撞-粘球问题\Debug\ShootView.obj (17741, 2010-07-04)
小球碰撞-粘球问题\Debug\StdAfx.obj (105633, 2010-07-04)
小球碰撞-粘球问题\Debug\vc60.idb (205824, 2012-08-29)
小球碰撞-粘球问题\Debug\vc60.pdb (364544, 2010-07-04)
小球碰撞-粘球问题\MainFrm.cpp (3015, 2004-12-13)
小球碰撞-粘球问题\MainFrm.h (1711, 2004-12-13)
小球碰撞-粘球问题\res\Balls.ico (1078, 2004-12-13)
小球碰撞-粘球问题\res\Balls.rc2 (397, 2004-12-13)
小球碰撞-粘球问题\res\BallsDoc.ico (1078, 2004-12-13)
小球碰撞-粘球问题\res\Toolbar.bmp (1078, 2004-12-13)
小球碰撞-粘球问题\Resource.h (912, 2004-12-13)
小球碰撞-粘球问题\ShootView.cpp (1963, 2005-01-08)
小球碰撞-粘球问题\ShootView.h (1575, 2004-12-14)
... ...

/* * GrayReduce.java * * Created on September 2, 2006, 3:59 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jjil.algorithm; import jjil.core.*; /** * Pipeline stage reduces an image's size by rectangular averaging. The * reduction factor has to evenly divide the image size. There is no * smoothing or proper resampling done. *

* Hungarian prefix is 'red'. * * @author webb */ public class GrayReduce extends PipelineStage { private int cReduceHeight; private int cReduceWidth; /** Creates a new instance of GrayReduce. * * @param cReduceWidth amount to reduce the width by * @param cReduceHeight amount to reduce the height by */ public GrayReduce(int cReduceWidth, int cReduceHeight) { setReductionFactor(cReduceWidth, cReduceHeight); } /** Reduces a gray image by a factor horizontally and vertically through * averaging. The reduction factor must be an even multiple of the image * size. * * @param image the input image. * @throws IllegalArgumentException if the input image is not gray, or * the reduction factor does not evenly divide the image size. */ public void Push(Image image) throws IllegalArgumentException { if (!(image instanceof Gray8Image)) { throw new IllegalArgumentException(image.toString() + " should be a Gray8Image, but isn't"); } if (image.getWidth() % this.cReduceWidth != 0) { throw new IllegalArgumentException(image.toString() + " width should be divisible by " + this.cReduceWidth); } if (image.getHeight() % this.cReduceHeight != 0) { throw new IllegalArgumentException(image.toString() + " height should be divisible by " + this.cReduceHeight); } Gray8Image gray = (Gray8Image) image; byte[] bIn = gray.getData(); int cReducedHeight = image.getHeight() / this.cReduceHeight; int cReducedWidth = image.getWidth() / this.cReduceWidth; Gray8Image result = new Gray8Image(cReducedWidth, cReducedHeight); byte[] bOut = result.getData(); for (int i=0; i


近期下载者

相关文件


收藏者