11#ifndef PACS_ENCODING_COMPRESSION_HTJ2K_CODEC_HPP
12#define PACS_ENCODING_COMPRESSION_HTJ2K_CODEC_HPP
51 "1.2.840.10008.1.2.4.201";
55 "1.2.840.10008.1.2.4.202";
59 "1.2.840.10008.1.2.4.203";
80 bool use_rpcl =
false,
96 [[nodiscard]] std::string_view
name() const noexcept override;
97 [[nodiscard]]
bool is_lossy() const noexcept override;
147 std::span<const uint8_t> pixel_data,
162 std::span<const uint8_t> compressed_data,
Abstract base class for image compression codecs.
High-Throughput JPEG 2000 (HTJ2K) codec implementation.
static constexpr int kDefaultResolutionLevels
Default number of resolution levels.
htj2k_codec & operator=(const htj2k_codec &)=delete
float compression_ratio() const noexcept
Gets the current compression ratio setting.
bool can_decode(const image_params ¶ms) const noexcept override
Checks if this codec can decode data with given parameters.
bool is_rpcl_mode() const noexcept
Checks if RPCL progression order is enabled.
static constexpr std::string_view kTransferSyntaxUIDLossy
DICOM Transfer Syntax UID for HTJ2K (Lossy)
bool can_encode(const image_params ¶ms) const noexcept override
Checks if this codec supports the given image parameters.
bool is_lossless_mode() const noexcept
Checks if this codec is configured for lossless mode.
std::string_view name() const noexcept override
Returns a human-readable name for the codec.
static constexpr std::string_view kTransferSyntaxUIDLossless
DICOM Transfer Syntax UID for HTJ2K Lossless Only.
htj2k_codec(htj2k_codec &&) noexcept
std::string_view transfer_syntax_uid() const noexcept override
Returns the Transfer Syntax UID supported by this codec.
codec_result encode(std::span< const uint8_t > pixel_data, const image_params ¶ms, const compression_options &options={}) const override
Compresses pixel data to HTJ2K format.
htj2k_codec(bool lossless=true, bool use_rpcl=false, float compression_ratio=kDefaultCompressionRatio, int resolution_levels=kDefaultResolutionLevels)
Constructs an HTJ2K codec instance.
int resolution_levels() const noexcept
Gets the number of DWT resolution levels.
htj2k_codec(const htj2k_codec &)=delete
static constexpr std::string_view kTransferSyntaxUIDRPCL
DICOM Transfer Syntax UID for HTJ2K with RPCL Options (Lossless Only)
bool is_lossy() const noexcept override
Checks if this codec produces lossy compression.
static constexpr float kDefaultCompressionRatio
Default compression ratio for lossy mode (20:1)
codec_result decode(std::span< const uint8_t > compressed_data, const image_params ¶ms) const override
Decompresses HTJ2K data.
Compression quality settings for lossy codecs.
Parameters describing image pixel data.