Appease the automatons

This commit is contained in:
David Thomas 2025-06-24 17:43:35 +01:00
parent f5ecead66f
commit bd2ae1eb61
No known key found for this signature in database
GPG Key ID: 553E822E460EE293
3 changed files with 4 additions and 3 deletions

View File

@ -42,7 +42,7 @@ std::string DitheringAlgorithmToString(DitheringAlgorithm algo)
return (it != names.end()) ? it->second : "unknown";
}
const DitheringAlgorithm DitheringAlgorithmFromString(const std::string name)
DitheringAlgorithm DitheringAlgorithmFromString(const std::string& name)
{
auto it = std::find_if(names.begin(), names.end(), [name](const auto& pair) {
return base::utf8_icmp(pair.second, name) == 0;

View File

@ -29,7 +29,7 @@ enum class DitheringAlgorithm {
bool DitheringAlgorithmIsDiffusion(DitheringAlgorithm algo);
std::string DitheringAlgorithmToString(DitheringAlgorithm algo);
const DitheringAlgorithm DitheringAlgorithmFromString(const std::string name);
DitheringAlgorithm DitheringAlgorithmFromString(const std::string& name);
} // namespace render

View File

@ -219,7 +219,8 @@ doc::color_t ErrorDiffusionDither::ditherRgbToIndex2D(const int x,
const int bufferRowIndex = bufferRow * m_width;
for (int mx = 0; mx < matrix.width; ++mx) {
const int coeff = direction > 0 ? matrix.coefficients[my][mx] : matrix.coefficients[my][matrix.width - 1 - mx];
const int coeff = direction > 0 ? matrix.coefficients[my][mx] :
matrix.coefficients[my][matrix.width - 1 - mx];
if (coeff == 0)
continue;