Is there any method to load texture image(JPEG) format in native code?

1,429 views
Skip to first unread message

Atul Prakash

unread,
May 9, 2011, 4:19:58 AM5/9/11
to android-ndk
Dear Friends,

Currently, I am trying to convert existing objective-c code(iOS) of 3D
Game to Android using NDK. I am trying to load (.jpg) texture image in
my native code. Previously, I have successfully loaded texture image
of .png format using libzip (http://www.nih.at/libzip/) and libpng (
http://www.libpng.org/pub/png/libpng.html) also, but now I am looking
forward for the possibility to load .jpg images directly in my native
code.

One more thing, I want to know is: How to add media resources like
audio & video in the native code without using OpenSL Library or is it
possible to load media resources in Java files & access those
resources from my native code?

Thanks in advance.

Atul Prakash Singh

alan

unread,
May 9, 2011, 4:23:09 AM5/9/11
to andro...@googlegroups.com
not built into the ndk, it should be relatively easy to compile libjpeg in the same way you compiled libpng

Philippe Simons

unread,
May 9, 2011, 5:31:16 AM5/9/11
to andro...@googlegroups.com
lib SOIL http://www.lonesock.net/soil.html is working well

you may need to clean/hack it a bit, because the lib is decoding and loading the image in a OpenGL texture (not compatible with OpenGL ES texture)

On Mon, May 9, 2011 at 10:23 AM, alan <al...@birtles.org.uk> wrote:
not built into the ndk, it should be relatively easy to compile libjpeg in the same way you compiled libpng

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Atul Prakash

unread,
May 9, 2011, 6:01:09 AM5/9/11
to android-ndk
Can you provide any link where I can get any sample application that
uses libjpeg, in order to load .jpg format texture image, if
possible.....

On May 9, 2:31 pm, Philippe Simons <simons.phili...@gmail.com> wrote:
> lib SOILhttp://www.lonesock.net/soil.htmlis working well

Zoran Angelov

unread,
May 9, 2011, 7:32:03 AM5/9/11
to andro...@googlegroups.com
Hi Atul,
you can take a look at boost.gil library, io extension: http://www.boost.org/ 
It uses libjpeg for reading jpeg images.
Download it, and take a look at boost/gil/extension/io/jpeg_io_private.hpp .
There is also support for png file format.
boost.gil is library contributed from adobe: http://opensource.adobe.com/wiki/display/gil/Generic+Image+Library

Андрей Апанасик

unread,
Sep 9, 2013, 11:41:55 AM9/9/13
to andro...@googlegroups.com
https://github.com/Suvitruf/libjpeg-version-9-android

понедельник, 9 мая 2011 г., 12:19:58 UTC+4 пользователь Atul Prakash написал:
Reply all
Reply to author
Forward
0 new messages