|
PACS System 0.1.0
PACS DICOM system library
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | vec128_int |
| Portable 128-bit integer vector wrapper. More... | |
| struct | vec256_int |
| Portable 256-bit integer vector wrapper. More... | |
| class | window_level_lut |
| Precomputed LUT for fast repeated window/level application. More... | |
| struct | window_level_params |
| Window/Level parameters. More... | |
Enumerations | |
| enum class | simd_feature : uint32_t { none = 0 , sse2 = 1 << 0 , ssse3 = 1 << 1 , sse41 = 1 << 2 , avx = 1 << 3 , avx2 = 1 << 4 , avx512f = 1 << 5 , neon = 1 << 6 } |
| SIMD feature flags for runtime detection. More... | |
Functions | |
| constexpr simd_feature | operator| (simd_feature a, simd_feature b) noexcept |
| Bitwise OR for simd_feature flags. | |
| constexpr simd_feature | operator& (simd_feature a, simd_feature b) noexcept |
| Bitwise AND for simd_feature flags. | |
| constexpr bool | has_feature (simd_feature features, simd_feature check) noexcept |
| Check if a specific feature is set. | |
| simd_feature | detect_features () noexcept |
| Detect available SIMD features at runtime. | |
| simd_feature | get_features () noexcept |
| Get cached SIMD features (singleton pattern) | |
| bool | has_sse2 () noexcept |
| Check if SSE2 is available. | |
| bool | has_ssse3 () noexcept |
| Check if SSSE3 is available. | |
| bool | has_sse41 () noexcept |
| Check if SSE4.1 is available. | |
| bool | has_avx () noexcept |
| Check if AVX is available. | |
| bool | has_avx2 () noexcept |
| Check if AVX2 is available. | |
| bool | has_avx512f () noexcept |
| Check if AVX-512F is available. | |
| bool | has_neon () noexcept |
| Check if NEON is available. | |
| size_t | optimal_vector_width () noexcept |
| Get optimal vector width in bytes for current CPU. | |
| void | invert_monochrome_8bit (const uint8_t *src, uint8_t *dst, size_t pixel_count) noexcept |
| Invert 8-bit monochrome pixels (MONOCHROME1 <-> MONOCHROME2) | |
| void | invert_monochrome_16bit (const uint16_t *src, uint16_t *dst, size_t pixel_count, uint16_t max_value) noexcept |
| Invert 16-bit monochrome pixels. | |
| void | rgb_to_ycbcr_8bit (const uint8_t *src, uint8_t *dst, size_t pixel_count) noexcept |
| Convert RGB to YCbCr color space (ITU-R BT.601) | |
| void | ycbcr_to_rgb_8bit (const uint8_t *src, uint8_t *dst, size_t pixel_count) noexcept |
| Convert YCbCr to RGB color space (ITU-R BT.601) | |
| void | interleaved_to_planar_rgb8 (const uint8_t *src, uint8_t *r, uint8_t *g, uint8_t *b, size_t pixel_count) noexcept |
| Convert interleaved RGB to planar format using best available SIMD. | |
| void | planar_to_interleaved_rgb8 (const uint8_t *r, const uint8_t *g, const uint8_t *b, uint8_t *dst, size_t pixel_count) noexcept |
| Convert planar RGB to interleaved format using best available SIMD. | |
| void | split_16bit_to_planes (const uint8_t *src, uint8_t *high, uint8_t *low, size_t pixel_count) noexcept |
| Split 16-bit data into high and low byte planes. | |
| void | merge_planes_to_16bit (const uint8_t *high, const uint8_t *low, uint8_t *dst, size_t pixel_count) noexcept |
| Merge high and low byte planes into 16-bit data. | |
| template<size_t Alignment> | |
| constexpr bool | is_aligned (const void *ptr) noexcept |
| Check if a pointer is aligned to the specified boundary. | |
| template<size_t Alignment> | |
| constexpr size_t | align_offset (const void *ptr) noexcept |
| Get the aligned portion start offset. | |
| void | swap_bytes_16_simd (const uint8_t *src, uint8_t *dst, size_t byte_count) noexcept |
| Swap bytes in 16-bit words using best available SIMD. | |
| void | swap_bytes_32_simd (const uint8_t *src, uint8_t *dst, size_t byte_count) noexcept |
| Swap bytes in 32-bit words using best available SIMD. | |
| void | swap_bytes_64_simd (const uint8_t *src, uint8_t *dst, size_t byte_count) noexcept |
| Swap bytes in 64-bit words using best available SIMD. | |
| void | apply_window_level_8bit (const uint8_t *src, uint8_t *dst, size_t pixel_count, const window_level_params ¶ms) noexcept |
| Apply window/level transformation to 8-bit grayscale data. | |
| void | apply_window_level_16bit (const uint16_t *src, uint8_t *dst, size_t pixel_count, const window_level_params ¶ms) noexcept |
| Apply window/level transformation to 16-bit unsigned grayscale data. | |
| void | apply_window_level_16bit_signed (const int16_t *src, uint8_t *dst, size_t pixel_count, const window_level_params ¶ms) noexcept |
| Apply window/level transformation to 16-bit signed grayscale data. | |
Variables | |
| constexpr size_t | SSE_ALIGNMENT = 16 |
| constexpr size_t | AVX_ALIGNMENT = 32 |
| constexpr size_t | AVX512_ALIGNMENT = 64 |
|
strong |
SIMD feature flags for runtime detection.
| Enumerator | |
|---|---|
| none | |
| sse2 | |
| ssse3 | |
| sse41 | |
| avx | |
| avx2 | |
| avx512f | |
| neon | |
Definition at line 87 of file simd_config.h.
|
nodiscardconstexprnoexcept |
Get the aligned portion start offset.
Definition at line 219 of file simd_types.h.
References align_offset().
Referenced by align_offset().


