Texture
The Texture class stores the textures used for rendering, which are loaded from local images,and provides some methods for rotating this texture, and the ability of using caches to optimize the rendering performance. It uses TextureOp for rendering, you can implement your TextureOp, or just use the provided method to allocate the instances.
Provided TextureOp Methods
name | return type | instructions |
---|---|---|
rotate | RotateOp | Provides TextureOp can be used for rotating the texture around its center point. |
averageConvolve | ConvolveOp | Provides convolution filters that can remove the image noise of this texture. |
averageConvolve33 | Convolve33Op | Provides convolution filters that can remove the image noise of this texture, but with a 3 * 3 convolution kernel. |
gaussianBlurConvolve | ConvolveOp | Provides a convolution filter that can perform Gaussian blur processing on textures and with its convolution kernel follows a two-dimensional Gaussian distribution. |
gaussianBlurConvolve33 | Convolve33Op | Provides a convolution filter that can perform Gaussian blur processing on textures and with its convolution kernel which is in the size of 3 * 3, follows a two-dimensional Gaussian distribution. |
sharpenConvolve | ConvolveOp | Provides a convolution filter that can sharpen the texture. |
strokeConvolve | ConvolveOp | Provides a convolution filter that can stroke the texture. |
Also, this class uses some method in top.kkoishi.stg.util.Mth to calculate, which will cache the results to optimize the performance of math calculation. And you can use Texture.renderPoint methods to calculate the right coordinates for rendering which make sure that the center of the texture will be rendered at the given coordinates.
There is a subclass using VRAM for rendering, Texture.Volatile, and it has the better hardware acceleration possibilities.
Author
KKoishi_
Inheritors
Types
This class implements a convolution from the source texture to the destination texture. Convolution using a convolution kernel is a spatial operation that computes the output pixel from an input pixel by multiplying the kernel with the surround of the input pixel. This allows the output pixel to be affected by the immediate neighborhood in a way that can be mathematically specified with a kernel, and the kernel size is length * length by passing in a float array with the length of length ^ 2.
A texture class using VolatileImage.
Properties
Functions
Return an instance of TextureOp which implements a convolution from the source texture to the destination texture with the ability removing the image noise of this texture.
Return an instance of TextureOp which implements a convolution from the source texture to the destination texture with the ability removing the image noise of this texture., and the kernel is a 3 * 3 matrix.
Return an instance of TextureOp which implements a convolution from the source texture to the destination texture. Convolution using a convolution kernel is a spatial operation that computes the output pixel from an input pixel by multiplying the kernel with the surround of the input pixel. This allows the output pixel to be affected by the immediate neighborhood in a way that can be mathematically specified with a kernel, and the kernel size is 3 * 3 by passing in a float array with the length of 9.
Return an instance of TextureOp which implements a convolution from the source texture to the destination texture provided a Gaussian blur effect for textures, and its convolve kernel conforms to the Gaussian distribution with sum of 1, and the kernel is a 3 * 3 matrix, and the length should be odd.
Return an instance of TextureOp which implements a convolution from the source texture to the destination texture provided a Gaussian blur effect for textures, and its convolve kernel conforms to the Gaussian distribution with sum of 1, and the kernel is a 3 * 3 matrix.
Get the texture.
Returns a Texture operation without any change. The matrix is:
Renders a Texture that is filtered with a BufferedImageOp. The rendering attributes applied to include the Clip, Transform and Composite attributes.
Calculate and return the correct rendering coordinate, which can make the texture's center coincides with the given point specified by its coordinates.
Calculate and return the correct rendering coordinate, which can make center of the rotated texture, the rotate degree is specified in parameters, coincides with the given point specified by its coordinates.
Returns a TextureOp that can be used to rotate the texture.