• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PerspectiveTransform类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TileInstructions

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public TileInstructions(int x, int y, int w, int h, Object rh,
		int[] otherPixels, PerspectiveTransform pt,boolean oHasAlpha,int oWidth,
		int oHeight,int oStride,HorizontalStripFunction stripFunction) {
	this.tileX = x;
	this.tileY = y;
	this.tileWidth = w;
	this.tileHeight = h;
	this.renderingHint = rh;
	this.otherPixels = otherPixels;
	this.transform = pt;
	this.oHasAlpha = oHasAlpha;
	this.oWidth = oWidth;
	this.oHeight = oHeight;
	this.oStride=  oStride;
	this.stripFunction = stripFunction.derive(tileX, tileX+tileWidth);
}
 
开发者ID:mickleness,项目名称:pumpernickel,代码行数:17,代码来源:BasicImageContext.java


示例2: transform

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
/** Transforms a point x,y and computes [x/width,y/width,width] coordinates.
 * @param pt
 * @param x
 * @param y
 * @param ptDst
 * @return  */
private static float[] transform(PerspectiveTransform pt, float x, float y, float[] ptDst) {
    double[][] m;
    try {
        m = pt.createInverse().getMatrix(new double[3][3]);
    } catch (Exception ex) {
    	/**
    	 * This could throw NoninvertibleTransformException, or one compiler
    	 * strangely pointed out a possible CloneNotSupportedException
    	 */
        InternalError newE = new InternalError();
        newE.initCause(ex);
        throw newE;
    }

    double w = (m[2][0] * x + m[2][1] * y + m[2][2]);
    double wInv = 1.0 / w;
    ptDst[0] = (float) ((m[0][0] * x + m[0][1] * y + m[0][2]) * wInv);
    ptDst[1] = (float) ((m[1][0] * x + m[1][1] * y + m[1][2]) * wInv);
    ptDst[2] = (float) w;
    return ptDst;
}
 
开发者ID:mickleness,项目名称:pumpernickel,代码行数:28,代码来源:SCImageContext.java


示例3: TileInstructions

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public TileInstructions(int id, int x, int y, int w, int h, Object rh,
		int[] otherPixels, PerspectiveTransform pt,boolean oHasAlpha,int oWidth,
		int oHeight,int oStride,HorizontalStripFunction stripFunction) {
	this.id = id;
	this.tileX = x;
	this.tileY = y;
	this.tileWidth = w;
	this.tileHeight = h;
	this.renderingHint = rh;
	this.otherPixels = otherPixels;
	this.transform = pt;
	this.oHasAlpha = oHasAlpha;
	this.oWidth = oWidth;
	this.oHeight = oHeight;
	this.oStride=  oStride;
	this.stripFunction = stripFunction.derive(tileX, tileX+tileWidth);
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:18,代码来源:BasicImageContext.java


示例4: calculateTransformation

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
private void calculateTransformation() {		
	transformer.clear();
	for (String address : finals.keySet()) {
		Double[] d = finals.get(address);
		transformer.put(address, PerspectiveTransform.getQuadToQuad(d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]));
	}
}
 
开发者ID:operadordecamara,项目名称:wiimote-paintboard,代码行数:8,代码来源:WiimoteCalibration.java


示例5: warp

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public IRDot warp(int i, Wiimote wiimote, Map<Wiimote, IRDot[]> data) {
	final PerspectiveTransform transform = transformer.get(wiimote.getAddress());
	if (transform == null || data.get(wiimote)[i] == null) return null;
	else {
		return (IRDot) transform.transform(data.get(wiimote)[i], new IRDot(data.get(wiimote)[i]));
	}
}
 
开发者ID:operadordecamara,项目名称:wiimote-paintboard,代码行数:8,代码来源:WiimoteCalibration.java


