ae.utils.graphics.image

In-memory images and various image formats.

Public Imports

ae.utils.graphics.view
public import ae.utils.graphics.view;
Undocumented in source.

Members

Aliases

ElementViewImage
alias ElementViewImage(R) = ViewImage!(ElementType!R)
Undocumented in source.
GetInputColor
alias GetInputColor(COLOR, INPUT) = Select!(is(COLOR == InputColor), INPUT, COLOR)
Undocumented in source.
ViewImage
alias ViewImage(V) = Image!(ViewColor!V)
Undocumented in source.

Enums

PNGColourType
enum PNGColourType
Undocumented in source.
PNGCompressionMethod
enum PNGCompressionMethod
Undocumented in source.
PNGFilterAdaptive
enum PNGFilterAdaptive
Undocumented in source.
PNGFilterMethod
enum PNGFilterMethod
Undocumented in source.
PNGInterlaceMethod
enum PNGInterlaceMethod
Undocumented in source.
bitmapNeedV4HeaderForRead
eponymoustemplate bitmapNeedV4HeaderForRead(COLOR)
Undocumented in source.
bitmapNeedV4HeaderForWrite
eponymoustemplate bitmapNeedV4HeaderForWrite(COLOR)
Undocumented in source.
isTargetColor
eponymoustemplate isTargetColor(C, TARGET)
Undocumented in source.

Functions

bitmapChannelMasks
uint[4] bitmapChannelMasks()
Undocumented in source. Be warned that the author may not have intended to support it.
copy
auto copy(SRC src, TARGET target)

Copy the given view into the specified target.

copy
auto copy(SRC src)

Copy the given view into a newly-allocated image.

copyPixels
void copyPixels(SRC src, StorageType[] dst)

Copy a view's pixels (top-to-bottom) to a StorageType buffer. Rows are assumed to be StorageType.sizeof-aligned.

copyScanline
void copyScanline(SRC src, xy_t y, StorageType[] dst)

Copy the indicated row of src to a StorageType buffer.

downscaleTo
auto downscaleTo(SRC src, TARGET target)

Downscaling copy (averages colors in source per one pixel in target).

downscaleTo
auto downscaleTo(SRC src, xy_t w, xy_t h)

Downscales an image to a certain size.

fromPixels
auto fromPixels(INPUT[] input, uint w, uint h, TARGET target)
auto fromPixels(INPUT[] input, uint w, uint h)

Loads a raw COLOR[] into an image of the indicated size.

hjoin
auto hjoin(R images, TARGET target)
auto hjoin(R images)

Splice multiple images horizontally.

makePNG
ubyte[] makePNG(PNGChunk[] chunks)
Undocumented in source. Be warned that the author may not have intended to support it.
parseBMP
auto parseBMP(const(void)[] data, TARGET target)
auto parseBMP(const(void)[] data)

Parses a Windows bitmap (.bmp) file.

parsePBM
auto parsePBM(const(void)[] vdata, TARGET target)
auto parsePBM(const(void)[] vdata)

Parses a binary Netpbm monochrome (.pgm) or RGB (.ppm) file.

toBMP
ubyte[] toBMP(SRC src)

Creates a Windows bitmap (.bmp) file.

toPBM
ubyte[] toPBM(SRC src)

Creates a binary Netpbm monochrome (.pgm) or RGB (.ppm) file.

toPNG
ubyte[] toPNG(SRC src, int compressionLevel)

Creates a PNG file. Only basic PNG features are supported (no filters, interlacing, palettes etc.)

toRef
ImageRef!(ViewColor!SRC) toRef(SRC src)

Convert a direct view to an ImageRef. Assumes that the rows are evenly spaced.

viewBMP
auto viewBMP(V data)

Returns a view representing a BMP file. Does not copy pixel data.

vjoin
auto vjoin(R images, TARGET target)
auto vjoin(R images)

Splice multiple images vertically.

Properties

bitmapPixelStride
size_t bitmapPixelStride [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

pngSignature
ubyte[8] pngSignature;
Undocumented in source.

Structs

Image
struct Image(COLOR, StorageType = PlainStorageUnit!COLOR)

An in-memory image. Pixels are stored in a flat array.

ImageRef
struct ImageRef(COLOR, StorageType = PlainStorageUnit!COLOR)

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.

InputColor
struct InputColor
Undocumented in source.
PNGChunk
struct PNGChunk
Undocumented in source.
PNGChunkFooter
struct PNGChunkFooter
Undocumented in source.
PNGChunkHeader
struct PNGChunkHeader
Undocumented in source.
PNGHeader
struct PNGHeader
Undocumented in source.
TargetColor
struct TargetColor
Undocumented in source.

Templates

BMPStorageType
template BMPStorageType(COLOR)
Undocumented in source.
downscale
template downscale(int HRX, int HRY = HRX)

Performs linear downscale by a constant factor

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/.

Authors

Vladimir Panteleev <vladimir@thecybershadow.net>