11#ifndef PACS_ENCODING_COMPRESSION_IMAGE_PARAMS_HPP
12#define PACS_ENCODING_COMPRESSION_IMAGE_PARAMS_HPP
51 return "YBR_FULL_422";
53 return "PALETTE COLOR";
65 const std::string& str) {
124 size_t total_bits =
static_cast<size_t>(
width) *
height * bits_per_pixel;
125 return (total_bits + 7) / 8;
237 if (num_segments > 15)
return false;
std::string to_string(photometric_interpretation pi)
Converts photometric interpretation to DICOM string value.
photometric_interpretation parse_photometric_interpretation(const std::string &str)
Parses a DICOM photometric interpretation string.
photometric_interpretation
Photometric interpretation of pixel data.
@ ycbcr_full
YCbCr full range (JPEG standard)
@ palette_color
Palette color lookup table.
@ ycbcr_full_422
YCbCr 4:2:2 subsampling.
@ monochrome2
Minimum pixel value displayed as black.
@ monochrome1
Minimum pixel value displayed as white.
@ unknown
Unknown or unsupported interpretation.
@ rgb
Red, Green, Blue color model.
Parameters describing image pixel data.
uint16_t samples_per_pixel
Number of samples per pixel (0028,0002) 1 for grayscale, 3 for color.
uint16_t bits_allocated
Bits allocated per pixel sample (0028,0100) Valid values: 8, 16.
uint16_t height
Image height in pixels (Rows - 0028,0010)
size_t frame_size_bytes() const noexcept
Calculates the size of uncompressed pixel data in bytes.
bool is_color() const noexcept
Checks if the image is color (multiple samples per pixel).
bool valid_for_rle() const noexcept
Validates image parameters for RLE Lossless compression.
photometric_interpretation photometric
Photometric interpretation (0028,0004)
uint16_t planar_configuration
Planar configuration (0028,0006) 0 = interleaved (R1G1B1R2G2B2...), 1 = separate planes (RRR....
uint16_t pixel_representation
Pixel representation (0028,0103) 0 = unsigned, 1 = signed.
uint16_t width
Image width in pixels (Columns - 0028,0011)
uint16_t bits_stored
Bits stored per pixel sample (0028,0101) Must be <= bits_allocated.
bool valid_for_jpeg_lossless() const noexcept
Validates image parameters for JPEG Lossless compression.
bool valid_for_jpeg2000() const noexcept
Validates image parameters for JPEG 2000 compression.
bool is_signed() const noexcept
Checks if pixel values are signed integers.
bool valid_for_jpeg_baseline() const noexcept
Validates image parameters for JPEG Baseline compression.
bool is_grayscale() const noexcept
Checks if the image is grayscale (single sample per pixel).
uint32_t number_of_frames
Number of frames in multi-frame image (0028,0008)
uint16_t high_bit
High bit position (0028,0102) Typically bits_stored - 1.
bool valid_for_jpeg_ls() const noexcept
Validates image parameters for JPEG-LS compression.