File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
tests/ImageSharp.Tests/Formats/Jpg Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,35 @@ static void RunTest(string arg)
104
104
}
105
105
}
106
106
107
+ [ Fact ]
108
+ public void GetConverterReturnsCorrectConverterWithGrayScaleColorSpace ( )
109
+ {
110
+ FeatureTestRunner . RunWithHwIntrinsicsFeature (
111
+ RunTest ,
112
+ HwIntrinsics . AllowAll | HwIntrinsics . DisableAVX2 | HwIntrinsics . DisableSSE2 | HwIntrinsics . DisableHWIntrinsic ) ;
113
+
114
+ static void RunTest ( string arg )
115
+ {
116
+ // arrange
117
+ Type expectedType = typeof ( JpegColorConverterBase . GrayscaleScalar ) ;
118
+ if ( Avx . IsSupported )
119
+ {
120
+ expectedType = typeof ( JpegColorConverterBase . GrayscaleAvx ) ;
121
+ }
122
+ else if ( Sse2 . IsSupported )
123
+ {
124
+ expectedType = typeof ( JpegColorConverterBase . GrayScaleVector ) ;
125
+ }
126
+
127
+ // act
128
+ JpegColorConverterBase converter = JpegColorConverterBase . GetConverter ( JpegColorSpace . Grayscale , 8 ) ;
129
+ Type actualType = converter . GetType ( ) ;
130
+
131
+ // assert
132
+ Assert . Equal ( expectedType , actualType ) ;
133
+ }
134
+ }
135
+
107
136
[ Fact ]
108
137
public void GetConverterReturnsCorrectConverterWithCmykColorSpace ( )
109
138
{
You can’t perform that action at this time.
0 commit comments