|
inlinenoexcept |
Apply window/level transformation to 16-bit unsigned grayscale data.
| src | Source pixel data (16-bit unsigned grayscale) |
| dst | Destination pixel data (8-bit display values) |
| pixel_count | Number of pixels to process |
| params | Window/level parameters |
Definition at line 860 of file simd_windowing.h.
References kcenon::pacs::encoding::simd::detail::apply_window_level_16bit_scalar(), has_avx2(), has_neon(), and has_sse2().

|
inlinenoexcept |
Apply window/level transformation to 16-bit signed grayscale data.
Handles signed pixel data commonly found in CT images.
| src | Source pixel data (16-bit signed grayscale) |
| dst | Destination pixel data (8-bit display values) |
| pixel_count | Number of pixels to process |
| params | Window/level parameters |
Definition at line 894 of file simd_windowing.h.
References kcenon::pacs::encoding::simd::detail::apply_window_level_16bit_signed_scalar(), has_avx2(), has_neon(), and has_sse2().

|
inlinenoexcept |
Apply window/level transformation to 8-bit grayscale data.
Maps input pixel values to output values based on window center and width. Uses SIMD when available for better performance.
| src | Source pixel data (8-bit grayscale) |
| dst | Destination pixel data (8-bit display values) |
| pixel_count | Number of pixels to process |
| params | Window/level parameters |
Definition at line 828 of file simd_windowing.h.
References kcenon::pacs::encoding::simd::detail::apply_window_level_8bit_scalar(), has_avx2(), has_neon(), and has_sse2().

|
inlinenodiscardnoexcept |
Detect available SIMD features at runtime.
Definition at line 164 of file simd_config.h.
References avx, avx2, avx512f, neon, none, sse2, sse41, and ssse3.
Referenced by get_features().

|
inlinenodiscardnoexcept |
Get cached SIMD features (singleton pattern)
Definition at line 226 of file simd_config.h.
References detect_features().
Referenced by has_avx(), has_avx2(), has_avx512f(), has_neon(), has_sse2(), has_sse41(), and has_ssse3().


|
inlinenodiscardnoexcept |
Check if AVX is available.
Definition at line 255 of file simd_config.h.
References avx, get_features(), and has_feature().

|
inlinenodiscardnoexcept |
Check if AVX2 is available.
Definition at line 262 of file simd_config.h.
References avx2, get_features(), and has_feature().
Referenced by apply_window_level_16bit(), apply_window_level_16bit_signed(), apply_window_level_8bit(), interleaved_to_planar_rgb8(), invert_monochrome_16bit(), invert_monochrome_8bit(), merge_planes_to_16bit(), optimal_vector_width(), planar_to_interleaved_rgb8(), rgb_to_ycbcr_8bit(), split_16bit_to_planes(), swap_bytes_16_simd(), swap_bytes_32_simd(), swap_bytes_64_simd(), and ycbcr_to_rgb_8bit().


