/*
* 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.
*
* 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.
*/
/*
@test
@bug 5068850
@summary Tests that no exceptions are thrown when BufferedImageOp or RasterOps
are used.
@run main ImagingOpsNoExceptionsTest
*/
public class ImagingOpsNoExceptionsTest {
"Threshold", "RescaleOp" ,"Invert", "Yellow Invert", "3x3 Blur",
"3x3 Sharpen", "3x3 Edge", "5x5 Edge", "Color Convert", "Rotate"};
public static void runTest() {
int exceptions = 0;
// BUG: can't iterate through all image types because
// of crashes on solaris with VIS as of tiger-rc
for (int j = BufferedImage.TYPE_INT_RGB;
j <= BufferedImage.TYPE_INT_RGB; j++)
{
try {
} catch (Exception e) {
e.printStackTrace();
exceptions++;
}
try {
} catch (Exception e) {
e.printStackTrace();
exceptions++;
}
// BUG: LookupOp raster op crashes on solaris with VIS
// as of tiger-rc
try {
} catch (Exception e) {
e.printStackTrace();
exceptions++;
}
}
}
}
if (exceptions > 0) {
" exceptions were thrown");
}
}
byte threshold[] = new byte[256];
for (int j = 0; j < 256 ; j++) {
if (j > high) {
threshold[j] = (byte) 255;
} else if (j < low) {
threshold[j] = (byte) 0;
} else {
threshold[j] = (byte) j;
}
}
}
int i = 1;
i++;
byte invert[] = new byte[256];
byte ordered[] = new byte[256];
for (int j = 0; j < 256 ; j++) {
invert[j] = (byte) (256-j);
ordered[j] = (byte) j;
}
i++;
i++;
0.1f, 0.2f, 0.1f,
0.1f, 0.1f, 0.1f},
{-1.0f, -1.0f, -1.0f, // 3x3 sharpen
-1.0f, 9.0f, -1.0f,
-1.0f, -1.0f, -1.0f},
{ 0.f, -1.f, 0.f, // 3x3 edge
-1.f, 5.f, -1.f,
0.f, -1.f, 0.f},
{-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, // 5x5 edge
-1.0f, -1.0f, -1.0f, -1.0f, -1.0f,
-1.0f, -1.0f, 24.0f, -1.0f, -1.0f,
-1.0f, -1.0f, -1.0f, -1.0f, -1.0f,
-1.0f, -1.0f, -1.0f, -1.0f, -1.0f}};
}
i++;
runTest();
}
}