19std::string_view
hevc_codec::transfer_syntax_uid() const noexcept {
20 return main10_ ? kTransferSyntaxUIDMain10 : kTransferSyntaxUIDMain;
24 return main10_ ?
"HEVC/H.265 Main 10 Profile" :
"HEVC/H.265 Main Profile";
32 if (params.width == 0 || params.height == 0) {
36 if (params.samples_per_pixel != 1 && params.samples_per_pixel != 3) {
42 if (params.bits_stored < 1 || params.bits_stored > 10) {
47 if (params.bits_stored < 1 || params.bits_stored > 8) {
56 return can_encode(params);
70 [[maybe_unused]] std::span<const uint8_t> pixel_data,
75 "HEVC codec not available: HEVC library not found at build time. "
76 "Build with PACS_WITH_HEVC=ON to enable.");
80 [[maybe_unused]] std::span<const uint8_t> compressed_data,
84 "HEVC codec not available: HEVC library not found at build time. "
85 "Build with PACS_WITH_HEVC=ON to enable.");
HEVC/H.265 codec implementation for video-encoded multi-frame DICOM.
hevc_codec(bool main10=false, int quality=kDefaultQuality)
Constructs an HEVC codec instance.
bool is_lossy() const noexcept override
Checks if this codec produces lossy compression.
int quality() const noexcept
Gets the current quality setting (CRF).
std::string_view name() const noexcept override
Returns a human-readable name for the codec.
bool is_main10_profile() const noexcept
Checks if this codec is configured for Main 10 Profile.
bool can_decode(const image_params ¶ms) const noexcept override
Checks if this codec can decode data with given parameters.
bool can_encode(const image_params ¶ms) const noexcept override
Checks if this codec supports the given image parameters.
codec_result decode(std::span< const uint8_t > compressed_data, const image_params ¶ms) const override
Decompresses compressed pixel data.
codec_result encode(std::span< const uint8_t > pixel_data, const image_params ¶ms, const compression_options &options={}) const override
Compresses uncompressed pixel data.
constexpr int compression_error
constexpr int decompression_error
Result< T > pacs_error(int code, const std::string &message, const std::string &details="")
Create a PACS error result with module context.
Result<T> type aliases and helpers for PACS system.
Compression quality settings for lossy codecs.
Parameters describing image pixel data.