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


Java GLES20.glBindFramebuffer方法代码示例

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


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

示例1: onDrawFrame

import android.opengl.GLES20; //导入方法依赖的package包/类
@Override
public int onDrawFrame(final int textureId) {
	if (mFrameBuffers == null || mFrameBufferTextures == null) {
        return OpenGLUtils.NOT_INIT;
    }
	int size = mFilters.size();
    int previousTexture = textureId;
    for (int i = 0; i < size; i++) {
    	GPUImageFilter filter = mFilters.get(i);
        boolean isNotLast = i < size - 1;
        if (isNotLast) {
            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBuffers[i]);
            GLES20.glClearColor(0, 0, 0, 0);
            filter.onDrawFrame(previousTexture, mGLCubeBuffer, mGLTextureBuffer);
            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
            previousTexture = mFrameBufferTextures[i];
        }else{
        	filter.onDrawFrame(previousTexture, mGLCubeBuffer, mGLTextureBuffer);
        }
    }
	return OpenGLUtils.ON_DRAWN;  	
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:23,代码来源:MagicBaseGroupFilter.java

示例2: initFrameBuffer

import android.opengl.GLES20; //导入方法依赖的package包/类
public void initFrameBuffer(int width, int height) {
    mWidth = width;
    mHeight = height;

    deleteFrameBuffer();

    int[] frameBuffers = new int[1];
    GLES20.glGenFramebuffers(1, frameBuffers, 0);
    mFrameBuffer = frameBuffers[0];

    int[] frameBufferTextures = new int[1];
    GLES20.glGenTextures(1, frameBufferTextures, 0);
    mFrameBufferTexture = frameBufferTextures[0];
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mFrameBufferTexture);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBuffer);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, mFrameBufferTexture, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
}
 
开发者ID:vipycm,项目名称:mao-android,代码行数:26,代码来源:CameraFilter.java

示例3: createFrameBuffer

import android.opengl.GLES20; //导入方法依赖的package包/类
public void createFrameBuffer(int width, int height, int[] frameBuffer, int[] frameBufferTexture, int frameBufferSize) {
    for (int i = 0; i < frameBufferSize; i++) {

        GLES20.glGenTextures(1, frameBufferTexture, i);
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, frameBufferTexture[i]);
        GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0,
                GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);

        GLES20.glGenFramebuffers(1, frameBuffer, i);
        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, frameBuffer[i]);
        GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
                GLES20.GL_TEXTURE_2D, frameBufferTexture[i], 0);

        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
    }
}
 
开发者ID:lzmlsfe,项目名称:19porn,代码行数:26,代码来源:SurfaceRenderer.java

示例4: initFBO

import android.opengl.GLES20; //导入方法依赖的package包/类
private void initFBO(int width, int height)
{
    Log.d(LOGTAG, "initFBO("+width+"x"+height+")");

    deleteFBO();

    GLES20.glGenTextures(1, texDraw, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texDraw[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    GLES20.glGenTextures(1, texFBO, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texFBO[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    //int hFBO;
    GLES20.glGenFramebuffers(1, FBO, 0);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, FBO[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, texFBO[0], 0);
    Log.d(LOGTAG, "initFBO error status: " + GLES20.glGetError());

    int FBOstatus = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
    if (FBOstatus != GLES20.GL_FRAMEBUFFER_COMPLETE)
        Log.e(LOGTAG, "initFBO failed, status: " + FBOstatus);

    mFBOWidth  = width;
    mFBOHeight = height;
}
 
开发者ID:vipycm,项目名称:mao-android,代码行数:36,代码来源:CameraGLRendererBase.java

示例5: drawTex

import android.opengl.GLES20; //导入方法依赖的package包/类
private void drawTex(int tex, boolean isOES, int fbo)
{
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, fbo);

    if(fbo == 0)
        GLES20.glViewport(0, 0, mView.getWidth(), mView.getHeight());
    else
        GLES20.glViewport(0, 0, mFBOWidth, mFBOHeight);

    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);

    if(isOES) {
        GLES20.glUseProgram(progOES);
        GLES20.glVertexAttribPointer(vPosOES, 2, GLES20.GL_FLOAT, false, 4*2, vert);
        GLES20.glVertexAttribPointer(vTCOES,  2, GLES20.GL_FLOAT, false, 4*2, texOES);
    } else {
        GLES20.glUseProgram(prog2D);
        GLES20.glVertexAttribPointer(vPos2D, 2, GLES20.GL_FLOAT, false, 4*2, vert);
        GLES20.glVertexAttribPointer(vTC2D,  2, GLES20.GL_FLOAT, false, 4*2, tex2D);
    }

    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);

    if(isOES) {
        GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, tex);
        GLES20.glUniform1i(GLES20.glGetUniformLocation(progOES, "sTexture"), 0);
    } else {
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, tex);
        GLES20.glUniform1i(GLES20.glGetUniformLocation(prog2D, "sTexture"), 0);
    }

    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
    GLES20.glFlush();
}
 
