This is a very interesting thread.
In some of my apps I use a C library for 2D image manipulation, i.e.
no need for GL.
The best way I've found so far is to use a direct ByteBuffer, and on
that I use Bitmap.copyPixelsToBuffer and copyPixelsFromBuffer in java
code, and then get the data ptr in C code to access the ByteBuffer...
Are you suggesting that using the GL APIs might be even more
efficient? Personally I thought getting access to SkBitmap in the NDK
would be super, as I could then directly access the data buffer in the
Bitmap object and circumvent the need for copying...
regards
Anders
On Oct 17, 12:37 am, Jack Palevich <
jack...@google.com> wrote:
> Well, yeah, sure, you could do that.
> I was thinking more along the lines of you calling GLUtils.texImage2D from
> your Java code, right next to where you created or obtained the Bitmap
> object. I figured there had to be some Java code somewhere, or else you
> wouldn't have a Bitmap object to begin with.
>
> On Fri, Oct 16, 2009 at 3:20 PM, Bipin George Mathew <
bipi...@gmail.com>wrote:
> > > On Fri, Oct 16, 2009 at 1:53 PM, Bipin George Mathew <
bipi...@gmail.com>
> > > wrote:
>
> > >> Well, that won't work for me since I am doing all my openGl rendering
> > >> in native.
>
> > >> I guess, my question becomes that same as here
>
> > >> -
> >
http://groups.google.com/group/android-ndk/browse_thread/thread/59ef8...
>
> > >> -Bipin
>
> > >> On Fri, Oct 16, 2009 at 12:55 PM, Jack Palevich <
jack...@google.com>
> > >> wrote:
> > >> > The best (and fastest) way is to use the Android Java API
> > >> > android.opengl.GLUtils.texImage2D.
> > >> > This API will create an OpenGL texture from the Android Bitmap without
> > >> > making a copy of the bitmap data.
> > >> > There's also texSubImage2D if you need that.
>