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


Java ImageComponent2D.FORMAT_RGB属性代码示例

本文整理汇总了Java中javax.media.j3d.ImageComponent2D.FORMAT_RGB属性的典型用法代码示例。如果您正苦于以下问题:Java ImageComponent2D.FORMAT_RGB属性的具体用法?Java ImageComponent2D.FORMAT_RGB怎么用?Java ImageComponent2D.FORMAT_RGB使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.media.j3d.ImageComponent2D的用法示例。


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

示例1: getOffScreenCanvas3D

/**
 * Returns a new off screen <code>canva3D</code> at the given size. 
 * @throws IllegalRenderingStateException  if the canvas 3D couldn't be created.
 *    To avoid this exception, call {@link #isOffScreenImageSupported() isOffScreenImageSupported()} first.
 */
public Canvas3D getOffScreenCanvas3D(int width, int height)
{
	Canvas3D offScreenCanvas = getCanvas3D(null, true, null);
	// Configure canvas 3D for offscreen
	Screen3D screen3D = offScreenCanvas.getScreen3D();
	screen3D.setSize(width, height);
	screen3D.setPhysicalScreenWidth(2f);
	screen3D.setPhysicalScreenHeight(2f / width * height);
	BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
	ImageComponent2D imageComponent2D = new ImageComponent2D(ImageComponent2D.FORMAT_RGB, image);
	imageComponent2D.setCapability(ImageComponent2D.ALLOW_IMAGE_READ);
	offScreenCanvas.setOffScreenBuffer(imageComponent2D);
	return offScreenCanvas;
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:19,代码来源:Component3DManager.java

示例2: J3dNyARRaster_RGB

public J3dNyARRaster_RGB(NyARParam i_cparam,VideoFormat i_format) throws NyARRuntimeException
{
	super(i_format);
	//bufferdimageの種類を決める
	if(this.getBufferType()!=NyARBufferType.BYTE1D_B8G8R8_24){
		throw new NyARRuntimeException();
	}
	//RGBのラスタを作る。
	this.bufferd_image = new BufferedImage(this._size.w, this._size.h, BufferedImage.TYPE_3BYTE_BGR);
	i2d_buf = ((DataBufferByte) bufferd_image.getRaster().getDataBuffer()).getData();
	this.imc2d = new ImageComponent2D(ImageComponent2D.FORMAT_RGB, this.bufferd_image, true, true);
	imc2d.setCapability(ImageComponent.ALLOW_IMAGE_WRITE);
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:13,代码来源:J3dNyARRaster_RGB.java

示例3: initTexture

private void initTexture()
{
    //Debug.trace();
    textureImage =
        new BufferedImage(textureWidth,
                          textureHeight,
                          BufferedImage.TYPE_INT_RGB);

    textureImageComponent =
        new ImageComponent2D(ImageComponent2D.FORMAT_RGB,
                             textureImage);
    textureImageComponent.setCapability(ImageComponent2D.ALLOW_IMAGE_WRITE);

    textureImpl = new Texture2D(Texture2D.BASE_LEVEL,
                                Texture2D.RGB,
                                textureWidth,
                                textureHeight);
    textureImpl.setImage(0, textureImageComponent);

    // Handle repeatS and repeatT fields
    textureImpl.setBoundaryModeS(vfRepeatS ? Texture2D.WRAP : Texture2D.CLAMP);
    textureImpl.setBoundaryModeT(vfRepeatT ? Texture2D.WRAP : Texture2D.CLAMP);

    textureArray = new Texture[] { textureImpl };
    textureAlphaArray = new boolean[] { false };
    TextureAttributes attr = new TextureAttributes();
    textureAttributeArray = new TextureAttributes[] { attr };
    firstFrame = true;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:29,代码来源:J3DMovieTexture.java

示例4: createSceneGraph

public BranchGroup createSceneGraph(boolean wireFrame) {

        int VOV_L = 42; // dimensions of volume of voxels 50
        int VOV_W = 42;
        int VOV_H = 42;

        BranchGroup contentRoot = new BranchGroup();
        ColorUtil.addCoordinateSphereAxesToSceneGraph(contentRoot, 0.01f);

        VolumeOfVoxels vv = new VolumeOfVoxels(VOV_L, VOV_W, VOV_H);
        vv.fillVolumeOfSphere(true);

        /* Simple visualization by triangles */

        Vector<Triangle> triangleVector = new Vector<Triangle>();
        Util.triangulation(vv.getVoxelsValueAsFloatArray(), VOV_L, VOV_W, VOV_H, triangleVector);
        Triangle3dCreator triangleCreator = new Triangle3dCreator(ColorUtil.grey);

        for (Triangle t : triangleVector) {
            triangleCreator.addTriangleToContainer(
                    t.getP1AsScaledPoint3f(1.0f / VOV_L, 1.0f / VOV_W, 1.0f / VOV_H),
                    t.getP2AsScaledPoint3f(1.0f / VOV_L, 1.0f / VOV_W, 1.0f / VOV_H),
                    t.getP3AsScaledPoint3f(1.0f / VOV_L, 1.0f / VOV_W, 1.0f / VOV_H));
            //t.printData();
        }
        contentRoot.addChild(triangleCreator.getTriangleContainer());


        /* Simple visualization by boxes */
        Material mat = new Material();
        mat.setEmissiveColor(ColorUtil.red);
        Cube3dCreator cubeCreator = new Cube3dCreator(0.05f, 0.05f, 0.05f, mat, 0.0f);
        // vv.addAllTagedVoxelsToContainer(cubeCreator);
        contentRoot.addChild(cubeCreator.getCubeContainer());

        /* For cube testing */
        contentRoot.addChild(cubeCreator.getCubeAsShapeOfQuadArrays(0.1f, 0.1f, 0.1f));
        contentRoot.addChild(cubeCreator.getCubeAsBox(0.15f, 0.15f, 0.15f));

        Background background = new Background(new ImageComponent2D(ImageComponent2D.FORMAT_RGB,
                ColorUtil.createColoredGradientImage(FrameWidth, FrameHeight)));
        background.setApplicationBounds(new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0));
        contentRoot.addChild(background);

        contentRoot.compile();
        return contentRoot;
    }
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:47,代码来源:MainApp.java

示例5: renewImageComponent2D

/**
 * 自身の格納しているImageComponent2Dオブジェクトを作り直します。
 * Java3D1.5がDirectXで動いた(らしいとき)に、ImageComponent2Dのインスタンス
 * IDが異ならないと、Behavior内でイメージの更新を通知できない事象に対応するために実装してあります。
 * Behavior内でgetImageComponent2()関数を実行する直前に呼び出すことで、この事象を回避することができます。
 * 
 */
public void renewImageComponent2D()
{
	this.imc2d = new ImageComponent2D(ImageComponent2D.FORMAT_RGB, this.bufferd_image, true, true);
	this.imc2d.setCapability(ImageComponent.ALLOW_IMAGE_WRITE);
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:12,代码来源:J3dNyARRaster_RGB.java


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