当前位置: 首页>>代码示例>>Java>>正文


Java IrCameraEvent类代码示例

本文整理汇总了Java中motej.event.IrCameraEvent的典型用法代码示例。如果您正苦于以下问题:Java IrCameraEvent类的具体用法?Java IrCameraEvent怎么用?Java IrCameraEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IrCameraEvent类属于motej.event包,在下文中一共展示了IrCameraEvent类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import motej.event.IrCameraEvent; //导入依赖的package包/类
public static void main(String[] args) throws InterruptedException {
	IrCameraListener listener = new IrCameraListener() {
	
		public void irImageChanged(IrCameraEvent evt) {
			System.out.println(evt.getIrPoint(0).getX() + " : " + evt.getIrPoint(0).getY());
		}
	
	};
	
	SimpleMoteFinder simpleMoteFinder = new SimpleMoteFinder();
	Mote mote = simpleMoteFinder.findMote();
	mote.addIrCameraListener(listener);
	mote.enableIrCamera();
	mote.setReportMode(ReportModeRequest.DATA_REPORT_0x36);
	
	Thread.sleep(60000l);
	
	mote.setReportMode(ReportModeRequest.DATA_REPORT_0x30);
	mote.disableIrCamera();
	mote.disconnect();
}
 
开发者ID:fustinoni-net,项目名称:PiRobotPlatform,代码行数:22,代码来源:IrCameraDemo.java

示例2: irImageChanged

import motej.event.IrCameraEvent; //导入依赖的package包/类
@Override
public void irImageChanged(IrCameraEvent event) {
	synchronized (this) {
		mousePosX = 0;
		mousePosY = 0;
		int size = 0;
		for (int i = 0; i < 4; i++) {
			if (event.getIrPoint(i).x != 1023 && event.getIrPoint(i).y != 1023) {
				mousePosX += event.getIrPoint(i).x;
				mousePosY += event.getIrPoint(i).y;
				size++;
			}
		}
		if (size != 0) {
			mousePosX /= size;
			mousePosY /= size;
		}
	}
}
 
开发者ID:freundTech,项目名称:motecraft,代码行数:20,代码来源:WiiMoteListener.java

示例3: irImageChanged

import motej.event.IrCameraEvent; //导入依赖的package包/类
public void irImageChanged(IrCameraEvent evt) {
	if (lastEvent != null) {
		for (int i = 0; i < 4; i++) {
			if (!evt.getIrPoint(i).equals(lastEvent.getIrPoint(i))) {
				IrPoint currentPoint = evt.getIrPoint(i);
				IrPoint lastPoint = lastEvent.getIrPoint(i);

				if (isValid(currentPoint) && !isValid(lastPoint)) {
					pointAppeared(i, currentPoint);
				} else if (!isValid(currentPoint) && isValid(lastPoint)) {
					pointDisappeared(i, lastPoint);
				} else {
					pointChanged(i, currentPoint);
				}
			}
		}
	}

	lastEvent = evt;
}
 
开发者ID:iSchluff,项目名称:Wii-Gesture,代码行数:21,代码来源:StatefulIrCameraAdapter.java

示例4: fireIrCameraEvent

import motej.event.IrCameraEvent; //导入依赖的package包/类
protected void fireIrCameraEvent(IrCameraMode mode, IrPoint p0, IrPoint p1, IrPoint p2, IrPoint p3) {
    IrCameraListener[] listeners = listenerList.getListeners(IrCameraListener.class);
    IrCameraEvent evt = new IrCameraEvent(this, mode, p0, p1, p2, p3);
    for (IrCameraListener l : listeners) {
        l.irImageChanged(evt);
    }
}
 
开发者ID:iSchluff,项目名称:Wii-Gesture,代码行数:8,代码来源:Mote.java


注:本文中的motej.event.IrCameraEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。