@@ -129,19 +129,35 @@ public void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken
129
129
130
130
if ( lossless )
131
131
{
132
- using Vp8LEncoder encoder = new Vp8LEncoder ( this . memoryAllocator , this . configuration , image . Width ,
133
- image . Height , this . quality , this . skipMetadata , this . method , this . transparentColorMode ,
134
- this . nearLossless , this . nearLosslessQuality ) ;
132
+ using Vp8LEncoder encoder = new Vp8LEncoder (
133
+ this . memoryAllocator ,
134
+ this . configuration ,
135
+ image . Width ,
136
+ image . Height ,
137
+ this . quality ,
138
+ this . skipMetadata ,
139
+ this . method ,
140
+ this . transparentColorMode ,
141
+ this . nearLossless ,
142
+ this . nearLosslessQuality ) ;
135
143
136
144
bool hasAnimation = image . Frames . Count > 1 ;
137
145
encoder . EncodeHeader ( image , stream , hasAnimation ) ;
138
146
if ( hasAnimation )
139
147
{
140
148
foreach ( ImageFrame < TPixel > imageFrame in image . Frames )
141
149
{
142
- using Vp8LEncoder enc = new Vp8LEncoder ( this . memoryAllocator , this . configuration , image . Width ,
143
- image . Height , this . quality , this . skipMetadata , this . method , this . transparentColorMode ,
144
- this . nearLossless , this . nearLosslessQuality ) ;
150
+ using Vp8LEncoder enc = new Vp8LEncoder (
151
+ this . memoryAllocator ,
152
+ this . configuration ,
153
+ image . Width ,
154
+ image . Height ,
155
+ this . quality ,
156
+ this . skipMetadata ,
157
+ this . method ,
158
+ this . transparentColorMode ,
159
+ this . nearLossless ,
160
+ this . nearLosslessQuality ) ;
145
161
146
162
enc . Encode ( imageFrame , stream , true ) ;
147
163
}
@@ -155,18 +171,36 @@ public void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken
155
171
}
156
172
else
157
173
{
158
- using Vp8Encoder encoder = new Vp8Encoder ( this . memoryAllocator , this . configuration , image . Width ,
159
- image . Height , this . quality , this . skipMetadata , this . method , this . entropyPasses , this . filterStrength ,
160
- this . spatialNoiseShaping , this . alphaCompression ) ;
174
+ using Vp8Encoder encoder = new Vp8Encoder (
175
+ this . memoryAllocator ,
176
+ this . configuration ,
177
+ image . Width ,
178
+ image . Height ,
179
+ this . quality ,
180
+ this . skipMetadata ,
181
+ this . method ,
182
+ this . entropyPasses ,
183
+ this . filterStrength ,
184
+ this . spatialNoiseShaping ,
185
+ this . alphaCompression ) ;
161
186
if ( image . Frames . Count > 1 )
162
187
{
163
188
encoder . EncodeHeader ( image , stream , false , true ) ;
164
189
165
190
foreach ( ImageFrame < TPixel > imageFrame in image . Frames )
166
191
{
167
- using Vp8Encoder enc = new Vp8Encoder ( this . memoryAllocator , this . configuration , image . Width ,
168
- image . Height , this . quality , this . skipMetadata , this . method , this . entropyPasses ,
169
- this . filterStrength , this . spatialNoiseShaping , this . alphaCompression ) ;
192
+ using Vp8Encoder enc = new Vp8Encoder (
193
+ this . memoryAllocator ,
194
+ this . configuration ,
195
+ image . Width ,
196
+ image . Height ,
197
+ this . quality ,
198
+ this . skipMetadata ,
199
+ this . method ,
200
+ this . entropyPasses ,
201
+ this . filterStrength ,
202
+ this . spatialNoiseShaping ,
203
+ this . alphaCompression ) ;
170
204
171
205
enc . EncodeAnimation ( imageFrame , stream ) ;
172
206
}
0 commit comments