PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
jpeg_baseline_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_BASELINE_CODEC_HPP
12#define PACS_ENCODING_COMPRESSION_JPEG_BASELINE_CODEC_HPP
13
15
17
48public:
50 static constexpr std::string_view kTransferSyntaxUID = "1.2.840.10008.1.2.4.50";
51
56
58
59 // Non-copyable but movable (internal state)
64
67
68 [[nodiscard]] std::string_view transfer_syntax_uid() const noexcept override;
69 [[nodiscard]] std::string_view name() const noexcept override;
70 [[nodiscard]] bool is_lossy() const noexcept override;
71 [[nodiscard]] bool can_encode(const image_params& params) const noexcept override;
72 [[nodiscard]] bool can_decode(const image_params& params) const noexcept override;
73
75
78
93 [[nodiscard]] codec_result encode(
94 std::span<const uint8_t> pixel_data,
95 const image_params& params,
96 const compression_options& options = {}) const override;
97
109 [[nodiscard]] codec_result decode(
110 std::span<const uint8_t> compressed_data,
111 const image_params& params) const override;
112
114
115private:
116 class impl;
117 std::unique_ptr<impl> impl_;
118};
119
120} // namespace kcenon::pacs::encoding::compression
121
122#endif // PACS_ENCODING_COMPRESSION_JPEG_BASELINE_CODEC_HPP
Abstract base class for image compression codecs.
JPEG Baseline (Process 1) codec implementation.
static constexpr std::string_view kTransferSyntaxUID
DICOM Transfer Syntax UID for JPEG Baseline.
jpeg_baseline_codec(jpeg_baseline_codec &&) noexcept
std::string_view transfer_syntax_uid() const noexcept override
Returns the Transfer Syntax UID supported by this codec.
bool is_lossy() const noexcept override
Checks if this codec produces lossy compression.
bool can_decode(const image_params &params) const noexcept override
Checks if this codec can decode data with given parameters.
jpeg_baseline_codec(const jpeg_baseline_codec &)=delete
std::string_view name() const noexcept override
Returns a human-readable name for the codec.
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 Baseline format.
codec_result decode(std::span< const uint8_t > compressed_data, const image_params &params) const override
Decompresses JPEG Baseline data.
jpeg_baseline_codec()
Constructs a JPEG Baseline codec instance.
bool can_encode(const image_params &params) const noexcept override
Checks if this codec supports the given image parameters.
jpeg_baseline_codec & operator=(const jpeg_baseline_codec &)=delete
Compression quality settings for lossy codecs.
Parameters describing image pixel data.