// Copyright (c) the JPEG XL Project Authors. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.
staticinlinebool JXL_MAYBE_UNUSED SafeAdd(const uint64_t a, const uint64_t b,
uint64_t& sum) {
sum = a + b; return sum >= a; // no need to check b - either sum >= both or < both.
}
template <typename T1, typename T2>
constexpr inline T1 DivCeil(T1 a, T2 b) { return (a + b - 1) / b;
}
// Works for any `align`; if a power of two, compiler emits ADD+AND.
constexpr inline size_t RoundUpTo(size_t what, size_t align) { return DivCeil(what, align) * align;
}
// Reasonable default for sRGB, matches common monitors. We map white to this // many nits (cd/m^2) by default. Butteraugli was tuned for 250 nits, which is // very close. // NB: This constant is not very "base", but it is shared between modules. static constexpr float kDefaultIntensityTarget = 255;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.