imagefmt 1.0.1

Image loading/saving. @nogc


To use this package, run the following command in your project's root directory:

imagefmt

Image loader and saver for simple needs with support for custom IO and allocators. Independent of the garbage collector.

This will be @nogc when etc.c.zlib gets it.

Decoders:

  • PNG, 8-bit and 16-bit interlaced and paletted (+tRNS chunk)
  • BMP, 8-bit
  • TGA, 8-bit non-paletted
  • JPEG, baseline

Encoders:

  • PNG, 8-bit non-paletted non-interlaced
  • BMP, 8-bit RGB RGBA
  • TGA, 8-bit

Returned buffers are 8-bit by default, 16-bit being another option and 8/16-bit based on source data another.

import imagefmt;

IFImage a = read_image("broke.jpg", 3);     // convert to rgb
if (a.e) {
    printf("*** load error: %s\n", IF_ERROR[a.e].ptr);
    return;
}
scope(exit) a.free();

IFInfo info = read_info("fsoc.tga");
printf("size: %d x %d   components: %d\n", info.w, info.h, info.c);

Tipjar: nano_1xeof5x1ukki4awa7fp9gyb3qsymmrr4s3i8o63okzdq3bhsdj56nefm9shs

Authors:
  • Tero Hänninen
Dependencies:
none
Versions:
2.0.3 2020-Jan-14
2.0.2 2019-Jul-12
2.0.1 2019-Jul-07
2.0.0 2019-Jul-06
1.0.1 2019-Jun-17
Show all 7 versions
Download Stats:
  • 0 downloads today

  • 1 downloads this week

  • 5 downloads this month

  • 23 downloads total

Score:
0.5
Short URL:
imagefmt.dub.pm