| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | use crate::bindings; |
| 8 | |
| 9 | |
| 10 | pub struct PictureParameterBufferJPEGBaselineComponent( |
| 11 | bindings::_VAPictureParameterBufferJPEGBaseline__bindgen_ty_1, |
| 12 | ); |
| 13 | |
| 14 | impl PictureParameterBufferJPEGBaselineComponent { |
| 15 | |
| 16 | #[allow(clippy::too_many_arguments)] |
| 17 | pub fn new( |
| 18 | component_id: u8, |
| 19 | h_sampling_factor: u8, |
| 20 | v_sampling_factor: u8, |
| 21 | quantiser_table_selector: u8, |
| 22 | ) -> Self { |
| 23 | Self( |
| 24 | bindings::_VAPictureParameterBufferJPEGBaseline__bindgen_ty_1 { |
| 25 | component_id, |
| 26 | h_sampling_factor, |
| 27 | v_sampling_factor, |
| 28 | quantiser_table_selector, |
| 29 | }, |
| 30 | ) |
| 31 | } |
| 32 | |
| 33 | |
| 34 | pub fn inner(&mut self) -> &bindings::_VAPictureParameterBufferJPEGBaseline__bindgen_ty_1 { |
| 35 | &self.0 |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | |
| 40 | pub struct PictureParameterBufferJPEGBaseline(Box<bindings::VAPictureParameterBufferJPEGBaseline>); |
| 41 | |
| 42 | impl PictureParameterBufferJPEGBaseline { |
| 43 | |
| 44 | pub fn new( |
| 45 | picture_width: u16, |
| 46 | picture_height: u16, |
| 47 | components: [PictureParameterBufferJPEGBaselineComponent; 255usize], |
| 48 | num_components: u8, |
| 49 | color_space: u8, |
| 50 | rotation: u32, |
| 51 | crop_rectangle: bindings::VARectangle, |
| 52 | ) -> Self { |
| 53 | Self(Box::new(bindings::VAPictureParameterBufferJPEGBaseline { |
| 54 | picture_width, |
| 55 | picture_height, |
| 56 | components: components.map(|component| component.0), |
| 57 | num_components, |
| 58 | color_space, |
| 59 | rotation, |
| 60 | crop_rectangle, |
| 61 | va_reserved: Default::default(), |
| 62 | })) |
| 63 | } |
| 64 | |
| 65 | pub(crate) fn inner_mut(&mut self) -> &mut bindings::VAPictureParameterBufferJPEGBaseline { |
| 66 | self.0.as_mut() |
| 67 | } |
| 68 | |
| 69 | |
| 70 | pub fn inner(&mut self) -> &bindings::VAPictureParameterBufferJPEGBaseline { |
| 71 | self.0.as_ref() |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | |
| 76 | pub struct VASliceParameterBufferJPEGBaselineComponent( |
| 77 | bindings::_VASliceParameterBufferJPEGBaseline__bindgen_ty_1, |
| 78 | ); |
| 79 | |
| 80 | impl VASliceParameterBufferJPEGBaselineComponent { |
| 81 | |
| 82 | #[allow(clippy::too_many_arguments)] |
| 83 | pub fn new(component_selector: u8, dc_table_selector: u8, ac_table_selector: u8) -> Self { |
| 84 | Self( |
| 85 | bindings::_VASliceParameterBufferJPEGBaseline__bindgen_ty_1 { |
| 86 | component_selector, |
| 87 | dc_table_selector, |
| 88 | ac_table_selector, |
| 89 | }, |
| 90 | ) |
| 91 | } |
| 92 | |
| 93 | |
| 94 | pub fn inner(&mut self) -> &bindings::_VASliceParameterBufferJPEGBaseline__bindgen_ty_1 { |
| 95 | &self.0 |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | |
| 100 | pub struct SliceParameterBufferJPEGBaseline(Box<bindings::VASliceParameterBufferJPEGBaseline>); |
| 101 | |
| 102 | impl SliceParameterBufferJPEGBaseline { |
| 103 | |
| 104 | pub fn new( |
| 105 | slice_data_size: u32, |
| 106 | slice_data_offset: u32, |
| 107 | slice_data_flag: u32, |
| 108 | slice_horizontal_position: u32, |
| 109 | slice_vertical_position: u32, |
| 110 | components: [VASliceParameterBufferJPEGBaselineComponent; 4usize], |
| 111 | num_components: u8, |
| 112 | restart_interval: u16, |
| 113 | num_mcus: u32, |
| 114 | ) -> Self { |
| 115 | Self(Box::new(bindings::VASliceParameterBufferJPEGBaseline { |
| 116 | slice_data_size, |
| 117 | slice_data_offset, |
| 118 | slice_data_flag, |
| 119 | slice_horizontal_position, |
| 120 | slice_vertical_position, |
| 121 | components: components.map(|component| component.0), |
| 122 | num_components, |
| 123 | restart_interval, |
| 124 | num_mcus, |
| 125 | va_reserved: Default::default(), |
| 126 | })) |
| 127 | } |
| 128 | |
| 129 | pub(crate) fn inner_mut(&mut self) -> &mut bindings::VASliceParameterBufferJPEGBaseline { |
| 130 | self.0.as_mut() |
| 131 | } |
| 132 | |
| 133 | |
| 134 | pub fn inner(&mut self) -> &bindings::VASliceParameterBufferJPEGBaseline { |
| 135 | self.0.as_ref() |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | |
| 140 | pub struct IQMatrixBufferJPEGBaseline(Box<bindings::VAIQMatrixBufferJPEGBaseline>); |
| 141 | |
| 142 | impl IQMatrixBufferJPEGBaseline { |
| 143 | |
| 144 | #[allow(clippy::too_many_arguments)] |
| 145 | pub fn new( |
| 146 | load_quantiser_table: [u8; 4usize], |
| 147 | quantiser_table: [[u8; 64usize]; 4usize], |
| 148 | ) -> Self { |
| 149 | Self(Box::new(bindings::VAIQMatrixBufferJPEGBaseline { |
| 150 | load_quantiser_table, |
| 151 | quantiser_table, |
| 152 | va_reserved: Default::default(), |
| 153 | })) |
| 154 | } |
| 155 | |
| 156 | pub(crate) fn inner_mut(&mut self) -> &mut bindings::VAIQMatrixBufferJPEGBaseline { |
| 157 | self.0.as_mut() |
| 158 | } |
| 159 | |
| 160 | |
| 161 | pub fn inner(&self) -> &bindings::VAIQMatrixBufferJPEGBaseline { |
| 162 | self.0.as_ref() |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | |
| 167 | pub struct HuffmanTableBufferJPEGBaselineHuffmanTable( |
| 168 | bindings::_VAHuffmanTableBufferJPEGBaseline__bindgen_ty_1, |
| 169 | ); |
| 170 | |
| 171 | impl HuffmanTableBufferJPEGBaselineHuffmanTable { |
| 172 | |
| 173 | #[allow(clippy::too_many_arguments)] |
| 174 | pub fn new( |
| 175 | num_dc_codes: [u8; 16usize], |
| 176 | dc_values: [u8; 12usize], |
| 177 | num_ac_codes: [u8; 16usize], |
| 178 | ac_values: [u8; 162usize], |
| 179 | pad: [u8; 2usize], |
| 180 | ) -> Self { |
| 181 | Self(bindings::_VAHuffmanTableBufferJPEGBaseline__bindgen_ty_1 { |
| 182 | num_dc_codes, |
| 183 | dc_values, |
| 184 | num_ac_codes, |
| 185 | ac_values, |
| 186 | pad, |
| 187 | }) |
| 188 | } |
| 189 | |
| 190 | |
| 191 | pub fn inner(&mut self) -> &bindings::_VAHuffmanTableBufferJPEGBaseline__bindgen_ty_1 { |
| 192 | &self.0 |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | |
| 197 | pub struct HuffmanTableBufferJPEGBaseline(Box<bindings::VAHuffmanTableBufferJPEGBaseline>); |
| 198 | |
| 199 | impl HuffmanTableBufferJPEGBaseline { |
| 200 | |
| 201 | pub fn new( |
| 202 | load_huffman_table: [u8; 2usize], |
| 203 | huffman_table: [HuffmanTableBufferJPEGBaselineHuffmanTable; 2usize], |
| 204 | ) -> Self { |
| 205 | Self(Box::new(bindings::VAHuffmanTableBufferJPEGBaseline { |
| 206 | load_huffman_table, |
| 207 | huffman_table: huffman_table.map(|component| component.0), |
| 208 | va_reserved: Default::default(), |
| 209 | })) |
| 210 | } |
| 211 | |
| 212 | pub(crate) fn inner_mut(&mut self) -> &mut bindings::VAHuffmanTableBufferJPEGBaseline { |
| 213 | self.0.as_mut() |
| 214 | } |
| 215 | |
| 216 | |
| 217 | pub fn inner(&mut self) -> &bindings::VAHuffmanTableBufferJPEGBaseline { |
| 218 | self.0.as_ref() |
| 219 | } |
| 220 | } |