77 double[] matrix, int interpType);
78 public static native int transformRaster(Raster src, Raster dst,
79 double[] matrix,
80 int interpType);
81 public static native int convolveBI(BufferedImage src, BufferedImage dst,
82 Kernel kernel, int edgeHint);
83 public static native int convolveRaster(Raster src, Raster dst,
84 Kernel kernel, int edgeHint);
85 public static native int lookupByteBI(BufferedImage src, BufferedImage dst,
86 byte[][] table);
87 public static native int lookupByteRaster(Raster src, Raster dst,
88 byte[][] table);
89
90 static {
91
92 PrivilegedAction<Boolean> doMlibInitialization =
93 new PrivilegedAction<Boolean>() {
94 public Boolean run() {
95 String arch = System.getProperty("os.arch");
96
97 if (arch == null || !arch.startsWith("sparc")) {
98 try {
99 System.loadLibrary("mlib_image");
100 } catch (UnsatisfiedLinkError e) {
101 return Boolean.FALSE;
102 }
103
104 }
105 boolean success = init();
106 return Boolean.valueOf(success);
107 }
108 };
109
110 useLib = AccessController.doPrivileged(doMlibInitialization);
111
112 //
113 // Cache the class references of the operations we know about
114 // at the time this class is initially loaded.
115 //
116 try {
117 nativeOpClass[LOOKUP_OP] =
118 Class.forName("java.awt.image.LookupOp");
119 } catch (ClassNotFoundException e) {
120 System.err.println("Could not find class: "+e);
121 }
122 try {
123 nativeOpClass[AFFINE_OP] =
124 Class.forName("java.awt.image.AffineTransformOp");
|
77 double[] matrix, int interpType);
78 public static native int transformRaster(Raster src, Raster dst,
79 double[] matrix,
80 int interpType);
81 public static native int convolveBI(BufferedImage src, BufferedImage dst,
82 Kernel kernel, int edgeHint);
83 public static native int convolveRaster(Raster src, Raster dst,
84 Kernel kernel, int edgeHint);
85 public static native int lookupByteBI(BufferedImage src, BufferedImage dst,
86 byte[][] table);
87 public static native int lookupByteRaster(Raster src, Raster dst,
88 byte[][] table);
89
90 static {
91
92 PrivilegedAction<Boolean> doMlibInitialization =
93 new PrivilegedAction<Boolean>() {
94 public Boolean run() {
95 String arch = System.getProperty("os.arch");
96
97 try {
98 System.loadLibrary("mlib_image");
99 } catch (UnsatisfiedLinkError e) {
100 return Boolean.FALSE;
101 }
102 boolean success = init();
103 return Boolean.valueOf(success);
104 }
105 };
106
107 useLib = AccessController.doPrivileged(doMlibInitialization);
108
109 //
110 // Cache the class references of the operations we know about
111 // at the time this class is initially loaded.
112 //
113 try {
114 nativeOpClass[LOOKUP_OP] =
115 Class.forName("java.awt.image.LookupOp");
116 } catch (ClassNotFoundException e) {
117 System.err.println("Could not find class: "+e);
118 }
119 try {
120 nativeOpClass[AFFINE_OP] =
121 Class.forName("java.awt.image.AffineTransformOp");
|