SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
DistanceMapping.h File Reference
#include <vector>
#include <sourcepp/Macros.h>
#include <vtfpp/ImageConversion.h>
Include dependency graph for DistanceMapping.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  vtfpp
namespace  vtfpp::DistanceMapping

Enumerations

enum class  vtfpp::DistanceMapping::Dither { vtfpp::DistanceMapping::NONE = 0 , vtfpp::DistanceMapping::GRADIENT_TANGENT }
enum class  vtfpp::DistanceMapping::Flags : uint32_t { vtfpp::DistanceMapping::NONE = 0 , vtfpp::DistanceMapping::DISTANCEAA = 1 << 0 , vtfpp::DistanceMapping::EUCLIDEAN = 1 << 1 , vtfpp::DistanceMapping::SAMPLECENTERED = 1 << 2 }

Functions

std::vector< std::byte > vtfpp::DistanceMapping::alphaToDistance (std::span< const std::byte > imageData, ImageFormat inFormat, ImageFormat outFormat, uint16_t width, uint16_t height, uint16_t reduceX, uint16_t reduceY, bool srgb, float distanceSpread=1.f, float alphaThreshold=0.04f, Flags flags=Flags::NONE, Dither dither=Dither::NONE, ImageConversion::ResizeFilter filter=ImageConversion::ResizeFilter::NICE, ImageConversion::ResizeEdge edge=ImageConversion::ResizeEdge::CLAMP, bool *valveQuirks=nullptr)
 In one operation, convert an image's alpha channel, or, for single-channel formats, its only channel, to a VTEX-style distance map, and downscale other channels, if present in the output, according to the given resize parameters.