PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
jpeg_lossless_codec.h
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2021-2025, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
11#ifndef PACS_ENCODING_COMPRESSION_JPEG_LOSSLESS_CODEC_HPP
12#define PACS_ENCODING_COMPRESSION_JPEG_LOSSLESS_CODEC_HPP
13
15
17
49public:
51 static constexpr std::string_view kTransferSyntaxUID = "1.2.840.10008.1.2.4.70";
52
54 static constexpr int kDefaultPredictor = 1;
55
57 static constexpr int kDefaultPointTransform = 0;
58
74
76
77 // Non-copyable but movable (internal state)
82
85
86 [[nodiscard]] std::string_view transfer_syntax_uid() const noexcept override;
87 [[nodiscard]] std::string_view name() const noexcept override;
88 [[nodiscard]] bool is_lossy() const noexcept override;
89 [[nodiscard]] bool can_encode(const image_params& params) const noexcept override;
90 [[nodiscard]] bool can_decode(const image_params& params) const noexcept override;
91
93
96
101 [[nodiscard]] int predictor() const noexcept;
102
107 [[nodiscard]] int point_transform() const noexcept;
108
110
113
125 [[nodiscard]] codec_result encode(
126 std::span<const uint8_t> pixel_data,
127 const image_params& params,
128 const compression_options& options = {}) const override;
129
141 [[nodiscard]] codec_result decode(
142 std::span<const uint8_t> compressed_data,
143 const image_params& params) const override;
144
146
147private:
148 class impl;
149 std::unique_ptr<impl> impl_;
150};
151
152} // namespace kcenon::pacs::encoding::compression
153
154#endif // PACS_ENCODING_COMPRESSION_JPEG_LOSSLESS_CODEC_HPP
Abstract base class for image compression codecs.
JPEG Lossless (Process 14, Selection Value 1) codec implementation.
jpeg_lossless_codec & operator=(const jpeg_lossless_codec &)=delete
bool can_encode(const image_params &params) const noexcept override
Checks if this codec supports the given image parameters.
jpeg_lossless_codec(jpeg_lossless_codec &&) noexcept
codec_result decode(std::span< const uint8_t > compressed_data, const image_params &params) const override
Decompresses JPEG Lossless data.
bool is_lossy() const noexcept override
Checks if this codec produces lossy compression.
std::string_view name() const noexcept override
Returns a human-readable name for the codec.
jpeg_lossless_codec(int predictor=kDefaultPredictor, int point_transform=kDefaultPointTransform)
Constructs a JPEG Lossless codec instance.
int predictor() const noexcept
Gets the current predictor selection value.
int point_transform() const noexcept
Gets the current point transform value.
static constexpr int kDefaultPredictor
Default predictor selection value (1 = Ra, left neighbor prediction)
static constexpr std::string_view kTransferSyntaxUID
DICOM Transfer Syntax UID for JPEG Lossless (Process 14, Selection Value 1)
std::string_view transfer_syntax_uid() const noexcept override
Returns the Transfer Syntax UID supported by this codec.
bool can_decode(const image_params &params) const noexcept override
Checks if this codec can decode data with given parameters.
codec_result encode(std::span< const uint8_t > pixel_data, const image_params &params, const compression_options &options={}) const override
Compresses pixel data to JPEG Lossless format.
jpeg_lossless_codec(const jpeg_lossless_codec &)=delete
static constexpr int kDefaultPointTransform
Default point transform (0 = no scaling)
Compression quality settings for lossy codecs.
Parameters describing image pixel data.