1
1
// Copyright (c) Six Labors.
2
2
// Licensed under the Six Labors Split License.
3
3
4
- using System . Diagnostics ;
5
4
using SixLabors . ImageSharp . Formats . Ico ;
6
5
using SixLabors . ImageSharp . PixelFormats ;
7
6
using static SixLabors . ImageSharp . Tests . TestImages . Ico ;
@@ -42,6 +41,16 @@ public void IcoDecoder_Decode(TestImageProvider<Rgba32> provider)
42
41
[ WithFile ( Bpp1Size9x9 , PixelTypes . Rgba32 ) ]
43
42
[ WithFile ( Bpp1TranspNotSquare , PixelTypes . Rgba32 ) ]
44
43
[ WithFile ( Bpp1TranspPartial , PixelTypes . Rgba32 ) ]
44
+ public void Bpp1Test ( TestImageProvider < Rgba32 > provider )
45
+ {
46
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
47
+
48
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
49
+
50
+ // TODO: Assert metadata, frame count, etc
51
+ }
52
+
53
+ [ Theory ]
45
54
[ WithFile ( Bpp24Size15x15 , PixelTypes . Rgba32 ) ]
46
55
[ WithFile ( Bpp24Size16x16 , PixelTypes . Rgba32 ) ]
47
56
[ WithFile ( Bpp24Size17x17 , PixelTypes . Rgba32 ) ]
@@ -61,6 +70,16 @@ public void IcoDecoder_Decode(TestImageProvider<Rgba32> provider)
61
70
[ WithFile ( Bpp24TranspNotSquare , PixelTypes . Rgba32 ) ]
62
71
[ WithFile ( Bpp24TranspPartial , PixelTypes . Rgba32 ) ]
63
72
[ WithFile ( Bpp24Transp , PixelTypes . Rgba32 ) ]
73
+ public void Bpp24Test ( TestImageProvider < Rgba32 > provider )
74
+ {
75
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
76
+
77
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
78
+
79
+ // TODO: Assert metadata, frame count, etc
80
+ }
81
+
82
+ [ Theory ]
64
83
[ WithFile ( Bpp32Size15x15 , PixelTypes . Rgba32 ) ]
65
84
[ WithFile ( Bpp32Size16x16 , PixelTypes . Rgba32 ) ]
66
85
[ WithFile ( Bpp32Size17x17 , PixelTypes . Rgba32 ) ]
@@ -80,6 +99,16 @@ public void IcoDecoder_Decode(TestImageProvider<Rgba32> provider)
80
99
[ WithFile ( Bpp32TranspNotSquare , PixelTypes . Rgba32 ) ]
81
100
[ WithFile ( Bpp32TranspPartial , PixelTypes . Rgba32 ) ]
82
101
[ WithFile ( Bpp32Transp , PixelTypes . Rgba32 ) ]
102
+ public void Bpp32Test ( TestImageProvider < Rgba32 > provider )
103
+ {
104
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
105
+
106
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
107
+
108
+ // TODO: Assert metadata, frame count, etc
109
+ }
110
+
111
+ [ Theory ]
83
112
[ WithFile ( Bpp4Size15x15 , PixelTypes . Rgba32 ) ]
84
113
[ WithFile ( Bpp4Size16x16 , PixelTypes . Rgba32 ) ]
85
114
[ WithFile ( Bpp4Size17x17 , PixelTypes . Rgba32 ) ]
@@ -98,6 +127,16 @@ public void IcoDecoder_Decode(TestImageProvider<Rgba32> provider)
98
127
[ WithFile ( Bpp4Size9x9 , PixelTypes . Rgba32 ) ]
99
128
[ WithFile ( Bpp4TranspNotSquare , PixelTypes . Rgba32 ) ]
100
129
[ WithFile ( Bpp4TranspPartial , PixelTypes . Rgba32 ) ]
130
+ public void Bpp4Test ( TestImageProvider < Rgba32 > provider )
131
+ {
132
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
133
+
134
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
135
+
136
+ // TODO: Assert metadata, frame count, etc
137
+ }
138
+
139
+ [ Theory ]
101
140
[ WithFile ( Bpp8Size15x15 , PixelTypes . Rgba32 ) ]
102
141
[ WithFile ( Bpp8Size16x16 , PixelTypes . Rgba32 ) ]
103
142
[ WithFile ( Bpp8Size17x17 , PixelTypes . Rgba32 ) ]
@@ -116,28 +155,82 @@ public void IcoDecoder_Decode(TestImageProvider<Rgba32> provider)
116
155
[ WithFile ( Bpp8Size9x9 , PixelTypes . Rgba32 ) ]
117
156
[ WithFile ( Bpp8TranspNotSquare , PixelTypes . Rgba32 ) ]
118
157
[ WithFile ( Bpp8TranspPartial , PixelTypes . Rgba32 ) ]
158
+ public void Bpp8Test ( TestImageProvider < Rgba32 > provider )
159
+ {
160
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
161
+
162
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
163
+
164
+ // TODO: Assert metadata, frame count, etc
165
+ }
166
+
167
+ [ Theory ]
119
168
[ WithFile ( InvalidAll , PixelTypes . Rgba32 ) ]
120
- [ WithFile ( IcoFake , PixelTypes . Rgba32 ) ]
121
169
[ WithFile ( InvalidBpp , PixelTypes . Rgba32 ) ]
122
170
[ WithFile ( InvalidCompression , PixelTypes . Rgba32 ) ]
123
171
[ WithFile ( InvalidPng , PixelTypes . Rgba32 ) ]
124
172
[ WithFile ( InvalidRLE4 , PixelTypes . Rgba32 ) ]
125
173
[ WithFile ( InvalidRLE8 , PixelTypes . Rgba32 ) ]
174
+ public void InvalidTest ( TestImageProvider < Rgba32 > provider )
175
+ {
176
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
177
+
178
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
179
+
180
+ // TODO: Assert metadata, frame count, etc
181
+ }
182
+
183
+ [ Theory ]
126
184
[ WithFile ( MixedBmpPngA , PixelTypes . Rgba32 ) ]
127
185
[ WithFile ( MixedBmpPngB , PixelTypes . Rgba32 ) ]
128
186
[ WithFile ( MixedBmpPngC , PixelTypes . Rgba32 ) ]
187
+ public void MixedBmpPngTest ( TestImageProvider < Rgba32 > provider )
188
+ {
189
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
190
+
191
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
192
+
193
+ // TODO: Assert metadata, frame count, etc
194
+ }
195
+
196
+ [ Theory ]
129
197
[ WithFile ( MultiSizeA , PixelTypes . Rgba32 ) ]
130
198
[ WithFile ( MultiSizeB , PixelTypes . Rgba32 ) ]
131
199
[ WithFile ( MultiSizeC , PixelTypes . Rgba32 ) ]
132
200
[ WithFile ( MultiSizeD , PixelTypes . Rgba32 ) ]
133
201
[ WithFile ( MultiSizeE , PixelTypes . Rgba32 ) ]
134
202
[ WithFile ( MultiSizeF , PixelTypes . Rgba32 ) ]
203
+ public void MultiSizeTest ( TestImageProvider < Rgba32 > provider )
204
+ {
205
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
206
+
207
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
208
+
209
+ // TODO: Assert metadata, frame count, etc
210
+ }
211
+
212
+ [ Theory ]
135
213
[ WithFile ( MultiSizeMultiBitsA , PixelTypes . Rgba32 ) ]
136
214
[ WithFile ( MultiSizeMultiBitsB , PixelTypes . Rgba32 ) ]
137
215
[ WithFile ( MultiSizeMultiBitsC , PixelTypes . Rgba32 ) ]
138
216
[ WithFile ( MultiSizeMultiBitsD , PixelTypes . Rgba32 ) ]
139
- public void IcoDecoder_Decode2 ( TestImageProvider < Rgba32 > provider )
217
+ public void MultiSizeMultiBitsTest ( TestImageProvider < Rgba32 > provider )
218
+ {
219
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
220
+
221
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
222
+
223
+ // TODO: Assert metadata, frame count, etc
224
+ }
225
+
226
+ [ Theory ]
227
+ [ WithFile ( IcoFake , PixelTypes . Rgba32 ) ]
228
+ public void IcoFakeTest ( TestImageProvider < Rgba32 > provider )
140
229
{
141
- Debug . Assert ( false ) ;
230
+ using Image < Rgba32 > image = provider . GetImage ( IcoDecoder . Instance ) ;
231
+
232
+ image . DebugSaveMultiFrame ( provider , extension : "png" ) ;
233
+
234
+ // TODO: Assert metadata, frame count, etc
142
235
}
143
236
}
0 commit comments