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

Aliases

flip
alias flip = flipImpl
Undocumented in source.
flipX
alias flipX = flipImpl!XAxis
Undocumented in source.
flipY
alias flipY = flipImpl!YAxis
Undocumented in source.

Classes

Image
class Image

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

Functions

blur
Image blur(Image image, float r)

Applies blur.

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

Apolies blur.

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

Applies blur.

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

Generates a gauss matrix.

gausKernel
float[][] gausKernel(float r)

Generates a gauss matrix.

imageFrom
Image imageFrom(Range range, uint width, uint height)

Converts a sequence of colors to a picture from the input range.

reversed
auto reversed(Range range)
Undocumented in source. Be warned that the author may not have intended to support it.
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

flipImpl
template flipImpl(int axis)

Reverses the picture along the specified axis.

isValidAxis
template isValidAxis(int axistype)

Checks the axis for correctness.

process
template process(alias fun)
Undocumented in source.

Variables

alpha
auto alpha;
Undocumented in source.

Meta