Examples of glReadPixels()


Examples of javax.media.opengl.GL.glReadPixels()

        final GL gl = GLContext.getCurrentGL();

        final int pixFormat = JoglTextureUtil.getGLPixelFormat(format);
        final int pixDataType = JoglTextureUtil.getGLPixelDataType(type);
        // N.B: it expects depth = 1 & pack = true
        gl.glReadPixels(x, y, w, h, pixFormat, pixDataType, store);
    }

    @Override
    public int getExpectedBufferSizeToGrabScreenContents(final ImageDataFormat format, final PixelDataType type,
            final int w, final int h) {
View Full Code Here

Examples of javax.media.opengl.GL2.glReadPixels()

                case ImageComponentRetained.TYPE_INT_ARGB:
                default:
                    throw new AssertionError("illegal format " + format);
            }

            gl.glReadPixels(0, 0, width, height, type, GL.GL_UNSIGNED_BYTE, ByteBuffer.wrap((byte[]) data));

        }
        else if ((dataType == ImageComponentRetained.IMAGE_DATA_TYPE_INT_ARRAY) ||
                (dataType == ImageComponentRetained.IMAGE_DATA_TYPE_INT_BUFFER)) {
View Full Code Here

Examples of javax.media.opengl.GL2.glReadPixels()

            if(forceAlphaToOne) {
                gl.glPixelTransferf(GL2.GL_ALPHA_SCALE, 0.0f);
                gl.glPixelTransferf(GL2.GL_ALPHA_BIAS, 1.0f);
            }

            gl.glReadPixels(0, 0, width, height, type, intType, IntBuffer.wrap((int[]) data));

      /* Restore Alpha scale and bias */
      if(forceAlphaToOne) {
    gl.glPixelTransferf(GL2.GL_ALPHA_SCALE, 1.0f);
    gl.glPixelTransferf(GL2.GL_ALPHA_BIAS, 0.0f);
View Full Code Here

Examples of javax.media.opengl.GL2.glReadPixels()

                    default:
                        assert false;
                        return;
                }

                gl.glReadPixels(xSrcOffset, yAdjusted, width, height,
                        oglFormat, GL.GL_UNSIGNED_BYTE, ByteBuffer.wrap((byte[]) imageBuffer));


            } else if(imageDataType == ImageComponentRetained.IMAGE_DATA_TYPE_INT_ARRAY) {
                int intType = GL2.GL_UNSIGNED_INT_8_8_8_8;
View Full Code Here

Examples of javax.media.opengl.GL2.glReadPixels()

                if(forceAlphaToOne) {
                    gl.glPixelTransferf(GL2.GL_ALPHA_SCALE, 0.0f);
                    gl.glPixelTransferf(GL2.GL_ALPHA_BIAS, 1.0f);
                }

                gl.glReadPixels(xSrcOffset, yAdjusted, width, height,
                        oglFormat, intType, IntBuffer.wrap((int[]) imageBuffer));

                /* Restore Alpha scale and bias */
                if(forceAlphaToOne) {
                    gl.glPixelTransferf(GL2.GL_ALPHA_SCALE, 1.0f);
View Full Code Here

Examples of javax.media.opengl.GL2.glReadPixels()

        if ((type & Raster.RASTER_DEPTH) != 0) {

            if (depthFormat == DepthComponentRetained.DEPTH_COMPONENT_TYPE_INT) {
                // yOffset is adjusted for OpenGL - Y upward
                gl.glReadPixels(xSrcOffset, yAdjusted, width, height,
                        GL2.GL_DEPTH_COMPONENT, GL.GL_UNSIGNED_INT, IntBuffer.wrap((int[]) depthBuffer));
            } else {
                // DEPTH_COMPONENT_TYPE_FLOAT
                // yOffset is adjusted for OpenGL - Y upward
                gl.glReadPixels(xSrcOffset, yAdjusted, width, height,
View Full Code Here

Examples of javax.media.opengl.GL2.glReadPixels()

                gl.glReadPixels(xSrcOffset, yAdjusted, width, height,
                        GL2.GL_DEPTH_COMPONENT, GL.GL_UNSIGNED_INT, IntBuffer.wrap((int[]) depthBuffer));
            } else {
                // DEPTH_COMPONENT_TYPE_FLOAT
                // yOffset is adjusted for OpenGL - Y upward
                gl.glReadPixels(xSrcOffset, yAdjusted, width, height,
                        GL2.GL_DEPTH_COMPONENT, GL.GL_FLOAT, FloatBuffer.wrap((float[]) depthBuffer));
            }
        }

    }
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.