![]() |
SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
|
#include <PPL.h>
Classes | |
struct | Image |
Public Member Functions | |
PPL (uint32_t modelChecksum, ImageFormat format_=ImageFormat::RGB888, uint32_t version_=0) | |
PPL (std::span< const std::byte > pplData) | |
PPL (const std::string &pplPath) | |
operator bool () const | |
uint32_t | getVersion () const |
void | setVersion (uint32_t newVersion) |
uint32_t | getModelChecksum () const |
void | setModelChecksum (uint32_t newChecksum) |
ImageFormat | getFormat () const |
void | setFormat (ImageFormat newFormat) |
bool | hasImageForLOD (uint32_t lod) const |
std::vector< uint32_t > | getImageLODs () const |
const Image * | getImageRaw (uint32_t lod=0) const |
std::optional< Image > | getImageAs (ImageFormat newFormat, uint32_t lod=0) const |
std::optional< Image > | getImageAsRGB888 (uint32_t lod=0) const |
bool | setImage (std::span< const std::byte > imageData, ImageFormat format_, uint32_t width, uint32_t height, uint32_t lod=0) |
bool | setImage (std::span< const std::byte > imageData, ImageFormat format_, uint32_t width, uint32_t height, uint32_t resizedWidth, uint32_t resizedHeight, uint32_t lod=0, ImageConversion::ResizeFilter filter=ImageConversion::ResizeFilter::DEFAULT) |
bool | setImage (const std::string &imagePath, uint32_t lod=0) |
bool | setImage (const std::string &imagePath, uint32_t resizedWidth, uint32_t resizedHeight, uint32_t lod=0, ImageConversion::ResizeFilter filter=ImageConversion::ResizeFilter::DEFAULT) |
std::vector< std::byte > | saveImageToFile (uint32_t lod=0, ImageConversion::FileFormat fileFormat=ImageConversion::FileFormat::DEFAULT) const |
bool | saveImageToFile (const std::string &imagePath, uint32_t lod=0, ImageConversion::FileFormat fileFormat=ImageConversion::FileFormat::DEFAULT) const |
std::vector< std::byte > | bake () |
bool | bake (const std::string &pplPath) |
Protected Attributes | |
uint32_t | version {} |
uint32_t | checksum {} |
ImageFormat | format {} |
std::unordered_map< uint32_t, Image > | images |
|
explicit |
ImageFormat PPL::getFormat | ( | ) | const |
std::optional< PPL::Image > PPL::getImageAs | ( | ImageFormat | newFormat, |
uint32_t | lod = 0 |
||
) | const |
std::optional< PPL::Image > PPL::getImageAsRGB888 | ( | uint32_t | lod = 0 | ) | const |
const PPL::Image * PPL::getImageRaw | ( | uint32_t | lod = 0 | ) | const |
bool PPL::saveImageToFile | ( | const std::string & | imagePath, |
uint32_t | lod = 0 , |
||
ImageConversion::FileFormat | fileFormat = ImageConversion::FileFormat::DEFAULT |
||
) | const |
std::vector< std::byte > PPL::saveImageToFile | ( | uint32_t | lod = 0 , |
ImageConversion::FileFormat | fileFormat = ImageConversion::FileFormat::DEFAULT |
||
) | const |
void PPL::setFormat | ( | ImageFormat | newFormat | ) |
bool PPL::setImage | ( | const std::string & | imagePath, |
uint32_t | lod = 0 |
||
) |
bool PPL::setImage | ( | const std::string & | imagePath, |
uint32_t | resizedWidth, | ||
uint32_t | resizedHeight, | ||
uint32_t | lod = 0 , |
||
ImageConversion::ResizeFilter | filter = ImageConversion::ResizeFilter::DEFAULT |
||
) |
bool PPL::setImage | ( | std::span< const std::byte > | imageData, |
ImageFormat | format_, | ||
uint32_t | width, | ||
uint32_t | height, | ||
uint32_t | lod = 0 |
||
) |
bool PPL::setImage | ( | std::span< const std::byte > | imageData, |
ImageFormat | format_, | ||
uint32_t | width, | ||
uint32_t | height, | ||
uint32_t | resizedWidth, | ||
uint32_t | resizedHeight, | ||
uint32_t | lod = 0 , |
||
ImageConversion::ResizeFilter | filter = ImageConversion::ResizeFilter::DEFAULT |
||
) |
|
protected |
|
protected |