Skip to main content

j2k_codec_math/
mct.rs

1//! JPEG 2000 multi-component transform constants.
2
3/// Forward ICT coefficient for R into Y.
4pub const ICT_FWD_Y_R: f32 = 0.299;
5/// Forward ICT coefficient for G into Y.
6pub const ICT_FWD_Y_G: f32 = 0.587;
7/// Forward ICT coefficient for B into Y.
8pub const ICT_FWD_Y_B: f32 = 0.114;
9/// Forward ICT coefficient for R into Cb.
10pub const ICT_FWD_CB_R: f32 = -0.16875;
11/// Forward ICT coefficient for G into Cb.
12pub const ICT_FWD_CB_G: f32 = -0.33126;
13/// Forward ICT coefficient for B into Cb.
14pub const ICT_FWD_CB_B: f32 = 0.5;
15/// Forward ICT coefficient for R into Cr.
16pub const ICT_FWD_CR_R: f32 = 0.5;
17/// Forward ICT coefficient for G into Cr.
18pub const ICT_FWD_CR_G: f32 = -0.41869;
19/// Forward ICT coefficient for B into Cr.
20pub const ICT_FWD_CR_B: f32 = -0.08131;
21
22/// Inverse ICT coefficient for Cr into R.
23pub const ICT_INV_R_CR: f32 = 1.402;
24/// Inverse ICT coefficient for Cb into G.
25pub const ICT_INV_G_CB: f32 = -0.34413;
26/// Inverse ICT coefficient for Cr into G.
27pub const ICT_INV_G_CR: f32 = -0.71414;
28/// Inverse ICT coefficient for Cb into B.
29pub const ICT_INV_B_CB: f32 = 1.772;
30
31/// Reversible color transform quarter scale.
32pub const RCT_QUARTER: f32 = 0.25;