mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-21 03:15:20 +08:00
added shortcuts to standard formats as static properties of ImageFormat and AudioFormat.
namely, ImageFormat.Jpeg ImageFormat.Png ImageFormat.Bmp AudioFormat.Wav
This commit is contained in:
@@ -178,5 +178,18 @@ namespace GameRes
|
||||
{
|
||||
get { return this.GetType().Assembly == typeof(ImageFormat).Assembly; }
|
||||
}
|
||||
|
||||
public static ImageFormat FindByTag (string tag)
|
||||
{
|
||||
return FormatCatalog.Instance.ImageFormats.FirstOrDefault (x => x.Tag == tag);
|
||||
}
|
||||
|
||||
static readonly Lazy<ImageFormat> s_JpegFormat = new Lazy<ImageFormat> (() => FindByTag ("JPEG"));
|
||||
static readonly Lazy<ImageFormat> s_PngFormat = new Lazy<ImageFormat> (() => FindByTag ("PNG"));
|
||||
static readonly Lazy<ImageFormat> s_BmpFormat = new Lazy<ImageFormat> (() => FindByTag ("BMP"));
|
||||
|
||||
public static ImageFormat Jpeg { get { return s_JpegFormat.Value; } }
|
||||
public static ImageFormat Png { get { return s_PngFormat.Value; } }
|
||||
public static ImageFormat Bmp { get { return s_BmpFormat.Value; } }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user