tida.image

A module for manipulating pictures, processing and transforming them.

Using the library, you can load images directly from files with a certain limitation in types (see imagefmt). Also, the image can be manipulated: blur, , .

Blur can be applied simply by calling the function with the picture as an argument. At the exit, it will render the image with blur. Example:

Image image = new Image().load("test.png");
image = image.blur!WithParallel(4);
// `WithParallel` means that parallel computation is used
// (more precisely, application, the generation of a Gaussian kernel
// will be without it).

Also, you can set a custom kernel to use, let's say:

// Generating a gaussian kernel. In fact, you can make your own kernel.
auto kernel = gausKernel(4, 4, 4);

image = image.blur!WithParallel(kernel);

Members

Classes

Image
class Image

Image description structure. (Colors are in RGBA format.)

Functions

blur
Image blur(Image image, int width, int height, float r)

Apolies blur.

blur
Image blur(Image image, float[][] otherKernel)

Applies blur.

blur
Image blur(Image image, float r)

Applies blur.

flip
Image flip(Image img)

Reverses the picture along the specified axis.

gausKernel
float[][] gausKernel(int width, int height, float sigma)

Generates a gauss matrix.

gausKernel
float[][] gausKernel(float r)

Generates a gauss matrix.

process
Image process(Image image, void delegate(ref Color!ubyte, const Vecf) @(safe) func)

Image processing process. The function traverses the picture, giving the input delegate a pointer to the color and traversal position in the form of a vector.

rotateImage
Image rotateImage(Image image, float angle, Vecf center)

Rotate the picture by the specified angle from the specified center.

saveImageInFile
void saveImageInFile(Image image, string path)

Save image in file.

strip
Image[] strip(Image image, int x, int y, int w, int h)

Divides the picture into frames.

unite
Image unite(Image a, Image b, Vecf posA, Vecf posB)

Combining two paintings into one using color mixing.

validateImageData
bool validateImageData(ubyte[] data, uint w, uint h)

Checks if the data for the image is valid.

Manifest constants

XAxis
enum XAxis;

X-Axis operation.

YAxis
enum YAxis;

Y-Axis operation.

Templates

isValidAxis
template isValidAxis(int axistype)

Checks the axis for correctness.

Meta

Authors

License