diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2021-02-19 17:10:51 -0500 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2021-02-24 16:46:47 -0500 |
commit | 02ca32ae0a5bc290918d2b2a3288e385b9cc6b11 (patch) | |
tree | 06379785e8a0165a7deb981c2eba362894820634 /src/ext_depends/imageformats/README.md | |
parent | build from static source-tree pre fetch depends (diff) |
external & build dependences in src tree
- external & build dependences boost licensed
- ext_depends (external depends)
- D-YAML
- tinyendian
- d2sqlite3
- imageformats
- build_depends
- dub2nix
Diffstat (limited to 'src/ext_depends/imageformats/README.md')
-rw-r--r-- | src/ext_depends/imageformats/README.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ext_depends/imageformats/README.md b/src/ext_depends/imageformats/README.md new file mode 100644 index 0000000..c9c0b36 --- /dev/null +++ b/src/ext_depends/imageformats/README.md @@ -0,0 +1,37 @@ +# imageformats [![Build Status](https://travis-ci.org/lgvz/imageformats.svg)](https://travis-ci.org/lgvz/imageformats) + +- Returned image data is 8-bit except PNG can also return 16-bit. +- Image data can be converted to Y, YA, RGB or RGBA. +- There's a `@nogc` remake: [imagefmt](https://github.com/tjhann/imagefmt) + +**Decoders:** +- PNG. 8-bit and 16-bit interlaced and paletted (+`tRNS` chunk) +- TGA. 8-bit non-paletted +- BMP. 8-bit uncompressed +- JPEG. baseline + +**Encoders:** +- PNG. 8-bit non-paletted non-interlaced +- TGA. 8-bit non-paletted rle-compressed +- BMP. 8-bit uncompressed + +```D +import imageformats; + +void main() { + IFImage i0 = read_image("peruna.png"); + IFImage i1 = read_image("peruna.png", ColFmt.YA); // convert + IFImage i2 = read_image("peruna.png", ColFmt.RGB); + + write_image("peruna.tga", i0.w, i0.h, i0.pixels); + write_image("peruna.tga", i0.w, i0.h, i0.pixels, ColFmt.RGBA); + + int w, h, chans; + read_image_info("peruna.png", w, h, chans); + + // format specific functions + PNG_Header hdr = read_png_header("peruna.png"); + IFImage i3 = read_jpeg("porkkana.jpg"); + write_tga("porkkana.tga", i3.w, i3.h, i3.pixels); +} +``` |