@@ -27,25 +27,25 @@ public static IImageEncoder DetectEncoder(this Image source, string filePath)
27
27
Guard . NotNull ( filePath , nameof ( filePath ) ) ;
28
28
29
29
string ext = Path . GetExtension ( filePath ) ;
30
- if ( ! source . GetConfiguration ( ) . ImageFormatsManager . TryFindFormatByFileExtension ( ext , out IImageFormat ? format ) )
30
+ if ( ! source . Configuration . ImageFormatsManager . TryFindFormatByFileExtension ( ext , out IImageFormat ? format ) )
31
31
{
32
32
StringBuilder sb = new ( ) ;
33
33
sb = sb . AppendLine ( CultureInfo . InvariantCulture , $ "No encoder was found for extension '{ ext } '. Registered encoders include:") ;
34
- foreach ( IImageFormat fmt in source . GetConfiguration ( ) . ImageFormats )
34
+ foreach ( IImageFormat fmt in source . Configuration . ImageFormats )
35
35
{
36
36
sb = sb . AppendFormat ( CultureInfo . InvariantCulture , " - {0} : {1}{2}" , fmt . Name , string . Join ( ", " , fmt . FileExtensions ) , Environment . NewLine ) ;
37
37
}
38
38
39
39
throw new UnknownImageFormatException ( sb . ToString ( ) ) ;
40
40
}
41
41
42
- IImageEncoder ? encoder = source . GetConfiguration ( ) . ImageFormatsManager . GetEncoder ( format ) ;
42
+ IImageEncoder ? encoder = source . Configuration . ImageFormatsManager . GetEncoder ( format ) ;
43
43
44
44
if ( encoder is null )
45
45
{
46
46
StringBuilder sb = new ( ) ;
47
47
sb = sb . AppendLine ( CultureInfo . InvariantCulture , $ "No encoder was found for extension '{ ext } ' using image format '{ format . Name } '. Registered encoders include:") ;
48
- foreach ( KeyValuePair < IImageFormat , IImageEncoder > enc in source . GetConfiguration ( ) . ImageFormatsManager . ImageEncoders )
48
+ foreach ( KeyValuePair < IImageFormat , IImageEncoder > enc in source . Configuration . ImageFormatsManager . ImageEncoders )
49
49
{
50
50
sb = sb . AppendFormat ( CultureInfo . InvariantCulture , " - {0} : {1}{2}" , enc . Key , enc . Value . GetType ( ) . Name , Environment . NewLine ) ;
51
51
}
@@ -76,30 +76,6 @@ public static void AcceptVisitor(this Image source, IImageVisitor visitor)
76
76
public static Task AcceptVisitorAsync ( this Image source , IImageVisitorAsync visitor , CancellationToken cancellationToken = default )
77
77
=> source . AcceptAsync ( visitor , cancellationToken ) ;
78
78
79
- /// <summary>
80
- /// Gets the configuration for the image.
81
- /// </summary>
82
- /// <param name="source">The source image.</param>
83
- /// <returns>Returns the configuration.</returns>
84
- public static Configuration GetConfiguration ( this Image source )
85
- => GetConfiguration ( ( IConfigurationProvider ) source ) ;
86
-
87
- /// <summary>
88
- /// Gets the configuration for the image frame.
89
- /// </summary>
90
- /// <param name="source">The source image.</param>
91
- /// <returns>Returns the configuration.</returns>
92
- public static Configuration GetConfiguration ( this ImageFrame source )
93
- => GetConfiguration ( ( IConfigurationProvider ) source ) ;
94
-
95
- /// <summary>
96
- /// Gets the configuration.
97
- /// </summary>
98
- /// <param name="source">The source image</param>
99
- /// <returns>Returns the bounds of the image</returns>
100
- private static Configuration GetConfiguration ( IConfigurationProvider source )
101
- => source ? . Configuration ?? Configuration . Default ;
102
-
103
79
/// <summary>
104
80
/// Gets the representation of the pixels as a <see cref="IMemoryGroup{T}"/> containing the backing pixel data of the image
105
81
/// stored in row major order, as a list of contiguous <see cref="Memory{T}"/> blocks in the source image's pixel format.
@@ -167,12 +143,4 @@ public static Memory<TPixel> DangerousGetPixelRowMemory<TPixel>(this Image<TPixe
167
143
168
144
return source . Frames . RootFrame . PixelBuffer . GetSafeRowMemory ( rowIndex ) ;
169
145
}
170
-
171
- /// <summary>
172
- /// Gets the <see cref="MemoryAllocator"/> assigned to 'source'.
173
- /// </summary>
174
- /// <param name="source">The source image.</param>
175
- /// <returns>Returns the configuration.</returns>
176
- internal static MemoryAllocator GetMemoryAllocator ( this IConfigurationProvider source )
177
- => GetConfiguration ( source ) . MemoryAllocator ;
178
146
}
0 commit comments