|
inlinenodiscardnoexcept |
Check if AVX-512F is available.
Definition at line 269 of file simd_config.h.
References avx512f, get_features(), and has_feature().
Referenced by optimal_vector_width().


|
nodiscardconstexprnoexcept |
Check if a specific feature is set.
Definition at line 119 of file simd_config.h.
Referenced by has_avx(), has_avx2(), has_avx512f(), has_neon(), has_sse2(), has_sse41(), and has_ssse3().

|
inlinenodiscardnoexcept |
Check if NEON is available.
Definition at line 276 of file simd_config.h.
References get_features(), has_feature(), and neon.
Referenced by apply_window_level_16bit(), apply_window_level_16bit_signed(), apply_window_level_8bit(), invert_monochrome_16bit(), invert_monochrome_8bit(), optimal_vector_width(), rgb_to_ycbcr_8bit(), and ycbcr_to_rgb_8bit().


|
inlinenodiscardnoexcept |
Check if SSE2 is available.
Definition at line 234 of file simd_config.h.
References get_features(), has_feature(), and sse2.
Referenced by apply_window_level_16bit(), apply_window_level_16bit_signed(), apply_window_level_8bit(), invert_monochrome_16bit(), invert_monochrome_8bit(), and optimal_vector_width().


|
inlinenodiscardnoexcept |
Check if SSE4.1 is available.
Definition at line 248 of file simd_config.h.
References get_features(), has_feature(), and sse41.

|
inlinenodiscardnoexcept |
Check if SSSE3 is available.
Definition at line 241 of file simd_config.h.
References get_features(), has_feature(), and ssse3.
Referenced by interleaved_to_planar_rgb8(), merge_planes_to_16bit(), planar_to_interleaved_rgb8(), split_16bit_to_planes(), swap_bytes_16_simd(), swap_bytes_32_simd(), and swap_bytes_64_simd().


|
inlinenoexcept |
Convert interleaved RGB to planar format using best available SIMD.
| src | Source interleaved RGB data (RGBRGBRGB...) |
| r | Destination R plane |
| g | Destination G plane |
| b | Destination B plane |
| pixel_count | Number of pixels to convert |
Definition at line 725 of file simd_rle.h.
References has_avx2(), has_ssse3(), and kcenon::pacs::encoding::simd::detail::interleaved_to_planar_rgb8_scalar().
Referenced by kcenon::pacs::encoding::compression::rle_codec::impl::encode_frame().


|
inlinenoexcept |
Invert 16-bit monochrome pixels.
| src | Source pixel data |
| dst | Destination pixel data |
| pixel_count | Number of pixels to process |
| max_value | Maximum pixel value (e.g., 4095 for 12-bit, 65535 for 16-bit) |
Definition at line 621 of file simd_photometric.h.
References has_avx2(), has_neon(), has_sse2(), and kcenon::pacs::encoding::simd::detail::invert_monochrome_16bit_scalar().

|
inlinenoexcept |
Invert 8-bit monochrome pixels (MONOCHROME1 <-> MONOCHROME2)
Converts between MONOCHROME1 (white = 0) and MONOCHROME2 (white = max). Uses SIMD when available for better performance.
| src | Source pixel data |
| dst | Destination pixel data (can be same as src for in-place) |
| pixel_count | Number of pixels to process |
Definition at line 590 of file simd_photometric.h.
References has_avx2(), has_neon(), has_sse2(), and kcenon::pacs::encoding::simd::detail::invert_monochrome_8bit_scalar().

|
nodiscardconstexprnoexcept |
Check if a pointer is aligned to the specified boundary.
Definition at line 211 of file simd_types.h.
References is_aligned().
Referenced by is_aligned().


|
inlinenoexcept |
Merge high and low byte planes into 16-bit data.
| high | Source high byte plane |
| low | Source low byte plane |
| dst | Destination 16-bit little-endian data |
| pixel_count | Number of 16-bit values to merge |
Definition at line 837 of file simd_rle.h.
References has_avx2(), has_ssse3(), and kcenon::pacs::encoding::simd::detail::merge_planes_to_16bit_scalar().
Referenced by kcenon::pacs::encoding::compression::rle_codec::impl::decode_frame().


