Learn how to a build a cloud-first strategyRegister Now


Share Image instance with Native code

Posted on 2005-04-29
Medium Priority
Last Modified: 2010-03-31

I need to perform some high quality, image resizes (with the use of the Lanczos3 and sometimes the Mitchell algorithms). I have managed to achieve this with just Java (with the use of JIU (http://jiu.sourceforge.net/)).

However, it takes quite a few seconds (approx 10) to resize an image, at 100% CPU usage.

As a result of this lag, I thought that I could get the job done quicker and more efficiently, if I were to use some C++ to do the Image resize (with this algorithm) ... I know how to share String, int, etc, instances, but how to share Image instances with C++? I haven't come across a jimage type in the jni.h file yet; lol, I'm guessing it can't be done? :o\

Question by:InteractiveMind
  • 2
LVL 92

Accepted Solution

objects earned 2000 total points
ID: 13892727
you'll need to encode it in some image format and pass using a byte array.
LVL 92

Expert Comment

ID: 13892731
which may well hurt your performance, depending on where you are getting the source image from.
LVL 25

Author Comment

ID: 13892736
Thanks Mick,
this was the answer I was expecting (and fearing). lol. :o\ Ah well.


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month21 days, 6 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question