nw::Image

struct Image

Image Resource.

Read/Write Support:

  • jpg, png, dds, tga (thanks to stb_image and SOIL)

  • Bioware dds (thanks to NWNExplorer)

Note

Even though this supports writing images, this is catagorically not a tool for converting/compressing textures.

Public Functions

Image() = default
explicit Image(const Plt &plt, const PltColors &colors)
explicit Image(const std::filesystem::path &filename)
explicit Image(ResourceData data)
Image(Image &&other)
Image(const Image &other) = delete
Image &operator=(Image &&other)
Image &operator=(const Image &other) = delete
~Image()
uint32_t channels() const noexcept

Get BBP.

uint8_t *data() const noexcept

Get raw data.

uint32_t height() const noexcept

Get height.

bool is_bio_dds() const noexcept

Returns true if image was loaded from a bioware dds file.

uint8_t *release()

Releases the underlying array of bytes.

bool valid() const

Determine if successfully loaded.

uint32_t width() const noexcept

Get width.

bool write_to(const std::filesystem::path &filename) const

Write Image to file.