Example #1
0
 public PaaFileType(IFileTypeHost host)
     : base("PAA texture", new FileTypeOptions()
 {
     LoadExtensions = new[] { ".paa" },
     SaveExtensions = new[] { ".paa" },
     SupportsLayers = false
 })
 {
     this.host = host;
 }
Example #2
0
 public WebPFileType(IFileTypeHost host)
     : base("WebP",
            new FileTypeOptions
 {
     LoadExtensions = new string[] { ".webp" },
     SaveExtensions = new string[] { ".webp" }
 })
 {
     if (host != null)
     {
         strings = new PdnLocalizedStringResourceManager(host.Services.GetService <PaintDotNet.WebP.IWebPFileTypeStrings>());
     }
     else
     {
         strings = new BuiltinStringResourceManager();
     }
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AvifFileTypePlugin"/> class.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="maxEncoderThreads">The maximum number of encoder threads.</param>
        public AvifFileTypePlugin(IFileTypeHost host, int?maxEncoderThreads)
            : base(
                "AV1 (AVIF)",
                new FileTypeOptions
        {
            LoadExtensions       = new string[] { ".avif" },
            SaveExtensions       = new string[] { ".avif" },
            SupportsCancellation = true,
            SupportsLayers       = false
        })
        {
            PaintDotNet.Avif.IAvifFileTypeStrings avifFileTypeStrings = host?.Services.GetService <PaintDotNet.Avif.IAvifFileTypeStrings>();

            if (avifFileTypeStrings != null)
            {
                this.strings = new PdnLocalizedStringResourceManager(avifFileTypeStrings);
            }
            else
            {
                this.strings = new BuiltinStringResourceManager();
            }
            this.maxEncoderThreadsOverride = maxEncoderThreads;
            this.byteArrayPool             = new Lazy <IByteArrayPool>(() => new ByteArrayPool());
        }
Example #4
0
 public FileType[] GetFileTypeInstances(IFileTypeHost host)
 {
     return(new FileType[] { new DdsFileType(host.Services) });
 }
Example #5
0
 public FileType[] GetFileTypeInstances(IFileTypeHost host)
 {
     return(new FileType[] { new WebPFileType(host) });
 }
Example #6
0
 public FileType[] GetFileTypeInstances(IFileTypeHost host)
 {
     // Tell PDN we exist and are a usable file type
     return(new FileType[] { new DMIFileType() });
 }
Example #7
0
 public FileType[] GetFileTypeInstances(IFileTypeHost host)
 {
     return(new[] { new AvifFileTypePlugin(host) });
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AvifFileTypePlugin"/> class.
 /// </summary>
 /// <param name="host">The host.</param>
 public AvifFileTypePlugin(IFileTypeHost host)
     : this(host, null)
 {
 }