DEKI/ENGINE docs
manual api reference
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
Loading...
Searching...
No Matches
TextureSettings.h File Reference

Classes

struct  DekiEditor::TextureSettings
 An image's storage and filter settings, with per-target overrides. More...
struct  DekiEditor::TextureTargetSettings
 One target's own values. More...

Namespaces

namespace  DekiEditor

Functions

void DekiEditor::MaxSizeDims (int srcW, int srcH, int maxSize, int &outW, int &outH)
 The size an image of srcW x srcH is stored at under maxSize (0 = no limit): unchanged when it fits, else its larger side becomes maxSize and the other keeps the proportion (at least 1).
TextureSettings DekiEditor::ReadImageTextureSettings (const std::string &imagePath)
 The texture settings of the image at imagePath (absolute), from its sidecar (<image>.data, settings.texture); defaults when it has none.
TextureSettings DekiEditor::ReadTextureSettings (const nlohmann::json &tex)
 Reads settings.texture. Pass the object itself; a missing one gives defaults.
Deki::TextureFilter DekiEditor::ResolveTextureFilter (const TextureSettings &settings, const std::string &platformId)
 The filter an image is drawn with on platformId: FilterFor's, or Point where the target has no GPU (TargetSamplesTextures), and for a name that is not a filter.
void DekiEditor::SetTextureFilteringCapabilities (std::set< std::string > capabilities)
 The capabilities with which the project's packages draw textures filtered (CMakeGen::TextureFilteringCapabilities of its packages).
int DekiEditor::SourceToStored (int v, int sourceSize, int storedSize)
 A source-pixel coordinate on one axis (a rect edge, not a size) in stored pixels: round(v * stored / source).
bool DekiEditor::TargetSamplesTextures (const std::string &platformId)
 Whether platformId draws textures filtered, so a texture's filter means something there: a platform that provides a capability some package filters with (deki-rendering's "opengl"), or "" (the editor's own desktop).
void DekiEditor::WriteTextureTarget (nlohmann::json &tex, const std::string &platformId, const TextureTargetSettings &t)
 Writes one target's values into settings.texture, always in the object form.

Variables

constexpr int DekiEditor::kTextureMaxSizeCount = sizeof(kTextureMaxSizes) / sizeof(kTextureMaxSizes[0])
constexpr int DekiEditor::kTextureMaxSizes [] = { 0, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192 }
 The Max Size choices, as Unity offers them. 0 means no limit.