Android EffectFactory Bitmaps

Intento utilizar EffectFactory en Android para manipular algunas imágenes. Probé la muestra y funciona. Aquí la muestra: https://android.googlesource.com/platform/development/+/master/samples/HelloEffects/src/com/example/android/mediafx/HelloEffects.java

Pero, ¿cómo puedo cargar una image desde mi teléfono inteligente?

El caso es que no tengo un ImageView aquí, sino un GLSurfaceView.

Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.puppy); 

¿Qué método tengo que usar para get un bitmap personalizado?

Utilice esta class BitmapRenderer para dibujar Bitmap en OpenGL

 private static class BitmapRenderer implements GLSurfaceView.Renderer { private int[] textures; private Resources resources; public BitmapRenderer(Resources resources) { this.resources = resources; } private static final float[] VERTEX_COORDINATES = new float[] { -1.0f, +1.0f, 0.0f, +1.0f, +1.0f, 0.0f, -1.0f, -1.0f, 0.0f, +1.0f, -1.0f, 0.0f }; private static final float[] TEXTURE_COORDINATES = new float[] { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f }; private static final Buffer TEXCOORD_BUFFER = ByteBuffer.allocateDirect(TEXTURE_COORDINATES.length * 4) .order(ByteOrder.nativeOrder()).asFloatBuffer().put(TEXTURE_COORDINATES).rewind(); private static final Buffer VERTEX_BUFFER = ByteBuffer.allocateDirect(VERTEX_COORDINATES.length * 4) .order(ByteOrder.nativeOrder()).asFloatBuffer().put(VERTEX_COORDINATES).rewind(); @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { textures = new int[1]; gl.glEnable(GL10.GL_TEXTURE_2D); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); gl.glGenTextures(1, textures, 0); gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher), 0); } @Override public void onSurfaceChanged(GL10 gl, int width, int height) { gl.glViewport(0, 0, width, height); } @Override public void onDrawFrame(GL10 gl) { gl.glActiveTexture(GL10.GL_TEXTURE0); gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, VERTEX_BUFFER); gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, TEXCOORD_BUFFER); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4); } } 

Establezca su bitmap de la siguiente manera:

 glSurfaceView.setEGLContextClientVersion(1); glSurfaceView.setRenderer(new BitmapRenderer(getResources())); glSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);