开发者ID:ahmetozlu,项目名称:real_time_circle_detection_android,代码行数:35,代码来源:CameraGLRendererBase.java

示例6: deleteFBO

import android.opengl.GLES20; //导入方法依赖的package包/类
private void deleteFBO()
{
    Log.d(LOGTAG, "deleteFBO("+mFBOWidth+"x"+mFBOHeight+")");
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
    GLES20.glDeleteFramebuffers(1, FBO, 0);

    deleteTex(texFBO);
    deleteTex(texDraw);
    mFBOWidth = mFBOHeight = 0;
}
 
开发者ID:raulh82vlc,项目名称:Image-Detection-Samples,代码行数:11,代码来源:CameraGLRendererBase.java

示例7: onDraw

import android.opengl.GLES20; //导入方法依赖的package包/类
@Override public void onDraw(float[] mvpMatrix, FloatBuffer vertexBuffer, int firstVertex,
        int vertexCount, int coordsPerVertex, int vertexStride, float[] texMatrix,
        FloatBuffer texBuffer, int textureId, int texStride) {

    // TODO
    int size = mFilters.size();
    int previousTextureId = textureId;
    for (int i = 0; i < size; i++) {
        T filter = mFilters.get(i);
        boolean isNotLast = i < size - 1;

        if (isNotLast) {
            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBuffers[i]);
            GLES20.glClearColor(0, 0, 0, 0);
        }

        if (i == 0) {
            filter.onDraw(mvpMatrix, vertexBuffer, firstVertex, vertexCount, coordsPerVertex,
                    vertexStride, texMatrix, texBuffer, previousTextureId, texStride);
        } else if (i == size - 1) {
            filter.onDraw(mvpMatrix, mDrawable2d.getVertexArray(), firstVertex, vertexCount,
                    coordsPerVertex, vertexStride, texMatrix,
                    (size % 2 == 0) ? mDrawableFlipVertical2d.getTexCoordArray()
                            : mDrawable2d.getTexCoordArray(), previousTextureId, texStride);
        } else {
            filter.onDraw(mvpMatrix, mDrawable2d.getVertexArray(), firstVertex, vertexCount,
                    coordsPerVertex, vertexStride, texMatrix, mDrawable2d.getTexCoordArray(),
                    previousTextureId, texStride);
        }

        if (isNotLast) {
            GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
            previousTextureId = mFrameBufferTextures[i];
        }
    }
}
 
开发者ID:hoanganhtuan95ptit,项目名称:EditPhoto,代码行数:37,代码来源:FilterGroup.java

示例8: update

