Share Image instance with Native code

Posted on 2005-04-29
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 (

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
    LVL 92

    Accepted Solution

    you'll need to encode it in some image format and pass using a byte array.
    LVL 92

    Expert Comment

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

    Author Comment

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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    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…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now