JNpp
Java bindings for NPP
JNpp is a library that makes the
NPP libraries
available for Java programmers. You may obtain the latest version of JNpp
in the
Downloads section.
General information about JNpp
Note that the current version of JNpp is an
early beta version, and
the API may still change. At the moment, JNpp offers the image processing
methods of NPP which are provided via the
JNppi class,
and the signal processing methods of NPP which are provided via the
JNpps class.
Some functions (like multi-level histogram computations) are not yet fully
supported.
As in all JCuda libraries, the methods follow the same naming conventions
as the native methods, and only form a thin layer around the original C API.
The
JNpp Utilities library
also mimics the NPP utilities that are provided in the NVIDIA CUDA SDK.
Some concepts used in these utility classes and the NPP API are not
very well suited for Java. Many methods from NPP may hardly be applied
directly in Java applications at all, for example, those that deal with
unsigned data types. The JNpp library in its current form is intended
as the basis for the development of high-level, object oriented classes
that better suit the needs of Java programmers, for example, in
applications like ImageJ. Therefore, the low-level methods of the
original NPP library are offered with their full verbosity, but also
with their full flexibility.
Writing unit tests for thousands of methods like
nppiYCbCr420ToYCbCr411_8u_P3P2R
or
nppiQuantInvTableInit_JPEG_8u16u
is not feasible. So if you encounter any errors, please
contact me.
Here is a sample showing the possible application of the JNpp image functions:
Source code:
JNppHistEqualizationSample.java
Input image file:
lena512color_pale.png
The sample is adopted from the "Histogram Equalization" sample from
the NVIDIA CUDA SDK. It reads an input image, converts it to a
grayscale image, performs a histogram equalization using JNpp,
and writes the resulting image:
Input image: | Output image: |
| |
Another basic example, showing a basic application of the JNpp signal processing
functions to compute the number of zero-crossings of an input signal:
JNppsBasicTest.java