import android.opengl.GLES20; //导入方法依赖的package包/类
private void update(RectF bounds, Runnable action) {
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, getReusableFramebuffer());
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, getTexture(), 0);

    int status = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
    if (status == GLES20.GL_FRAMEBUFFER_COMPLETE) {
        GLES20.glViewport(0, 0, (int) size.width, (int) size.height);
        action.run();
    }
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);

    if (!isSuppressingChanges() && delegate != null) {
        delegate.contentChanged(bounds);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:16,代码来源:Painting.java

示例9: drawEnhancePass

import android.opengl.GLES20; //导入方法依赖的package包/类
private void drawEnhancePass() {
    if (!hsvGenerated) {
        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, renderFrameBuffer[0]);
        GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, renderTexture[0], 0);
        GLES20.glClear(0);

        GLES20.glUseProgram(rgbToHsvShaderProgram);
        GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTexture[1]);
        GLES20.glUniform1i(rgbToHsvSourceImageHandle, 0);
        GLES20.glEnableVertexAttribArray(rgbToHsvInputTexCoordHandle);
        GLES20.glVertexAttribPointer(rgbToHsvInputTexCoordHandle, 2, GLES20.GL_FLOAT, false, 8, textureBuffer);
        GLES20.glEnableVertexAttribArray(rgbToHsvPositionHandle);
        GLES20.glVertexAttribPointer(rgbToHsvPositionHandle, 2, GLES20.GL_FLOAT, false, 8, vertexBuffer);
        GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);

        ByteBuffer hsvBuffer = ByteBuffer.allocateDirect(renderBufferWidth * renderBufferHeight * 4);
        GLES20.glReadPixels(0, 0, renderBufferWidth, renderBufferHeight, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, hsvBuffer);

        GLES20.glBindTexture(GL10.GL_TEXTURE_2D, enhanceTextures[0]);
        GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
        GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);
        GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, renderBufferWidth, renderBufferHeight, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, hsvBuffer);

        ByteBuffer buffer = null;
        try {
            buffer = ByteBuffer.allocateDirect(PGPhotoEnhanceSegments * PGPhotoEnhanceSegments * PGPhotoEnhanceHistogramBins * 4);
            Utilities.calcCDT(hsvBuffer, renderBufferWidth, renderBufferHeight, buffer);
        } catch (Exception e) {
            FileLog.e("tmessages", e);
        }

        GLES20.glBindTexture(GL10.GL_TEXTURE_2D, enhanceTextures[1]);
        GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
        GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);
        GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, 256, 16, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buffer);

        hsvGenerated = true;
    }

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, renderFrameBuffer[1]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, renderTexture[1], 0);
    GLES20.glClear(0);

    GLES20.glUseProgram(enhanceShaderProgram);
    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, enhanceTextures[0]);
    GLES20.glUniform1i(enhanceSourceImageHandle, 0);
    GLES20.glActiveTexture(GLES20.GL_TEXTURE1);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, enhanceTextures[1]);
    GLES20.glUniform1i(enhanceInputImageTexture2Handle, 1);
    if (showOriginal) {
        GLES20.glUniform1f(enhanceIntensityHandle, 0);
    } else {
        GLES20.glUniform1f(enhanceIntensityHandle, getEnhanceValue());
    }

    GLES20.glEnableVertexAttribArray(enhanceInputTexCoordHandle);
    GLES20.glVertexAttribPointer(enhanceInputTexCoordHandle, 2, GLES20.GL_FLOAT, false, 8, textureBuffer);
    GLES20.glEnableVertexAttribArray(enhancePositionHandle);
    GLES20.glVertexAttribPointer(enhancePositionHandle, 2, GLES20.GL_FLOAT, false, 8, vertexBuffer);
    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:68,代码来源:PhotoFilterView.java

示例10: bindTextureToFrameBuffer

