How to rotate image in android using android ndk - c

i want to rotate bitmap in android . i don't want to use android api but want to use c code for image processing and fast response. can u tell me how to achieve this in c??
Thank you in advance

You could use OpenCV for Android by processing a rotation matrix in native code. But if you really just want to rotate an image, using native code for this would be over the top, unless you plan adding more complex transformations. A single transformation supposedly won't be processed faster in comparison to just rotating it in Java.

There is a nice solution for your needs: ImageMagick. You can compile C version of ImageMagick with NDK. There is also ImageMagick-Android project on github, but it doesn't look like a ready-to-use solution.

Related

How to extract metadata from an image

I'm a newbie to codenameone. I'm trying to develop some image-processing app. I need to know if the image has geotagging information and eventually extract those. Is there a way to do that in CodenameOne?
I'm aware of the methods based on plain javax.imageio packages, but I know that those are not available in codenameone.
Thanks for any hints!
We don't have such an API as it's pretty different between Android/iOS. You can write something like this in pure Java and parse the image header which should be relatively simple.
Or you can build a cn1lib on top of native code e.g. see this library, It does that for video which is arguably harder.

Taking a screenshot of a window in C using only the X11 lib

I am coding a raytracer engine in C using X11 on a Linux. I would like to add a screenshot feature but I can't use any other lib than the standard X11.
Is there a "simple" way to do that, or do I have to create a bmp file myself from the pixels I have?
You will manually have to get color values of all the pixels and then convert it to a format of your choice.
AFAIK, there is no "simple" way to do it.
You can check with this question here: How do take a screenshot correctly with xlib?

Display image file using C programming

I want to read and display a png image using c programming. Please suggest some ways. Is it possible to use libPng library for displaying image ?
libPng will only decode the image into an RGBA-array for you. To then display the image you could use OpenGL or an OS-dependendent graphics-library.
EDIT: Since you say you are using windows:
On Windows you have many library choices: I suggest you start with SDL, you can start by showing your image like this: http://www.sdltutorials.com/Data/Posts/105/ss1.jpg and then continue building your application from there. There are many tutorials on SDL (see here: http://www.sdltutorials.com/tutorials). The JPG was from this one: http://www.sdltutorials.com/sdl-coordinates-and-blitting

Using libvlc on android with NDK

I am currently messing around a bit with libvlc on android using the NDK.
Well, I understand how to use native C code in an android app.
Now I would like to use the libvlc library to make a simple player which would read data from a socket.
Is it possible to use libvlc at that level? The problem I see is when it comes to set a window handler for libvlc to draw the image on.
Has anyone experienced with this that could give me some feedback?
Thank you.
You might be interested in this - https://bitbucket.org/tewilove/nyan.tv-jni/src
Edit: Looks like the nyan.tv link doesn't exist anymore. A possibly more 'official' sample is here -> https://bitbucket.org/edwardcw/libvlc-android-sample

Is there any crossplatform C library for using Pixel Shading filters?

Is there any crossplatform C library for using Pixel Shading filters? to run pixel shader inside your programm, beter as native part of your programm (not like precompiled file), and better for using with abstract data - not only images
Does this do what you want? http://www.khronos.org/opencl/ The question is not very detailed, or clear, but I think OpenCL qualifies as an answer...
OpenCL or CUDA are the closest to what you want.

Resources