Returns the color type of the specified view. By convention, colors are structs with numeric fields named after the channel they indicate.
Manually managed image.
Optionally, a view can also provide direct pixel access. We call these "direct views".
A view is any type which provides a width, height, and can be indexed to get the color at a specific coordinate.
Views can be read-only or writable.
Blits a view onto another. The views must have the same size.
Helper function to blit an image onto another at a specified location.
Convert and disown gamut Image to OwnedImage. Result: ìmage` is disowned, result is owning the image data.
Convert and disown gamut Image to OwnedImage. Result: ìmage` is disowned, result is owning the image data.
Copy a view's pixels (top-to-bottom) to a COLOR buffer.
Copy the indicated row of src to a COLOR buffer.
Make a gamut Image view from a dplug:graphics ImageRef. The original OwnedImage is still the owner of the pixel data.
Crop an ImageRef and get an ImageRef instead of a Voldemort type. This also avoid adding offset to coordinates.
On the contrary, get an ImageRef!XXX from a Gamut Image without disowning it.
Loads two different images: - the 1st is the RGB channels - the 2nd is interpreted as greyscale and fetch in the alpha channel of the result. The returned OwnedImage!RGBA should be destroyed with destroyFree.
Loads two different images: - the 1st is the RGB channels - the 2nd is interpreted as greyscale and fetch in the alpha channel of the result. The returned OwnedImage!RGBA should be destroyed with destroyFree.
Loads an image from compressed data. The returned OwnedImage!RGBA should be destroyed with destroyFree.
Loads an image to be a 16-bit one channel image (OwnedImage!L16). The returned OwnedImage!L16 should be destroyed with destroyFree.
Loads an image from compressed data and ensure the alpha is premultiplied. The returned OwnedImage!RGBA should be destroyed with destroyFree.
Default implementation for the .size method. Asserts that the view has the desired size.
Convert an OwnedImage to an ImageRef.
Mixin which implements view primitives on top of existing direct view primitives.
Mixin which implements view primitives on top of another view, using a coordinate transform function.
Represents a reference to COLOR data already existing elsewhere in memory. Assumes that pixels are stored row-by-row, with a known distance between each row.
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/.
Vladimir Panteleev <vladimir@thecybershadow.net> Guillaume Piolat <contact@auburnsounds.com>
In-memory images.