Coverage Report

Created: 2025-06-13 06:37

/src/libjxl/lib/jxl/base/override.h
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) the JPEG XL Project Authors. All rights reserved.
2
//
3
// Use of this source code is governed by a BSD-style
4
// license that can be found in the LICENSE file.
5
6
#ifndef LIB_JXL_BASE_OVERRIDE_H_
7
#define LIB_JXL_BASE_OVERRIDE_H_
8
9
#include <cstdint>
10
11
// 'Trool' for command line arguments: force enable/disable, or use default.
12
13
namespace jxl {
14
15
// No effect if kDefault, otherwise forces a feature (typically a FrameHeader
16
// flag) on or off.
17
enum class Override : int8_t { kOn = 1, kOff = 0, kDefault = -1 };
18
19
0
static inline Override OverrideFromBool(bool flag) {
20
0
  return flag ? Override::kOn : Override::kOff;
21
0
}
Unexecuted instantiation: test_image.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: test_utils.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_frame.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_group.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_heuristics.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_modular.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_patch_dictionary.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_quant_weights.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: encode.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_jpeg_data.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_ac_strategy.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_adaptive_quantization.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_ans.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_cache.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_chroma_from_luma.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_debug_image.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_dot_dictionary.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_fast_lossless.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_lz77.cc:jxl::OverrideFromBool(bool)
Unexecuted instantiation: enc_detect_dots.cc:jxl::OverrideFromBool(bool)
22
23
1.87k
static inline bool ApplyOverride(Override o, bool default_condition) {
24
1.87k
  if (o == Override::kOn) return true;
25
1.87k
  if (o == Override::kOff) return false;
26
1.87k
  return default_condition;
27
1.87k
}
Unexecuted instantiation: test_image.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: test_utils.cc:jxl::ApplyOverride(jxl::Override, bool)
enc_frame.cc:jxl::ApplyOverride(jxl::Override, bool)
Line
Count
Source
23
1.07k
static inline bool ApplyOverride(Override o, bool default_condition) {
24
1.07k
  if (o == Override::kOn) return true;
25
1.07k
  if (o == Override::kOff) return false;
26
1.07k
  return default_condition;
27
1.07k
}
Unexecuted instantiation: enc_group.cc:jxl::ApplyOverride(jxl::Override, bool)
enc_heuristics.cc:jxl::ApplyOverride(jxl::Override, bool)
Line
Count
Source
23
268
static inline bool ApplyOverride(Override o, bool default_condition) {
24
268
  if (o == Override::kOn) return true;
25
268
  if (o == Override::kOff) return false;
26
268
  return default_condition;
27
268
}
Unexecuted instantiation: enc_modular.cc:jxl::ApplyOverride(jxl::Override, bool)
enc_patch_dictionary.cc:jxl::ApplyOverride(jxl::Override, bool)
Line
Count
Source
23
536
static inline bool ApplyOverride(Override o, bool default_condition) {
24
536
  if (o == Override::kOn) return true;
25
536
  if (o == Override::kOff) return false;
26
536
  return default_condition;
27
536
}
Unexecuted instantiation: enc_quant_weights.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: encode.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_jpeg_data.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_ac_strategy.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_adaptive_quantization.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_ans.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_cache.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_chroma_from_luma.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_debug_image.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_dot_dictionary.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_fast_lossless.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_lz77.cc:jxl::ApplyOverride(jxl::Override, bool)
Unexecuted instantiation: enc_detect_dots.cc:jxl::ApplyOverride(jxl::Override, bool)
28
29
}  // namespace jxl
30
31
#endif  // LIB_JXL_BASE_OVERRIDE_H_