Examples of ReadOnlyColorRGBA


Examples of com.ardor3d.math.type.ReadOnlyColorRGBA

    public static void applyBorderColor(final Texture texture, final TextureRecord texRecord, final int unit,
            final TextureStateRecord record, final ContextCapabilities caps) {
        final GL gl = GLContext.getCurrentGL();

        final ReadOnlyColorRGBA texBorder = texture.getBorderColor();
        if (!texRecord.isValid() || !texRecord.borderColor.equals(texBorder)) {
            TextureRecord.colorBuffer.clear();
            TextureRecord.colorBuffer.put(texBorder.getRed()).put(texBorder.getGreen()).put(texBorder.getBlue())
                    .put(texBorder.getAlpha());
            TextureRecord.colorBuffer.rewind();
            gl.glTexParameterfv(getGLType(texture.getType()), GL2GL3.GL_TEXTURE_BORDER_COLOR, TextureRecord.colorBuffer);
            texRecord.borderColor.set(texBorder);
        }
    }
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyColorRGBA

     * @return a 1D image, width == colors.length
     */
    public static Image create1DColorImage(final boolean useAlpha, final ReadOnlyColorRGBA... colors) {
        final ByteBuffer data = BufferUtils.createByteBuffer(colors.length * (useAlpha ? 4 : 3));
        for (int i = 0; i < colors.length; i++) {
            final ReadOnlyColorRGBA color = colors[i];
            data.put((byte) (color.getRed() * 255));
            data.put((byte) (color.getGreen() * 255));
            data.put((byte) (color.getBlue() * 255));

            if (useAlpha) {
                data.put((byte) (color.getAlpha() * 255));
            }
        }
        data.rewind();
        final ImageDataFormat fmt = (useAlpha) ? ImageDataFormat.RGBA : ImageDataFormat.RGB;
        return new Image(fmt, PixelDataType.UnsignedByte, colors.length, 1, data, null);
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyColorRGBA

    public static Image createColorImageFromLuminance8(final Image lumImage, final boolean useAlpha,
            final ReadOnlyColorRGBA... colorTable) {
        assert (colorTable.length == 256) : "color table must be size 256.";

        final List<ByteBuffer> dataList = new ArrayList<ByteBuffer>(lumImage.getDepth());
        ReadOnlyColorRGBA c;
        for (int i = 0; i < lumImage.getDepth(); i++) {
            final ByteBuffer src = lumImage.getData(i);
            final int size = src.capacity();
            final ByteBuffer out = BufferUtils.createByteBuffer(size * (useAlpha ? 4 : 3));
            final byte[] data = new byte[out.capacity()];
            int j = 0;
            for (int x = 0; x < size; x++) {
                c = colorTable[src.get(x) & 0xFF];
                data[j++] = (byte) (c.getRed() * 255);
                data[j++] = (byte) (c.getGreen() * 255);
                data[j++] = (byte) (c.getBlue() * 255);
                if (useAlpha) {
                    data[j++] = (byte) (c.getAlpha() * 255);
                }
            }
            out.put(data);
            out.rewind();
            dataList.add(out);
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyColorRGBA

     * @return the foreground color associated with this component. If none has been set, we will ask our parent
     *         component and so on. If no component is found in our ancestry with a foreground color, we will use
     *         {@link #DEFAULT_FOREGROUND_COLOR}
     */
    public ReadOnlyColorRGBA getForegroundColor() {
        ReadOnlyColorRGBA foreColor = _foregroundColor;
        if (foreColor == null) {
            if (getParent() != null && getParent() instanceof UIComponent) {
                foreColor = ((UIComponent) getParent()).getForegroundColor();
            } else {
                foreColor = UIComponent.DEFAULT_FOREGROUND_COLOR;
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyColorRGBA

                record.fogEnd = state.getEnd();
                gl.getGL2ES1().glFogf(GL2ES1.GL_FOG_DENSITY, state.getDensity());
                record.density = state.getDensity();
            }

            final ReadOnlyColorRGBA fogColor = state.getColor();
            applyFogColor(fogColor, record);
            applyFogMode(state.getDensityFunction(), record);
            applyFogHint(state.getQuality(), record);
            applyFogSource(state.getSource(), record, caps);
        } else {
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyColorRGBA

            final boolean applyConstant = state.getDestinationFunctionRGB().usesConstantColor()
                    || state.getSourceFunctionRGB().usesConstantColor()
                    || (caps.isConstantBlendColorSupported() && (state.getDestinationFunctionAlpha()
                            .usesConstantColor() || state.getSourceFunctionAlpha().usesConstantColor()));
            if (applyConstant && caps.isConstantBlendColorSupported()) {
                final ReadOnlyColorRGBA constant = state.getConstantColor();
                if (!record.isValid() || (caps.isConstantBlendColorSupported() && !record.blendColor.equals(constant))) {
                    if (gl.isGL2ES2()) {
                        gl.getGL2ES2().glBlendColor(constant.getRed(), constant.getGreen(), constant.getBlue(),
                                constant.getAlpha());
                    }
                    record.blendColor.set(constant);
                }
            }
        }
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyColorRGBA

        final WrapMode mode = parameterObject.getTexture().getWrap(WrapAxis.S);
        switch (mode) {
            case BorderClamp:
            case MirrorBorderClamp:
                final ReadOnlyColorRGBA col = parameterObject.getTexture().getBorderColor();
                borderClamp(data, rectangle, textureWidth, textureHeight, parameterObject, col);
                break;

            case Clamp:
            case MirrorClamp:
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyColorRGBA

        });

        final FloatBuffer color1 = torus.getMeshData().getColorBuffer();
        color1.clear();
        for (int i = 0, bLength = color1.capacity(); i < bLength; i += 4) {
            final ReadOnlyColorRGBA c = colorSpread[i % 3];
            color1.put(c.getRed()).put(c.getGreen()).put(c.getBlue()).put(c.getAlpha());
        }
        color1.flip();
        final FloatBuffer color2 = sphere.getMeshData().getColorBuffer();
        color2.clear();
        for (int i = 0, bLength = color2.capacity(); i < bLength; i += 4) {
            final ReadOnlyColorRGBA c = colorSpread[i % 3];
            color2.put(c.getRed()).put(c.getGreen()).put(c.getBlue()).put(c.getAlpha());
        }
        color2.flip();

        sphereNode.attachChild(torus);
        torusNode.attachChild(sphere);
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyColorRGBA

        }

        // color
        {
            final float lifeCRatio = (float) ((age - prevCAge) / (nextCAge - prevCAge));
            final ReadOnlyColorRGBA start = prevCEntry != null ? prevCEntry.getColor() : particles.getStartColor();
            final ReadOnlyColorRGBA end = nextCEntry != null ? nextCEntry.getColor() : particles.getEndColor();
            ColorRGBA.lerp(start, end, lifeCRatio, store);
        }

        // mass
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.