MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / filterProcessing

Method filterProcessing

source/game/StarImageMetadataDatabase.cpp:135–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135AssetPath ImageMetadataDatabase::filterProcessing(AssetPath const& path) {
136 AssetPath newPath = { path.basePath, path.subPath, {} };
137
138 String filtered;
139 for (auto& directives : path.directives.list())
140 directives.loadOperations();
141 path.directives.forEach([&](auto const& entry, Directives const& directives) {
142 ImageOperation const& operation = entry.operation;
143 if (!(operation.is<HueShiftImageOperation>() ||
144 operation.is<SaturationShiftImageOperation>() ||
145 operation.is<BrightnessMultiplyImageOperation>() ||
146 operation.is<FadeToColorImageOperation>() ||
147 operation.is<ScanLinesImageOperation>() ||
148 operation.is<SetColorImageOperation>())) {
149 filtered += "?";
150 filtered += entry.string(*directives);
151 }
152 });
153
154 newPath.directives = std::move(filtered);
155 return newPath;
156}
157
158Vec2U ImageMetadataDatabase::calculateImageSize(AssetPath const& path) const {
159 // Carefully calculate an image's size while trying not to actually load it.

Callers

nothing calls this directly

Calls 4

listMethod · 0.80
loadOperationsMethod · 0.80
forEachMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected