charls/unittest/scan_encoder_tester.h
Victor Derks e7b1e58ab5
Update coding style (.clang-format) to BreakAfterAttributes: Always ([[nodiscard]]) (#293)
Follow the common cross language pattern to apply function attributes before the function definition/implementation.
2023-12-25 12:08:21 +01:00

55 lines
1.1 KiB
C++

// Copyright (c) Team CharLS.
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include "../src/scan_encoder.h"
namespace charls::test {
class scan_encoder_tester final : scan_encoder
{
public:
explicit scan_encoder_tester(const charls::frame_info& frame_info, const coding_parameters& parameters) noexcept :
scan_encoder(frame_info, parameters)
{
}
void set_presets(const jpegls_pc_parameters&) noexcept(false) override
{
}
size_t encode_scan(const std::byte* /*source*/, size_t /*stride*/, span<std::byte>) noexcept(false) override
{
return 0;
}
void initialize_forward(const span<std::byte> destination) noexcept
{
initialize(destination);
}
void append_to_bit_stream_forward(const uint32_t bits, const int32_t bit_count)
{
append_to_bit_stream(bits, bit_count);
}
void flush_forward()
{
flush();
}
[[nodiscard]]
size_t get_length_forward() const noexcept
{
return get_length();
}
void end_scan_forward()
{
end_scan();
}
};
} // namespace charls::test