|
nodiscardconstexprnoexcept |
Bitwise AND for simd_feature flags.
Definition at line 110 of file simd_config.h.
|
nodiscardconstexprnoexcept |
Bitwise OR for simd_feature flags.
Definition at line 101 of file simd_config.h.
|
inlinenodiscardnoexcept |
Get optimal vector width in bytes for current CPU.
Definition at line 284 of file simd_config.h.
References has_avx2(), has_avx512f(), has_neon(), and has_sse2().

|
inlinenoexcept |
Convert planar RGB to interleaved format using best available SIMD.
| r | Source R plane |
| g | Source G plane |
| b | Source B plane |
| dst | Destination interleaved RGB data (RGBRGBRGB...) |
| pixel_count | Number of pixels to convert |
Definition at line 763 of file simd_rle.h.
References has_avx2(), has_ssse3(), and kcenon::pacs::encoding::simd::detail::planar_to_interleaved_rgb8_scalar().
Referenced by kcenon::pacs::encoding::compression::rle_codec::impl::decode_frame().


|
inlinenoexcept |
Convert RGB to YCbCr color space (ITU-R BT.601)
| src | Source RGB pixel data (interleaved RGBRGB...) |
| dst | Destination YCbCr pixel data (interleaved YCbCrYCbCr...) |
| pixel_count | Number of pixels to process |
Definition at line 652 of file simd_photometric.h.
References has_avx2(), has_neon(), and kcenon::pacs::encoding::simd::detail::rgb_to_ycbcr_8bit_scalar().

|
inlinenoexcept |
Split 16-bit data into high and low byte planes.
| src | Source 16-bit little-endian data |
| high | Destination high byte plane |
| low | Destination low byte plane |
| pixel_count | Number of 16-bit values to split |
Definition at line 800 of file simd_rle.h.
References has_avx2(), has_ssse3(), and kcenon::pacs::encoding::simd::detail::split_16bit_to_planes_scalar().
Referenced by kcenon::pacs::encoding::compression::rle_codec::impl::encode_frame().


|
inlinenoexcept |
Swap bytes in 16-bit words using best available SIMD.
| src | Source data pointer |
| dst | Destination data pointer |
| byte_count | Number of bytes (should be even) |
Definition at line 278 of file simd_utils.h.
References has_avx2(), has_ssse3(), and kcenon::pacs::encoding::simd::detail::swap_bytes_16_scalar().
Referenced by kcenon::pacs::encoding::swap_ow_bytes().


|
inlinenoexcept |
Swap bytes in 32-bit words using best available SIMD.
| src | Source data pointer |
| dst | Destination data pointer |
| byte_count | Number of bytes (should be multiple of 4) |
Definition at line 312 of file simd_utils.h.
References has_avx2(), has_ssse3(), and kcenon::pacs::encoding::simd::detail::swap_bytes_32_scalar().
Referenced by kcenon::pacs::encoding::swap_ol_bytes().


|
inlinenoexcept |
Swap bytes in 64-bit words using best available SIMD.
| src | Source data pointer |
| dst | Destination data pointer |
| byte_count | Number of bytes (should be multiple of 8) |
Definition at line 346 of file simd_utils.h.
References has_avx2(), has_ssse3(), and kcenon::pacs::encoding::simd::detail::swap_bytes_64_scalar().
Referenced by kcenon::pacs::encoding::swap_od_bytes().


|
inlinenoexcept |
Convert YCbCr to RGB color space (ITU-R BT.601)
| src | Source YCbCr pixel data (interleaved YCbCrYCbCr...) |
| dst | Destination RGB pixel data (interleaved RGBRGB...) |
| pixel_count | Number of pixels to process |
Definition at line 676 of file simd_photometric.h.
References has_avx2(), has_neon(), and kcenon::pacs::encoding::simd::detail::ycbcr_to_rgb_8bit_scalar().

|
constexpr |
Definition at line 28 of file simd_types.h.
|
constexpr |
Definition at line 27 of file simd_types.h.
|
constexpr |
Definition at line 26 of file simd_types.h.