#[cfg(not(target_endian = "little"))]
compile_error!(
"const_luts binary blobs are little-endian; big-endian targets need a byte-swap path or regenerated tables"
);
#[repr(C, align(4))]
struct Aligned<const N: usize>([u8; N]);
static LINEAR_TABLE_8: Aligned<{ 256 * 4 }> = Aligned(*include_bytes!("data/linear_table_8.bin"));
static ENCODE_TABLE_12: Aligned<{ 4096 * 4 }> =
Aligned(*include_bytes!("data/encode_table_12.bin"));
static LINEAR_TO_SRGB_U8: [u8; 4096] = *include_bytes!("data/linear_to_srgb_u8.bin");
#[inline]
pub(crate) fn linear_table_8() -> &'static [f32; 256] {
let slice: &[f32] = bytemuck::cast_slice(&LINEAR_TABLE_8.0);
slice.try_into().unwrap()
}
#[inline]
pub(crate) fn encode_table_12() -> &'static [f32; 4096] {
let slice: &[f32] = bytemuck::cast_slice(&ENCODE_TABLE_12.0);
slice.try_into().unwrap()
}
#[inline]
pub(crate) fn linear_to_srgb_u8() -> &'static [u8; 4096] {
&LINEAR_TO_SRGB_U8
}