Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Share Image instance with Native code

Posted on 2005-04-29
3
Medium Priority
?
266 Views
Last Modified: 2010-03-31
Hi,

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\

Thanks,
Rob.
0
Comment
Question by:InteractiveMind
  • 2
3 Comments
 
LVL 92

Accepted Solution

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

Expert Comment

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

Author Comment

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

Regards;
0

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