Package com.ardor3d.image

Examples of com.ardor3d.image.Image


        slimeColors[0] = new ColorRGBA(160 / 255f, 64 / 255f, 42 / 255f, 1);
        slimeColors[127] = new ColorRGBA(64 / 255f, 192 / 255f, 64 / 255f, 1);
        slimeColors[255] = new ColorRGBA(128 / 255f, 255 / 255f, 128 / 255f, 1);
        GeneratedImageFactory.fillInColorTable(slimeColors);

        Image img = GeneratedImageFactory.createLuminance8Image(finalSlime, wside, hside, 1);
        img = GeneratedImageFactory.createColorImageFromLuminance8(img, false, slimeColors);
        tex.setImage(img);
        tex.setTextureKey(TextureKey.getRTTKey(MinificationFilter.Trilinear));
        tex.setMagnificationFilter(MagnificationFilter.Bilinear);
        tex.setMinificationFilter(MinificationFilter.Trilinear);
View Full Code Here


                renderer.updateTexture2DSubImage((Texture2D) prevTexture, 100, 50, 100, 100, imageBuffer, 100, 50, img
                        .getWidth());
                break;
            }
            case 2: {
                final Image nextImage = AWTImageLoader.makeArdor3dImage(img, false);
                final Texture nextTexture = TextureManager.loadFromImage(nextImage,
                        Texture.MinificationFilter.Trilinear);
                final TextureState ts = (TextureState) _root.getLocalRenderState(RenderState.StateType.Texture);
                ts.setTexture(nextTexture);
                break;
View Full Code Here

            terrainCamera = new Camera(camera);

            // IMAGE LOADING AND CONVERSION TO HEIGHTMAP DONE HERE
            final BufferedImage heightmap = ImageIO.read(ResourceLocatorTool.getClassPathResource(
                    MountainShadowTerrainExample.class, "com/ardor3d/example/media/images/heightmap.jpg"));
            final Image ardorImage = AWTImageLoader.makeArdor3dImage(heightmap, false);
            final float[] heightMap = ImageHeightMap.generateHeightMap(ardorImage, 0.05f, .33f);
            // END OF IMAGE CONVERSION

            final int SIZE = ardorImage.getWidth();

            final ArrayTerrainDataProvider terrainDataProvider = new ArrayTerrainDataProvider(heightMap, SIZE,
                    new Vector3(5, 2048, 5), true);
            terrainDataProvider.setHeightMax(0.34f);
View Full Code Here

        final ByteBuffer scratch = createOnHeap ? BufferUtils.createByteBufferOnHeap(data.length) : BufferUtils
                .createByteBuffer(data.length);
        scratch.clear();
        scratch.put(data);
        scratch.flip();
        final Image ardorImage = new Image();
        ardorImage.setDataFormat(grayscale ? ImageDataFormat.Luminance : hasAlpha ? ImageDataFormat.RGBA
                : ImageDataFormat.RGB);
        ardorImage.setDataType(PixelDataType.UnsignedByte);
        ardorImage.setWidth(tex.getWidth());
        ardorImage.setHeight(tex.getHeight());
        ardorImage.setData(scratch);
        return ardorImage;
    }
View Full Code Here

        final ByteBuffer scratch = createOnHeap ? BufferUtils.createByteBufferOnHeap(data.length) : BufferUtils
                .createByteBuffer(data.length);
        scratch.clear();
        scratch.put(data);
        scratch.flip();
        final Image ardorImage = new Image();
        ardorImage.setDataFormat(grayscale ? ImageDataFormat.Luminance : hasAlpha ? ImageDataFormat.RGBA
                : ImageDataFormat.RGB);
        ardorImage.setDataType(PixelDataType.UnsignedByte);
        ardorImage.setWidth(image.getWidth());
        ardorImage.setHeight(image.getHeight());
        ardorImage.setData(scratch);
        return ardorImage;
    }
View Full Code Here

     *            the specific format to use when storing this texture on the card.
     * @return our new Texture.
     */
    public static final Texture loadTexture(final BufferedImage image, final Texture.MinificationFilter minFilter,
            final TextureStoreFormat storeFormat, final boolean flipVertically) {
        final Image imageData = AWTImageLoader.makeArdor3dImage(image, flipVertically);
        final String fileType = (image != null) ? "" + image.hashCode() : null;
        final TextureKey tkey = TextureKey.getKey(null, flipVertically, storeFormat, fileType, minFilter);
        return TextureManager.loadFromKey(tkey, imageData, null);
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.image.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.