import android.opengl.GLES20; //导入方法依赖的package包/类
public static void bindTextureToFrameBuffer(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
    GLES20.glBindTexture(3553, paramInt2);
    GLES20.glTexImage2D(3553, 0, 6408, paramInt3, paramInt4, 0, 6408, 5121, null);

    GLES20.glTexParameterf(3553, 10240, 9729.0F);

    GLES20.glTexParameterf(3553, 10241, 9729.0F);

    GLES20.glTexParameterf(3553, 10242, 33071.0F);

    GLES20.glTexParameterf(3553, 10243, 33071.0F);

    GLES20.glBindFramebuffer(36160, paramInt1);
    GLES20.glFramebufferTexture2D(36160, 36064, 3553, paramInt2, 0);

    GLES20.glBindTexture(3553, 0);
    GLES20.glBindFramebuffer(36160, 0);
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:20,代码来源:OpenGlUtils.java

示例11: notifyCallbacks

import android.opengl.GLES20; //导入方法依赖的package包/类
private void notifyCallbacks(VideoFrame frame, boolean wasRendered) {
  if (frameListeners.isEmpty())
    return;

  drawMatrix.reset();
  drawMatrix.preTranslate(0.5f, 0.5f);
  if (mirror)
    drawMatrix.preScale(-1f, 1f);
  drawMatrix.preScale(1f, -1f); // We want the output to be upside down for Bitmap.
  drawMatrix.preTranslate(-0.5f, -0.5f);

  Iterator<FrameListenerAndParams> it = frameListeners.iterator();
  while (it.hasNext()) {
    FrameListenerAndParams listenerAndParams = it.next();
    if (!wasRendered && listenerAndParams.applyFpsReduction) {
      continue;
    }
    it.remove();

    final int scaledWidth = (int) (listenerAndParams.scale * frame.getRotatedWidth());
    final int scaledHeight = (int) (listenerAndParams.scale * frame.getRotatedHeight());

    if (scaledWidth == 0 || scaledHeight == 0) {
      listenerAndParams.listener.onFrame(null);
      continue;
    }

    if (bitmapTextureFramebuffer == null) {
      bitmapTextureFramebuffer = new GlTextureFrameBuffer(GLES20.GL_RGBA);
    }
    bitmapTextureFramebuffer.setSize(scaledWidth, scaledHeight);

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, bitmapTextureFramebuffer.getFrameBufferId());
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
        GLES20.GL_TEXTURE_2D, bitmapTextureFramebuffer.getTextureId(), 0);

    GLES20.glClearColor(0 /* red */, 0 /* green */, 0 /* blue */, 0 /* alpha */);
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
    frameDrawer.drawFrame(frame, listenerAndParams.drawer, drawMatrix, 0 /* viewportX */,
        0 /* viewportY */, scaledWidth, scaledHeight);

    final ByteBuffer bitmapBuffer = ByteBuffer.allocateDirect(scaledWidth * scaledHeight * 4);
    GLES20.glViewport(0, 0, scaledWidth, scaledHeight);
    GLES20.glReadPixels(
        0, 0, scaledWidth, scaledHeight, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, bitmapBuffer);

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
    GlUtil.checkNoGLES2Error("EglRenderer.notifyCallbacks");

    final Bitmap bitmap = Bitmap.createBitmap(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);
    bitmap.copyPixelsFromBuffer(bitmapBuffer);
    listenerAndParams.listener.onFrame(bitmap);
  }
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:55,代码来源:EglRenderer.java

示例12: draw

import android.opengl.GLES20; //导入方法依赖的package包/类
public void draw(int paramInt1, int paramInt2, FloatBuffer paramFloatBuffer1, FloatBuffer paramFloatBuffer2)
{
    z();
    C();
    start();
    if ((!isInitialized()) || (this.bD == null) || (this.bE == null) || (null == H())) {
        return;
    }
    if (paramInt1 == -1) {
        return;
    }
    int i = H().size();
    int j = paramInt1;
    for (int k = 0; k < i; k++)
    {
        GPUImageFilter localGPUImageFilter = (GPUImageFilter)H().get(k);
        int m = k < i - 1 ? 1 : 0;
        if (m != 0)
        {
            GLES20.glBindFramebuffer(36160, this.bD[(k % 2)]);
            GLES20.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
        }
        else if (-1 != paramInt2)
        {
            GLES20.glBindFramebuffer(36160, paramInt2);
            GLES20.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
        }
        if (k == 0)
        {
            localGPUImageFilter.d(false);
            localGPUImageFilter.onDraw(j, paramFloatBuffer1, paramFloatBuffer2);
        }
        else if (k == i - 1)
        {
            localGPUImageFilter.d(i % 2 == 0);
            localGPUImageFilter.onDraw(j, this.bF, i % 2 == 0 ? this.bH : this.bG);
        }
        else
        {
            localGPUImageFilter.d(false);
            localGPUImageFilter.onDraw(j, this.bF, this.bG);
        }
        if (null != this.bK) {
            this.bK.onSingleFilterDrawed(this.aS, this.aT);
        }
        if (m != 0)
        {
            GLES20.glBindFramebuffer(36160, 0);
            j = this.bE[(k % 2)];
        }
        else
        {
            GLES20.glBindFramebuffer(36160, 0);
        }
    }
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:57,代码来源:GPUImageFilterGroupBase.java

示例13: unbind

import android.opengl.GLES20; //导入方法依赖的package包/类
void unbind(){
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:4,代码来源:FBO.java


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