示例6: build

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public static WarpPerspective build(double nwx, double nwy, double nex, double ney, double sex, double sey, double swx, double swy, double w, double h) {
  // CHECKSTYLE:ON

  PerspectiveTransform transform = PerspectiveTransform.getQuadToQuad(nwx, nwy, nex, ney, sex, sey, swx, swy, 0, h, w, h, w, 0, 0, 0);
  WarpPerspective wp = new WarpPerspective(transform);

  return wp;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:9,代码来源:ServerWarpUtility.java


示例7: readMatrix

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
protected synchronized static final PerspectiveTransform readMatrix(InputStream in) throws IOException {
	matrix[0][0] = read16_16Float(in);
	matrix[0][1] = read16_16Float(in);
	matrix[0][2] = read2_30Float(in);
	matrix[1][0] = read16_16Float(in);
	matrix[1][1] = read16_16Float(in);
	matrix[1][2] = read2_30Float(in);
	matrix[2][0] = read16_16Float(in);
	matrix[2][1] = read16_16Float(in);
	matrix[2][2] = read2_30Float(in);
	
	return new PerspectiveTransform(matrix);
}
 
开发者ID:mickleness,项目名称:pumpernickel,代码行数:14,代码来源:Atom.java


示例8: writeMatrix

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
protected synchronized static final void writeMatrix(OutputStream out,PerspectiveTransform transform) throws IOException {
	transform.getMatrix(matrix);
	write16_16Float(out,(float)matrix[0][0]);
	write16_16Float(out,(float)matrix[0][1]);
	write2_30Float(out,(float)matrix[0][2]);
	write16_16Float(out,(float)matrix[1][0]);
	write16_16Float(out,(float)matrix[1][1]);
	write2_30Float(out,(float)matrix[1][2]);
	write16_16Float(out,(float)matrix[2][0]);
	write16_16Float(out,(float)matrix[2][1]);
	write2_30Float(out,(float)matrix[2][2]);
}
 
开发者ID:mickleness,项目名称:pumpernickel,代码行数:13,代码来源:Atom.java


示例9: MovieHeaderAtom

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public MovieHeaderAtom(long timeScale,long duration) {
	super(null);
	creationTime = new Date();
	modificationTime = creationTime;
	this.duration = duration;
	this.timeScale = timeScale;
	matrix = new PerspectiveTransform();
}
 
开发者ID:mickleness,项目名称:pumpernickel,代码行数:9,代码来源:MovieHeaderAtom.java


示例10: TrackHeaderAtom

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public TrackHeaderAtom(long trackID,long duration,float width,float height) {
	super(null);
	this.trackID = trackID;
	this.duration = duration;
	creationTime = new Date();
	modificationTime = creationTime;
	matrix = new PerspectiveTransform();
	this.width = width;
	this.height = height;
}
 
开发者ID:mickleness,项目名称:pumpernickel,代码行数:11,代码来源:TrackHeaderAtom.java


示例11: calculateMesh

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public void calculateMesh() {

		// Calculate 4 point warping from source and destination quads
		PerspectiveTransform transform = PerspectiveTransform.getQuadToQuad(
				points[TL].u,points[TL].v, // source to
				points[TR].u, points[TR].v, 
				points[DR].u, points[DR].v, 
				points[DL].u, points[DL].v, 
				points[TL].x, points[TL].y, 
				points[TR].x, points[TR].y, 
				points[DR].x, points[DR].y,
				points[DL].x, points[DL].y); // dest
		warpPerspective = new WarpPerspective(transform);
		
	}
 
开发者ID:demodrama,项目名称:p5cv,代码行数:16,代码来源:QuadWarper.java


示例12: getTransformer

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public Map<String, PerspectiveTransform> getTransformer() {
	return transformer;
}
 
开发者ID:operadordecamara,项目名称:wiimote-paintboard,代码行数:4,代码来源:WiimoteCalibration.java


示例13: ScreenSelector

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public ScreenSelector(WiimoteCalibration calibration, WiimoteDataHandler dh) {
		super(null);
		this.calibration = calibration;
//		this.dh = dh;
		dh.addWiimoteDataListener(this);
		
		final GraphicsDevice[] screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
		
		// calculate maximum screen bounds (virtual device)
		Rectangle r = new Rectangle();
		for (GraphicsDevice s : screens) {
			r = r.union(s.getDefaultConfiguration().getBounds());
		}
		
		final int maxH = MAX_H - (screens.length == 1 ? 30 : 0);
		// proportional bounds of panel
		int w = MAX_W;
		int h = (int) Math.round((w * r.getHeight()) / r.getWidth());
		// if too high
		if (h > maxH) {
			h = maxH;
			w = (int) Math.round((h * r.getWidth()) / r.getHeight());
		}
		setPreferredSize(new Dimension(w, h));
		
		// map screen bounds to panel bounds
		PerspectiveTransform t = PerspectiveTransform.getQuadToQuad(
				r.getMinX(), r.getMinY(), r.getMaxX(), r.getMinY(),
				r.getMaxX(), r.getMaxY(), r.getMinX(), r.getMaxY(),
				0, 0, w, 0, w, h, 0, h);
		
		// TODO temporary until multiple screens are allowed
		ButtonGroup bg = new ButtonGroup();
		for (int i = 0; i < screens.length; i++) {
			Rectangle b = screens[i].getDefaultConfiguration().getBounds();
			final ScreenBox sb = new ScreenBox(screens[i], i, transformBounds(t, b), screens[i].equals(DEFAULT_SCREEN));
			bg.add(sb);
			screenBoxes.add(sb);
			add(sb);
		}
		
		new Timer(true).schedule(new UpdateTask(), 0, REPAINT_FREQ);
	}
 
开发者ID:operadordecamara,项目名称:wiimote-paintboard,代码行数:44,代码来源:ScreenSelector.java


示例14: transformBounds

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
private Rectangle transformBounds(PerspectiveTransform t, Rectangle b) {
	Point2D ul = t.transform(new Point2D.Double(b.getMinX(), b.getMinY()), null);
	Point2D ur = t.transform(new Point2D.Double(b.getMaxX(), b.getMinY()), null);
	Point2D ll = t.transform(new Point2D.Double(b.getMinX(), b.getMaxY()), null);		
	return new Rectangle2D.Double(ul.getX(), ul.getY(), ul.distance(ur), ul.distance(ll)).getBounds();
}
 
开发者ID:operadordecamara,项目名称:wiimote-paintboard,代码行数:7,代码来源:ScreenSelector.java


示例15: PerspectivePathWriter

import javax.media.jai.PerspectiveTransform; //导入依赖的package包/类
public PerspectivePathWriter(GeneralPath dest, PerspectiveTransform tx) {
	this(new GeneralPathWriter(dest), tx);
}
 
开发者ID:mickleness,项目名称:pumpernickel,代码行数:4,代码来源:PerspectivePathWriter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ToolManager类代码示例发布时间:2022-05-22
下一篇:
Java MetricsDropwizardAutoConfiguration类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap