1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Apache License, Version 2.0. See LICENSE.txt in the project root for license information.
* This software incorporates material from third parties. See NOTICE.txt for details.
*--------------------------------------------------------------------------------------------*/
#[derive(Debug)]
pub struct ComponentInfo {
/// quantization table
pub q_table: [u16; 64],
/// no of huffman table (DC)
pub huff_dc: u8,
/// no of huffman table (AC)
pub huff_ac: u8,
/// sample factor vertical
pub sfv: i32,
/// sample factor horizontal
pub sfh: i32,
/// blocks in mcu
pub mbs: i32,
/// block count vertical (interleaved)
pub bcv: i32,
/// block count horizontal (interleaved)
pub bch: i32,
/// block count (all) (interleaved)
pub bc: i32,
/// block count vertical (non interleaved)
pub ncv: i32,
/// block count horizontal (non interleaved)
pub nch: i32,
/// block count (all) (non interleaved)
pub nc: i32,
/// statistical identity
pub sid: i32,
/// jpeg internal id
pub jid: u8,
}
impl ComponentInfo {
pub fn new() -> ComponentInfo {
return ComponentInfo {
q_table: [0; 64],
sfv: -1,
sfh: -1,
mbs: -1,
bcv: -1,
bch: -1,
bc: -1,
ncv: -1,
nch: -1,
nc: -1,
sid: -1,
jid: 0xff,
huff_dc: 0xff,
huff_ac: 0xff,
};
}
}