dplug.graphics.view

A View is the base abstraction for images. Port of ae.utils.graphics.

Members

Aliases

ViewColor
alias ViewColor(T) = typeof(T.init[0, 0])

Returns the color type of the specified view. By convention, colors are structs with numeric fields named after the channel they indicate.

Functions

blitTo
void blitTo(auto ref SRC src, auto ref DST dst)

Blits a view onto another. The views must have the same size.

blitTo
void blitTo(auto ref SRC src, auto ref DST dst, int x, int y)

Helper function to blit an image onto another at a specified location.

crop
auto crop(auto ref V src, int x0, int y0, int x1, int y1)

Crop a view to the specified rectangle.

onePixel
auto onePixel(COLOR c)

Return a 1x1 view of the specified color. Useful for testing.

size
void size(auto ref V src, int w, int h)

Default implementation for the .size method. Asserts that the view has the desired size.

solid
auto solid(COLOR c, int w, int h)

Returns a view of the specified dimensions and same solid color.

Mixin templates

DirectView
mixin template DirectView()

Mixin which implements view primitives on top of existing direct view primitives.

Warp
mixin template Warp(V)

Mixin which implements view primitives on top of another view, using a coordinate transform function.

Templates

procedural
template procedural(alias formula)

Returns a view which calculates pixels on-demand using the specified formula.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.