11#ifndef PACS_ENCODING_COMPRESSION_JPEG_LS_CODEC_HPP
12#define PACS_ENCODING_COMPRESSION_JPEG_LS_CODEC_HPP
54 "1.2.840.10008.1.2.4.80";
58 "1.2.840.10008.1.2.4.81";
97 [[nodiscard]] std::string_view
name() const noexcept override;
98 [[nodiscard]]
bool is_lossy() const noexcept override;
117 [[nodiscard]]
int near_value() const noexcept;
144 std::span<const uint8_t> pixel_data,
160 std::span<const uint8_t> compressed_data,
Abstract base class for image compression codecs.
JPEG-LS codec implementation supporting both lossless and near-lossless modes.
~jpeg_ls_codec() override
bool is_lossless_mode() const noexcept
Checks if this codec is configured for lossless mode.
static constexpr int kMaxNearValue
Maximum NEAR parameter value (higher = more compression, more loss)
std::string_view transfer_syntax_uid() const noexcept override
Returns the Transfer Syntax UID supported by this codec.
jpeg_ls_codec & operator=(const jpeg_ls_codec &)=delete
jpeg_ls_codec(bool lossless=true, int near_value=kAutoNearValue)
Constructs a JPEG-LS codec instance.
jpeg_ls_codec(const jpeg_ls_codec &)=delete
static constexpr std::string_view kTransferSyntaxUIDLossless
DICOM Transfer Syntax UID for JPEG-LS Lossless.
static constexpr int kLosslessNearValue
NEAR parameter for lossless mode.
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-LS format.
static constexpr int kDefaultNearLosslessValue
Default NEAR parameter for near-lossless mode (visually lossless quality)
jpeg_ls_codec(jpeg_ls_codec &&) noexcept
int near_value() const noexcept
Gets the NEAR parameter value.
codec_result decode(std::span< const uint8_t > compressed_data, const image_params ¶ms) const override
Decompresses JPEG-LS data.
std::string_view name() const noexcept override
Returns a human-readable name for the codec.
std::unique_ptr< impl > impl_
static constexpr int kAutoNearValue
Sentinel value indicating "auto-determine NEAR based on mode".
bool is_lossy() const noexcept override
Checks if this codec produces lossy compression.
bool can_encode(const image_params ¶ms) const noexcept override
Checks if this codec supports the given image parameters.
static constexpr std::string_view kTransferSyntaxUIDNearLossless
DICOM Transfer Syntax UID for JPEG-LS Near-Lossless (Lossy)
bool can_decode(const image_params ¶ms) const noexcept override
Checks if this codec can decode data with given parameters.
Compression quality settings for lossy codecs.
Parameters describing image pixel data.