@@ -23,28 +23,28 @@ internal abstract class TiffCcittCompressor : TiffBaseCompressor
2323 64 , 128 , 192 , 256 , 320 , 384 , 448 , 512 , 576 , 640 , 704 , 768 , 832 , 896 , 960 , 1024 , 1088 , 1152 , 1216 , 1280 , 1344 , 1408 , 1472 , 1536 , 1600 , 1664 , 1728 , 1792 , 1856 , 1920 , 1984 , 2048 , 2112 , 2176 , 2240 , 2304 , 2368 , 2432 , 2496 , 2560
2424 } ;
2525
26- private static readonly Dictionary < uint , uint > WhiteLen4TermCodes = new Dictionary < uint , uint > ( )
26+ private static readonly Dictionary < uint , uint > WhiteLen4TermCodes = new ( )
2727 {
2828 { 2 , 0x7 } , { 3 , 0x8 } , { 4 , 0xB } , { 5 , 0xC } , { 6 , 0xE } , { 7 , 0xF }
2929 } ;
3030
31- private static readonly Dictionary < uint , uint > WhiteLen5TermCodes = new Dictionary < uint , uint > ( )
31+ private static readonly Dictionary < uint , uint > WhiteLen5TermCodes = new ( )
3232 {
3333 { 8 , 0x13 } , { 9 , 0x14 } , { 10 , 0x7 } , { 11 , 0x8 }
3434 } ;
3535
36- private static readonly Dictionary < uint , uint > WhiteLen6TermCodes = new Dictionary < uint , uint > ( )
36+ private static readonly Dictionary < uint , uint > WhiteLen6TermCodes = new ( )
3737 {
3838 { 1 , 0x7 } , { 12 , 0x8 } , { 13 , 0x3 } , { 14 , 0x34 } , { 15 , 0x35 } , { 16 , 0x2A } , { 17 , 0x2B }
3939 } ;
4040
41- private static readonly Dictionary < uint , uint > WhiteLen7TermCodes = new Dictionary < uint , uint > ( )
41+ private static readonly Dictionary < uint , uint > WhiteLen7TermCodes = new ( )
4242 {
4343 { 18 , 0x27 } , { 19 , 0xC } , { 20 , 0x8 } , { 21 , 0x17 } , { 22 , 0x3 } , { 23 , 0x4 } , { 24 , 0x28 } , { 25 , 0x2B } , { 26 , 0x13 } ,
4444 { 27 , 0x24 } , { 28 , 0x18 }
4545 } ;
4646
47- private static readonly Dictionary < uint , uint > WhiteLen8TermCodes = new Dictionary < uint , uint > ( )
47+ private static readonly Dictionary < uint , uint > WhiteLen8TermCodes = new ( )
4848 {
4949 { 0 , WhiteZeroRunTermCode } , { 29 , 0x2 } , { 30 , 0x3 } , { 31 , 0x1A } , { 32 , 0x1B } , { 33 , 0x12 } , { 34 , 0x13 } , { 35 , 0x14 } ,
5050 { 36 , 0x15 } , { 37 , 0x16 } , { 38 , 0x17 } , { 39 , 0x28 } , { 40 , 0x29 } , { 41 , 0x2A } , { 42 , 0x2B } , { 43 , 0x2C } , { 44 , 0x2D } ,
@@ -53,57 +53,57 @@ internal abstract class TiffCcittCompressor : TiffBaseCompressor
5353 { 63 , 0x34 }
5454 } ;
5555
56- private static readonly Dictionary < uint , uint > BlackLen2TermCodes = new Dictionary < uint , uint > ( )
56+ private static readonly Dictionary < uint , uint > BlackLen2TermCodes = new ( )
5757 {
5858 { 2 , 0x3 } , { 3 , 0x2 }
5959 } ;
6060
61- private static readonly Dictionary < uint , uint > BlackLen3TermCodes = new Dictionary < uint , uint > ( )
61+ private static readonly Dictionary < uint , uint > BlackLen3TermCodes = new ( )
6262 {
6363 { 1 , 0x2 } , { 4 , 0x3 }
6464 } ;
6565
66- private static readonly Dictionary < uint , uint > BlackLen4TermCodes = new Dictionary < uint , uint > ( )
66+ private static readonly Dictionary < uint , uint > BlackLen4TermCodes = new ( )
6767 {
6868 { 5 , 0x3 } , { 6 , 0x2 }
6969 } ;
7070
71- private static readonly Dictionary < uint , uint > BlackLen5TermCodes = new Dictionary < uint , uint > ( )
71+ private static readonly Dictionary < uint , uint > BlackLen5TermCodes = new ( )
7272 {
7373 { 7 , 0x3 }
7474 } ;
7575
76- private static readonly Dictionary < uint , uint > BlackLen6TermCodes = new Dictionary < uint , uint > ( )
76+ private static readonly Dictionary < uint , uint > BlackLen6TermCodes = new ( )
7777 {
7878 { 8 , 0x5 } , { 9 , 0x4 }
7979 } ;
8080
81- private static readonly Dictionary < uint , uint > BlackLen7TermCodes = new Dictionary < uint , uint > ( )
81+ private static readonly Dictionary < uint , uint > BlackLen7TermCodes = new ( )
8282 {
8383 { 10 , 0x4 } , { 11 , 0x5 } , { 12 , 0x7 }
8484 } ;
8585
86- private static readonly Dictionary < uint , uint > BlackLen8TermCodes = new Dictionary < uint , uint > ( )
86+ private static readonly Dictionary < uint , uint > BlackLen8TermCodes = new ( )
8787 {
8888 { 13 , 0x4 } , { 14 , 0x7 }
8989 } ;
9090
91- private static readonly Dictionary < uint , uint > BlackLen9TermCodes = new Dictionary < uint , uint > ( )
91+ private static readonly Dictionary < uint , uint > BlackLen9TermCodes = new ( )
9292 {
9393 { 15 , 0x18 }
9494 } ;
9595
96- private static readonly Dictionary < uint , uint > BlackLen10TermCodes = new Dictionary < uint , uint > ( )
96+ private static readonly Dictionary < uint , uint > BlackLen10TermCodes = new ( )
9797 {
9898 { 0 , BlackZeroRunTermCode } , { 16 , 0x17 } , { 17 , 0x18 } , { 18 , 0x8 }
9999 } ;
100100
101- private static readonly Dictionary < uint , uint > BlackLen11TermCodes = new Dictionary < uint , uint > ( )
101+ private static readonly Dictionary < uint , uint > BlackLen11TermCodes = new ( )
102102 {
103103 { 19 , 0x67 } , { 20 , 0x68 } , { 21 , 0x6C } , { 22 , 0x37 } , { 23 , 0x28 } , { 24 , 0x17 } , { 25 , 0x18 }
104104 } ;
105105
106- private static readonly Dictionary < uint , uint > BlackLen12TermCodes = new Dictionary < uint , uint > ( )
106+ private static readonly Dictionary < uint , uint > BlackLen12TermCodes = new ( )
107107 {
108108 { 26 , 0xCA } , { 27 , 0xCB } , { 28 , 0xCC } , { 29 , 0xCD } , { 30 , 0x68 } , { 31 , 0x69 } , { 32 , 0x6A } , { 33 , 0x6B } , { 34 , 0xD2 } ,
109109 { 35 , 0xD3 } , { 36 , 0xD4 } , { 37 , 0xD5 } , { 38 , 0xD6 } , { 39 , 0xD7 } , { 40 , 0x6C } , { 41 , 0x6D } , { 42 , 0xDA } , { 43 , 0xDB } ,
@@ -112,62 +112,62 @@ internal abstract class TiffCcittCompressor : TiffBaseCompressor
112112 { 62 , 0x66 } , { 63 , 0x67 }
113113 } ;
114114
115- private static readonly Dictionary < uint , uint > WhiteLen5MakeupCodes = new Dictionary < uint , uint > ( )
115+ private static readonly Dictionary < uint , uint > WhiteLen5MakeupCodes = new ( )
116116 {
117117 { 64 , 0x1B } , { 128 , 0x12 }
118118 } ;
119119
120- private static readonly Dictionary < uint , uint > WhiteLen6MakeupCodes = new Dictionary < uint , uint > ( )
120+ private static readonly Dictionary < uint , uint > WhiteLen6MakeupCodes = new ( )
121121 {
122122 { 192 , 0x17 } , { 1664 , 0x18 }
123123 } ;
124124
125- private static readonly Dictionary < uint , uint > WhiteLen8MakeupCodes = new Dictionary < uint , uint > ( )
125+ private static readonly Dictionary < uint , uint > WhiteLen8MakeupCodes = new ( )
126126 {
127127 { 320 , 0x36 } , { 384 , 0x37 } , { 448 , 0x64 } , { 512 , 0x65 } , { 576 , 0x68 } , { 640 , 0x67 }
128128 } ;
129129
130- private static readonly Dictionary < uint , uint > WhiteLen7MakeupCodes = new Dictionary < uint , uint > ( )
130+ private static readonly Dictionary < uint , uint > WhiteLen7MakeupCodes = new ( )
131131 {
132132 { 256 , 0x37 }
133133 } ;
134134
135- private static readonly Dictionary < uint , uint > WhiteLen9MakeupCodes = new Dictionary < uint , uint > ( )
135+ private static readonly Dictionary < uint , uint > WhiteLen9MakeupCodes = new ( )
136136 {
137137 { 704 , 0xCC } , { 768 , 0xCD } , { 832 , 0xD2 } , { 896 , 0xD3 } , { 960 , 0xD4 } , { 1024 , 0xD5 } , { 1088 , 0xD6 } ,
138138 { 1152 , 0xD7 } , { 1216 , 0xD8 } , { 1280 , 0xD9 } , { 1344 , 0xDA } , { 1408 , 0xDB } , { 1472 , 0x98 } , { 1536 , 0x99 } ,
139139 { 1600 , 0x9A } , { 1728 , 0x9B }
140140 } ;
141141
142- private static readonly Dictionary < uint , uint > WhiteLen11MakeupCodes = new Dictionary < uint , uint > ( )
142+ private static readonly Dictionary < uint , uint > WhiteLen11MakeupCodes = new ( )
143143 {
144144 { 1792 , 0x8 } , { 1856 , 0xC } , { 1920 , 0xD }
145145 } ;
146146
147- private static readonly Dictionary < uint , uint > WhiteLen12MakeupCodes = new Dictionary < uint , uint > ( )
147+ private static readonly Dictionary < uint , uint > WhiteLen12MakeupCodes = new ( )
148148 {
149149 { 1984 , 0x12 } , { 2048 , 0x13 } , { 2112 , 0x14 } , { 2176 , 0x15 } , { 2240 , 0x16 } , { 2304 , 0x17 } , { 2368 , 0x1C } ,
150150 { 2432 , 0x1D } , { 2496 , 0x1E } , { 2560 , 0x1F }
151151 } ;
152152
153- private static readonly Dictionary < uint , uint > BlackLen10MakeupCodes = new Dictionary < uint , uint > ( )
153+ private static readonly Dictionary < uint , uint > BlackLen10MakeupCodes = new ( )
154154 {
155155 { 64 , 0xF }
156156 } ;
157157
158- private static readonly Dictionary < uint , uint > BlackLen11MakeupCodes = new Dictionary < uint , uint > ( )
158+ private static readonly Dictionary < uint , uint > BlackLen11MakeupCodes = new ( )
159159 {
160160 { 1792 , 0x8 } , { 1856 , 0xC } , { 1920 , 0xD }
161161 } ;
162162
163- private static readonly Dictionary < uint , uint > BlackLen12MakeupCodes = new Dictionary < uint , uint > ( )
163+ private static readonly Dictionary < uint , uint > BlackLen12MakeupCodes = new ( )
164164 {
165165 { 128 , 0xC8 } , { 192 , 0xC9 } , { 256 , 0x5B } , { 320 , 0x33 } , { 384 , 0x34 } , { 448 , 0x35 } ,
166166 { 1984 , 0x12 } , { 2048 , 0x13 } , { 2112 , 0x14 } , { 2176 , 0x15 } , { 2240 , 0x16 } , { 2304 , 0x17 } , { 2368 , 0x1C } ,
167167 { 2432 , 0x1D } , { 2496 , 0x1E } , { 2560 , 0x1F }
168168 } ;
169169
170- private static readonly Dictionary < uint , uint > BlackLen13MakeupCodes = new Dictionary < uint , uint > ( )
170+ private static readonly Dictionary < uint , uint > BlackLen13MakeupCodes = new ( )
171171 {
172172 { 512 , 0x6C } , { 576 , 0x6D } , { 640 , 0x4A } , { 704 , 0x4B } , { 768 , 0x4C } , { 832 , 0x4D } , { 896 , 0x72 } ,
173173 { 960 , 0x73 } , { 1024 , 0x74 } , { 1088 , 0x75 } , { 1152 , 0x76 } , { 1216 , 0x77 } , { 1280 , 0x52 } , { 1344 , 0x53 } ,
@@ -442,16 +442,16 @@ protected uint GetMakeupCode(uint runLength, out uint codeLength, bool isWhiteRu
442442 }
443443
444444 /// <summary>
445- /// Pads output to the next byte
445+ /// Pads output to the next byte.
446446 /// </summary>
447447 /// <remarks>
448448 /// If the output is not currently on a byte boundary,
449- /// zero-pad it to the next byte
449+ /// zero-pad it to the next byte.
450450 /// </remarks>
451451 protected void PadByte ( )
452452 {
453453 // Check if padding is necessary.
454- if ( this . bitPosition % 8 != 0 )
454+ if ( Numerics . Modulo8 ( this . bitPosition ) != 0 )
455455 {
456456 // Skip padding bits, move to next byte.
457457 this . bytePosition ++ ;
0 commit comments