![]() |
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::filesystem::path &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, float quality=ImageConversion::DEFAULT_COMPRESSED_QUALITY) |
| 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, float quality=ImageConversion::DEFAULT_COMPRESSED_QUALITY) |
| 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, bool premultipliedAlpha=false, ImageConversion::ResizeFilter filter=ImageConversion::ResizeFilter::DEFAULT, float quality=ImageConversion::DEFAULT_COMPRESSED_QUALITY) |
| bool | setImage (const std::filesystem::path &imagePath, uint32_t lod=0, float quality=ImageConversion::DEFAULT_COMPRESSED_QUALITY) |
| bool | setImage (const std::filesystem::path &imagePath, uint32_t resizedWidth, uint32_t resizedHeight, uint32_t lod=0, bool premultipliedAlpha=false, ImageConversion::ResizeFilter filter=ImageConversion::ResizeFilter::DEFAULT, float quality=ImageConversion::DEFAULT_COMPRESSED_QUALITY) |
| bool | removeImage (uint32_t lod) |
| std::vector< std::byte > | saveImageToFile (uint32_t lod=0, ImageConversion::FileFormat fileFormat=ImageConversion::FileFormat::DEFAULT) const |
| bool | saveImageToFile (const std::filesystem::path &imagePath, uint32_t lod=0, ImageConversion::FileFormat fileFormat=ImageConversion::FileFormat::DEFAULT) const |
| std::vector< std::byte > | bake () |
| bool | bake (const std::filesystem::path &pplPath) |
Protected Attributes | |
| uint32_t | version {} |
| uint32_t | checksum {} |
| ImageFormat | format {} |
| std::unordered_map< uint32_t, Image > | images |
|
explicit |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
| bool PPL::saveImageToFile | ( | const std::filesystem::path & | imagePath, |
| uint32_t | lod = 0, | ||
| ImageConversion::FileFormat | fileFormat = ImageConversion::FileFormat::DEFAULT ) const |
|
nodiscard |
| void PPL::setFormat | ( | ImageFormat | newFormat, |
| float | quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY ) |
| bool PPL::setImage | ( | const std::filesystem::path & | imagePath, |
| uint32_t | lod = 0, | ||
| float | quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY ) |
| bool PPL::setImage | ( | const std::filesystem::path & | imagePath, |
| uint32_t | resizedWidth, | ||
| uint32_t | resizedHeight, | ||
| uint32_t | lod = 0, | ||
| bool | premultipliedAlpha = false, | ||
| ImageConversion::ResizeFilter | filter = ImageConversion::ResizeFilter::DEFAULT, | ||
| float | quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY ) |
| bool PPL::setImage | ( | std::span< const std::byte > | imageData, |
| ImageFormat | format_, | ||
| uint32_t | width, | ||
| uint32_t | height, | ||
| uint32_t | lod = 0, | ||
| float | quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY ) |
| 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, | ||
| bool | premultipliedAlpha = false, | ||
| ImageConversion::ResizeFilter | filter = ImageConversion::ResizeFilter::DEFAULT, | ||
| float | quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY ) |
|
protected |
|
protected |