11#ifndef PACS_ENCODING_COMPRESSION_JPEG2000_CODEC_HPP
12#define PACS_ENCODING_COMPRESSION_JPEG2000_CODEC_HPP
55 "1.2.840.10008.1.2.4.90";
59 "1.2.840.10008.1.2.4.91";
94 [[nodiscard]] std::string_view
name() const noexcept override;
95 [[nodiscard]]
bool is_lossy() const noexcept override;
146 std::span<const uint8_t> pixel_data,
162 std::span<const uint8_t> compressed_data,
Abstract base class for image compression codecs.
JPEG 2000 codec implementation supporting both lossless and lossy modes.
bool is_lossy() const noexcept override
Checks if this codec produces lossy compression.
std::unique_ptr< impl > impl_
~jpeg2000_codec() override
jpeg2000_codec(const jpeg2000_codec &)=delete
bool can_encode(const image_params ¶ms) const noexcept override
Checks if this codec supports the given image parameters.
jpeg2000_codec(jpeg2000_codec &&) noexcept
codec_result encode(std::span< const uint8_t > pixel_data, const image_params ¶ms, const compression_options &options={}) const override
Compresses pixel data to JPEG 2000 format.
bool can_decode(const image_params ¶ms) const noexcept override
Checks if this codec can decode data with given parameters.
float compression_ratio() const noexcept
Gets the current compression ratio setting.
std::string_view transfer_syntax_uid() const noexcept override
Returns the Transfer Syntax UID supported by this codec.
jpeg2000_codec & operator=(const jpeg2000_codec &)=delete
jpeg2000_codec(bool lossless=true, float compression_ratio=kDefaultCompressionRatio, int resolution_levels=kDefaultResolutionLevels)
Constructs a JPEG 2000 codec instance.
codec_result decode(std::span< const uint8_t > compressed_data, const image_params ¶ms) const override
Decompresses JPEG 2000 data.
static constexpr int kDefaultResolutionLevels
Default number of resolution levels.
int resolution_levels() const noexcept
Gets the number of DWT resolution levels.
std::string_view name() const noexcept override
Returns a human-readable name for the codec.
static constexpr std::string_view kTransferSyntaxUIDLossy
DICOM Transfer Syntax UID for JPEG 2000 (Lossy or Lossless)
static constexpr std::string_view kTransferSyntaxUIDLossless
DICOM Transfer Syntax UID for JPEG 2000 Lossless Only.
static constexpr float kDefaultCompressionRatio
Default compression ratio for lossy mode (20:1)
bool is_lossless_mode() const noexcept
Checks if this codec is configured for lossless mode.
Compression quality settings for lossy codecs.
Parameters describing image pixel data.