📄 magickimage.java
字号:
/** * Layers a texture onto the background of an image. * @param image the image to use for texture * @exception MagickException on error */ public native void textureImage(MagickImage image) throws MagickException; /** * Thresholds the reference image. * @param threshold the threshold value * @return a boolean value indicating success * @exception MagickException on error */ public native boolean thresholdImage(double threshold) throws MagickException; /** * Creates a new image that is a transformed size of of * existing one as specified by the crop and image geometries. * * If a crop geometry is specified a subregion of the image is * obtained. If the specified image size, as defined by the image * and scale geometries, is smaller than the actual image size, the * image is first minified to an integral of the specified image * size with an antialias digital filter. The image is then scaled to * the exact specified image size with pixel replication. If the * specified image size is greater than the actual image size, the * image is first enlarged to an integral of the specified image size * with bilinear interpolation. The image is then scaled to the exact * specified image size with pixel replication. * * @param cropGeometry a crop geometry string. This geometry \ defines a subregion of the image. * @param imageGeometry a image geometry string. The specified \ width and height of this geometry string are absolute. * @exception MagickException on error */ public native void transformImage(String cropGeometry, String imageGeometry) throws MagickException; /** * Converts the reference image from an alternate colorspace. * The transformation matrices are not the standard ones: * the weights are rescaled to normalized the range of the * transformed values to be [0..MaxRGB]. * * @param colorspace An unsigned integer value defines which \ colorspace to transform the image to * @return a boolean value indicating success * @exception MagickException on error */ public native boolean transformRgbImage(int colorspace) throws MagickException; /** * Creates a matte image associated with the image. * @param color The color to search for in the image * @param opacity The opacity of the transparent image * @return a boolean value indicating success * @exception MagickException on error */ public native boolean transparentImage(PixelPacket color, int opacity) throws MagickException; /** * Creates a new image that is a copy of an existing one with * the pixels sharpened using an "unsharp" masking technique. *<p> * This process starts by building a temporary, {@link * #gaussianBlurImage blurred}, copy of the image. Then each * pixel in this "unsharp" image is compared * against its corresponding pixel in the original image. If * their difference is above a threshold, a percentage of the * difference is added back into the original pixel. *<p> * The first two arguments, <tt>radius</tt> and <tt>sigma</tt>, * specify the blurring used to create the "unsharp" image. See * {@link #gaussianBlurImage} for a detail explanation. It will * suffice to say that the larger the radius and sigma the more * this blurred image will diverge from the original. *<p> * The last two arguments, <tt>threshold</tt> and <tt>amount</tt>, * specify the difference threshold required to apply an adjustment * to each pixel and, once the threshold is reached, the amount of * the difference to be added back into the original pixels. A high * threshold will cause the algorithm to only adjust edge pixels. * Specifying a threshold will adjust every pixel. * * @param raduis The radius of the gaussian, in pixels, not counting the center pixel * @param sigma The standard deviation of the gaussian, in pixels * @param amount The percentage of the difference between the original * and the blur image that is added back into the original. * @param threshold The threshold in pixels needed to apply the diffence * amount. * * @return A sharpened image. * * @exception MagickException on error */ public native MagickImage unsharpMaskImage(double raduis, double sigma, double amount, double threshold) throws MagickException; /** * Creates a "ripple" effect in the image by shifting the pixels * vertically along a sine wave whose amplitude and wavelength is * specified by the given parameters. * * @param amplitude Define the amplitude of the sine wave. * @param wavelength Define the wave-length of the sine wave. * * @return A new, "waved", image. * @exception MagickException on error */ public native MagickImage waveImage(double amplitude, double wavelength) throws MagickException; /** * Creates a new image that is a scaled size of an existing one. * @return the zoomed image * @exception MagickException on error */ public native MagickImage zoomImage(int cols, int rows) throws MagickException; /** * Get the pixels as 8-bit components from the image. * * @param x x coordinate of the origin of the subimage * @param y y coordinate of the origin of the subimage * @param width width of the subimage * @param height height of the subimage * @param map component order of the pixels * @param pixels pixels of the subimage * @return a boolean value indicating success * @exception MagickException on error */ public native boolean dispatchImage(int x, int y, int width, int height, String map, byte[] pixels) throws MagickException; /** * Get the pixels as 32-bit components from the image. * * @param x x coordinate of the origin of the subimage * @param y y coordinate of the origin of the subimage * @param width width of the subimage * @param height height of the subimage * @param map component order of the pixels * @param pixels pixels of the subimage * @return a boolean value indicating success * @exception MagickException on error */ public native boolean dispatchImage(int x, int y, int width, int height, String map, int[] pixels) throws MagickException; /** * Get the pixels as float components from the image. * * @param x x coordinate of the origin of the subimage * @param y y coordinate of the origin of the subimage * @param width width of the subimage * @param height height of the subimage * @param map component order of the pixels * @param pixels pixels of the subimage * @return a boolean value indicating success * @exception MagickException on error */ public native boolean dispatchImage(int x, int y, int width, int height, String map, float[] pixels) throws MagickException; /** * Return the image format (i.e., Gif, Jpeg,...) * * @return the string representing the image format * @exception MagickException on error * @author Abdulbaset Gaddah <agaddah@yahoo.com> */ public native String getMagick() throws MagickException; public String getImageFormat() throws MagickException { return getMagick(); } /* * Set the image format (i.e., Gif, Jpeg,...). * * @param imageFormat new image format * @exception MagickException on error * @author Abdulbaset Gaddah <agaddah@yahoo.com> */ public native void setMagick(String imageFormat) throws MagickException; public void setImageFormat(String imageFormat) throws MagickException { setMagick(imageFormat); } /** * Return the number of unique colors in an image. * @return the number of unique colors * @exception MagickException on error * @author Abdulbaset Gaddah <agaddah@yahoo.com> */ public native int getNumberColors() throws MagickException; /* * Set the number of unigue colors in an image. * * @param numberColors new number of unigue colors in an image * @exception MagickException on error * @author Abdulbaset Gaddah <agaddah@yahoo.com> */ public native void setNumberColors(int numberColors) throws MagickException; /** * Returns True if the Gif image is Animated otherwise False is returned. * * @return a boolean value representing the animated status of the image * @exception MagickException on error * @author Abdulbaset Gaddah <agaddah@yahoo.com> */ public native boolean isAnimatedImage() throws MagickException; /** * Creates a new image that is a rotated copy of an existing one. * Positive angles rotate counter-clockwise (right-hand rule), while * negative angles rotate clockwise. Rotated images are usually larger * than the originals and have 'empty' triangular corners. X axis. * Empty triangles left over from shearing the image are filled with * the color defined by the pixel at location (0,0). * * @param angle of rotation. * @return A image that is a rotation of self * @exception MagickException on error */ public native MagickImage rotateImage(double degrees) throws MagickException; /** * Creates a new image that is a shear_image copy of an existing one. * Shearing slides one edge of an image along the X or Y axis, creating * a parallelogram. An X direction shear slides an edge along the X axis, * while a Y direction shear slides an edge along the Y axis. The amount * of the shear is controlled by a shear angle. For X direction shears, * x_shear is measured relative to the Y axis, and similarly, for Y * direction shears y_shear is measured relative to the X axis. Empty * triangles left over from shearing the image are filled with the color * defined by the pixel at location (0,0). * * @param x_shear x direction shear amount * @param y_shear y direction shear amount * @return a sheared image constructor from self. * @exception MagickException on error */ public native MagickImage shearImage(double x_shear, double y_shear) throws MagickException; /** * Analyzes the colors within a reference image and chooses a * fixed number of colors to represent the image. The goal of * the algorithm is to minimize the difference between the input * and output image while minimizing the processing time. * * @param quantizeInfo contains parameters for quantization * @return a boolean value indicating success of the process * @exception MagickException on error */ public native boolean quantizeImage(QuantizeInfo quantizeInfo) throws MagickException; /** * Convert any colored image to grayscale. * * @deprecated Use QuantizeInfo with MagickImage.quantizeImage * to acheive the same effect. * @exception MagickException on error */ public void setGrayscale() throws MagickException { QuantizeInfo quantizeInfo = new QuantizeInfo(); quantizeInfo.setColorspace(ColorspaceType.GRAYColorspace); quantizeInfo.setNumberColors(256); quantizeInfo.setTreeDepth(8); quantizeImage(quantizeInfo); } /** * Get the colorspace of the image. * * @return the colorspace as defined in ColorspaceType * @exception MagickException on error */ public native int getColorspace() throws MagickException; /** * Creates a new image that is a copy of an existing one with the * pixels sharpened. * * @param raduis The radius of the gaussian, in pixels, not counting \ the center pixel * @param sigma The standard deviation of the gaussian, in pixels * * @return a sharpened image. * @exception MagickException on error */ public native MagickImage sharpenImage(double raduis, double sigma) throws MagickException; /** * Creates a new image that is a copy of an existing one with the * speckle noise minified. It uses the eight hull algorithm described * in Applied Optics, Vol. 24, No. 10, 15 May 1985, ``Geometric filter * for Speckle Reduction'', by Thomas R Crimmins. Each pixel in the * image is replaced by one of its eight of its surrounding pixels * using a polarity and negative hull function. * * @return a despeckled image * @exception MagickException on error */ public native MagickImage despeckleImage() throws MagickException; /** * Applies a general image convolution kernel to an image returns * the results. ConvolveImage allocates the memory necessary for * the new Image structure and returns a pointer to the new image. * * @param order The number of columns and rows in the filter kernel. * @param kernel An array of double representing the convolution kernel * * @return a convoled image * @exception MagickException on error */ public native MagickImage convolveImage(int order, double[] kernel) throws MagickException; /** * Searches the list of image attributes and returns * the value of the attribute if it exists otherwise null. * * @param key the key of the attribute * @return the value of the attribute if exists, otherwise, null. * @exception MagickException on error */ public native String getImageAttribute(String key) throws MagickException; /** * Searches the list of image attributes and replaces the * attribute value. If it is not found in the list, the attribute name * and value is added to the list. SetImageAttribute returns True if the * attribute is successfully replaced or added to the list, otherwise * False. If the value is null, the matching key is deleted from the list. * * @param key the key of the attribute * @param value the value of the attribute * @return true if the attribute is replace or false if added * @exception MagickException on error */ public native boolean setImageAttribute(String key, String value) throws MagickException; /** * Takes from memory an image in a known format and read it into * itself. * * @param imageInfo a ImageInfo instance * @param blob memory containing an image in a known format * @exception MagickException on error */ public native void blobToImage(ImageInfo imageInfo, byte[] blob) throws MagickException; /** * Returns an array that contents the image format. * * @param imageInfo the magick member of this object determines * output format * @return a byte array containing the image in the specified format * @exception MagickException on error */ public native byte[] imageToBlob(ImageInfo imageInfo); /**
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -