/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class provides a hook to access platform-specific
* imaging code.
*
* If the implementing class cannot handle the op, tile format or
* image format, the method will return null;
* If there is an error when processing the
* data, the implementing class may either return null
* (in which case our java code will be executed) or may throw
* an exception.
*/
public class ImagingLib {
static boolean useLib = true;
static boolean verbose = false;
/**
* Returned value indicates whether the library initailization was
* succeded.
*
* There could be number of reasons to failure:
* - failed to load library.
* - failed to get all required entry points.
*/
private static native boolean init();
double[] matrix, int interpType);
double[] matrix,
int interpType);
byte[][] table);
byte[][] table);
static {
new PrivilegedAction<Boolean>() {
try {
} catch (UnsatisfiedLinkError e) {
}
}
}
};
//
// Cache the class references of the operations we know about
// at the time this class is initially loaded.
//
try {
} catch (ClassNotFoundException e) {
}
try {
} catch (ClassNotFoundException e) {
}
try {
} catch (ClassNotFoundException e) {
}
}
//
// Search for this class in cached list of
// classes supplying native acceleration
//
int opIndex = -1;
for (int i=0; i<NUM_NATIVE_OPS; i++) {
if (opClass == nativeOpClass[i]) {
opIndex = i;
break;
}
}
return opIndex;
}
if (useLib == false) {
return null;
}
// Create the destination tile
}
case LOOKUP_OP:
// REMIND: Fix this!
// Right now the native code doesn't support offsets
return null;
}
if (table instanceof ByteLookupTable) {
}
}
break;
case AFFINE_OP:
double[] matrix = new double[6];
}
break;
case CONVOLVE_OP:
}
break;
default:
break;
}
}
return retRaster;
}
{
if (verbose) {
}
if (useLib == false) {
return null;
}
// Create the destination image
}
case LOOKUP_OP:
// REMIND: Fix this!
// Right now the native code doesn't support offsets
return null;
}
if (table instanceof ByteLookupTable) {
}
}
break;
case AFFINE_OP:
double[] matrix = new double[6];
}
break;
case CONVOLVE_OP:
}
break;
default:
break;
}
}
return retBI;
}
}