equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
28 import java.awt.color.ICC_Profile; |
28 import java.awt.color.ICC_Profile; |
29 import java.awt.geom.Rectangle2D; |
29 import java.awt.geom.Rectangle2D; |
30 import java.awt.Rectangle; |
30 import java.awt.Rectangle; |
31 import java.awt.RenderingHints; |
31 import java.awt.RenderingHints; |
32 import java.awt.geom.Point2D; |
32 import java.awt.geom.Point2D; |
33 import javax.tools.annotation.GenerateNativeHeader; |
33 import java.lang.annotation.Native; |
34 import sun.awt.image.ImagingLib; |
34 import sun.awt.image.ImagingLib; |
35 |
35 |
36 /** |
36 /** |
37 * This class implements a convolution from the source |
37 * This class implements a convolution from the source |
38 * to the destination. |
38 * to the destination. |
64 * Note that the Source and the Destination may not be the same object. |
64 * Note that the Source and the Destination may not be the same object. |
65 * @see Kernel |
65 * @see Kernel |
66 * @see java.awt.RenderingHints#KEY_COLOR_RENDERING |
66 * @see java.awt.RenderingHints#KEY_COLOR_RENDERING |
67 * @see java.awt.RenderingHints#KEY_DITHERING |
67 * @see java.awt.RenderingHints#KEY_DITHERING |
68 */ |
68 */ |
69 /* No native methods here, but the constants are needed in the supporting JNI code */ |
|
70 @GenerateNativeHeader |
|
71 public class ConvolveOp implements BufferedImageOp, RasterOp { |
69 public class ConvolveOp implements BufferedImageOp, RasterOp { |
72 Kernel kernel; |
70 Kernel kernel; |
73 int edgeHint; |
71 int edgeHint; |
74 RenderingHints hints; |
72 RenderingHints hints; |
75 /** |
73 /** |
79 /** |
77 /** |
80 * Pixels at the edge of the destination image are set to zero. This |
78 * Pixels at the edge of the destination image are set to zero. This |
81 * is the default. |
79 * is the default. |
82 */ |
80 */ |
83 |
81 |
84 public static final int EDGE_ZERO_FILL = 0; |
82 @Native public static final int EDGE_ZERO_FILL = 0; |
85 |
83 |
86 /** |
84 /** |
87 * Pixels at the edge of the source image are copied to |
85 * Pixels at the edge of the source image are copied to |
88 * the corresponding pixels in the destination without modification. |
86 * the corresponding pixels in the destination without modification. |
89 */ |
87 */ |
90 public static final int EDGE_NO_OP = 1; |
88 @Native public static final int EDGE_NO_OP = 1; |
91 |
89 |
92 /** |
90 /** |
93 * Constructs a ConvolveOp given a Kernel, an edge condition, and a |
91 * Constructs a ConvolveOp given a Kernel, an edge condition, and a |
94 * RenderingHints object (which may be null). |
92 * RenderingHints object (which may be null). |
95 * @param kernel the specified <code>Kernel</code> |
93 * @param kernel the specified <code>Kernel</code> |