arsd.image

This file imports all available image decoders in the arsd library, and provides convenient functions to load image regardless of it's format. Main functions: loadImageFromFile and loadImageFromMemory.

More...

Public Imports

arsd.color
public import arsd.color;
arsd.png
public import arsd.png;
arsd.jpeg
public import arsd.jpeg;
arsd.bmp
public import arsd.bmp;
arsd.targa
public import arsd.targa;
arsd.pcx
public import arsd.pcx;
arsd.dds
public import arsd.dds;
arsd.svg
public import arsd.svg;
arsd.imageresize
public import arsd.imageresize;

Members

Enums

ImageFileFormat
enum ImageFileFormat

Image formats arsd.image can load (except Unknown, of course).

Functions

guessImageFormatFromExtension
ImageFileFormat guessImageFormatFromExtension(const(char)[] filename)

Try to guess image format from file extension.

guessImageFormatFromMemory
ImageFileFormat guessImageFormatFromMemory(const(void)[] membuf)

Try to guess image format by first data bytes.

loadImageFromFile
MemoryImage loadImageFromFile(T filename)

Try to guess image format from file name and load that image.

loadImageFromMemory
MemoryImage loadImageFromMemory(const(void)[] membuf)

Try to guess image format from data and load that image.

Detailed Description

This module is exempt from my usual build-compatibility guarantees. I may add new built-time dependency modules to it at any time without notice.

You should either copy the image.d module and the pieces you use to your own project, or always use it along with the rest of the repo and dmd -i, or the dub arsd-official:image_files subpackage, which both will include new files automatically and avoid breaking your build.

Meta

History

The image resize code used to live directly in here, but has now moved to a new module, arsd.imageresize. It is public imported here for compatibility, but the build has changed as of December 25, 2020.

Suggestion Box / Bug Report