當前位置: 首頁>>代碼示例>>Java>>正文


Java GLES11Ext.GL_TEXTURE_EXTERNAL_OES屬性代碼示例

本文整理匯總了Java中android.opengl.GLES11Ext.GL_TEXTURE_EXTERNAL_OES屬性的典型用法代碼示例。如果您正苦於以下問題:Java GLES11Ext.GL_TEXTURE_EXTERNAL_OES屬性的具體用法?Java GLES11Ext.GL_TEXTURE_EXTERNAL_OES怎麽用?Java GLES11Ext.GL_TEXTURE_EXTERNAL_OES使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.opengl.GLES11Ext的用法示例。


在下文中一共展示了GLES11Ext.GL_TEXTURE_EXTERNAL_OES屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: GLSurfaceFilter

/**
 * Constructor
 * this should be called in GL context
 */
public GLSurfaceFilter() {
    mCoordsPerVertex = 2;
    mVertexStride = mCoordsPerVertex * SIZEOF_FLOAT; // 8
    mVertexCount = FULL_RECTANGLE_COORDS.length / mCoordsPerVertex; //4
    mTexCoordStride = 2 * SIZEOF_FLOAT; //8

    hProgram = GLUtil.loadProgram(VERTEX_SHADER, FRAGMENT_SHADER);
    mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;

    // get locations of attributes and uniforms

    maPositionLoc = GLES20.glGetAttribLocation(hProgram, "aPosition");
    GLUtil.checkLocation(maPositionLoc, "aPosition");
    maTextureCoordLoc = GLES20.glGetAttribLocation(hProgram, "aTextureCoord");
    GLUtil.checkLocation(maTextureCoordLoc, "aTextureCoord");
    muMVPMatrixLoc = GLES20.glGetUniformLocation(hProgram, "uMVPMatrix");
    GLUtil.checkLocation(muMVPMatrixLoc, "uMVPMatrix");
    muTexMatrixLoc = GLES20.glGetUniformLocation(hProgram, "uTexMatrix");
    GLUtil.checkLocation(muTexMatrixLoc, "uTexMatrix");
}
 
開發者ID:LeonHover,項目名稱:MediaCodecRecorder,代碼行數:24,代碼來源:GLSurfaceFilter.java

示例2: genTexture

public static int genTexture(int textureType) {
    int[] genBuf = new int[1];
    GLES20.glGenTextures(1, genBuf, 0);
    GLES20.glBindTexture(textureType, genBuf[0]);

    // Set texture default draw parameters
    if (textureType == GLES11Ext.GL_TEXTURE_EXTERNAL_OES) {
        GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
        GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);

    } else {
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
        GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
        GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
    }

    return genBuf[0];
}
 
開發者ID:SimonCherryGZ,項目名稱:face-landmark-android,代碼行數:21,代碼來源:MyGLUtils.java

示例3: onInitTextureExt

private void onInitTextureExt(boolean isForExternalTextureInput) {
    mTextureTarget = GLES20.GL_TEXTURE_2D;
    if (isForExternalTextureInput) {
        mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
        mFragmentShader = "#extension GL_OES_EGL_image_external : require\n" +
                mFragmentShader.replace("uniform sampler2D inputImageTexture;",
                        "uniform samplerExternalOES inputImageTexture;");


        int[] textures = new int[1];
        GLES20.glGenTextures(1, textures, 0);

        GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
        GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textures[0]);

        GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER,
                GLES20.GL_NEAREST);
        GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER,
                GLES20.GL_LINEAR);
        GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S,
                GLES20.GL_CLAMP_TO_EDGE);
        GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T,
                GLES20.GL_CLAMP_TO_EDGE);

        mSysRenderTexture = textures[0];

    }
}
 
開發者ID:lzmlsfe,項目名稱:19porn,代碼行數:28,代碼來源:GPUImageFilter.java

示例4: GPUImageExtFilter

public GPUImageExtFilter(final String vertexShader, final String fragmentShader) {
    mVertexShader = vertexShader;
    mFragmentShader = fragmentShader;
    mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
}
 
開發者ID:lzmlsfe,項目名稱:19porn,代碼行數:5,代碼來源:GPUImageExtFilter.java

示例5: Texture2dProgram

/**
 * Prepares the program in the current EGL context.
 */
public Texture2dProgram(ProgramType programType) {
    mProgramType = programType;

    switch (programType) {
        case TEXTURE_2D:
            mTextureTarget = GLES20.GL_TEXTURE_2D;
            mProgramHandle = GlUtil.createProgram(VERTEX_SHADER, FRAGMENT_SHADER_2D);
            break;
        case TEXTURE_EXT:
            mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
            mProgramHandle = GlUtil.createProgram(VERTEX_SHADER, FRAGMENT_SHADER_EXT);
            break;
        case TEXTURE_EXT_BW:
            mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
            mProgramHandle = GlUtil.createProgram(VERTEX_SHADER, FRAGMENT_SHADER_EXT_BW);
            break;
        case TEXTURE_EXT_FILT:
            mTextureTarget = GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
            mProgramHandle = GlUtil.createProgram(VERTEX_SHADER, FRAGMENT_SHADER_EXT_FILT);
            break;
        default:
            throw new RuntimeException("Unhandled type " + programType);
    }
    if (mProgramHandle == 0) {
        throw new RuntimeException("Unable to create program");
    }
    Log.d(TAG, "Created program " + mProgramHandle + " (" + programType + ")");

    // get locations of attributes and uniforms

    maPositionLoc = GLES20.glGetAttribLocation(mProgramHandle, "aPosition");
    GlUtil.checkLocation(maPositionLoc, "aPosition");
    maTextureCoordLoc = GLES20.glGetAttribLocation(mProgramHandle, "aTextureCoord");
    GlUtil.checkLocation(maTextureCoordLoc, "aTextureCoord");
    muMVPMatrixLoc = GLES20.glGetUniformLocation(mProgramHandle, "uMVPMatrix");
    GlUtil.checkLocation(muMVPMatrixLoc, "uMVPMatrix");
    muTexMatrixLoc = GLES20.glGetUniformLocation(mProgramHandle, "uTexMatrix");
    GlUtil.checkLocation(muTexMatrixLoc, "uTexMatrix");
    muKernelLoc = GLES20.glGetUniformLocation(mProgramHandle, "uKernel");
    if (muKernelLoc < 0) {
        // no kernel in this one
        muKernelLoc = -1;
        muTexOffsetLoc = -1;
        muColorAdjustLoc = -1;
    } else {
        // has kernel, must also have tex offset and color adj
        muTexOffsetLoc = GLES20.glGetUniformLocation(mProgramHandle, "uTexOffset");
        GlUtil.checkLocation(muTexOffsetLoc, "uTexOffset");
        muColorAdjustLoc = GLES20.glGetUniformLocation(mProgramHandle, "uColorAdjust");
        GlUtil.checkLocation(muColorAdjustLoc, "uColorAdjust");

        // initialize default values
        setKernel(new float[] {0f, 0f, 0f,  0f, 1f, 0f,  0f, 0f, 0f}, 0f);
        setTexSize(256, 256);
    }
}
 
開發者ID:AndyZhu1991,項目名稱:grafika,代碼行數:59,代碼來源:Texture2dProgram.java

示例6: getTextureTarget

@Override public int getTextureTarget() {
    return GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
}
 
開發者ID:hoanganhtuan95ptit,項目名稱:EditPhoto,代碼行數:3,代碼來源:CameraFilter.java


注:本文中的android.opengl.GLES11Ext.GL_TEXTURE_EXTERNAL_OES屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。