<commit_before>﻿namespace Imageflow.Fluent
{
    public interface IEncoderPreset
    {
        object ToImageflowDynamic();
    }
    
    public class GifEncoder : IEncoderPreset
    {
        public object ToImageflowDynamic() => new {gif = (string)null};
    } 
    /// <summary>
    /// Use LodePngEncoder instead
    /// </summary>
    public class LibPngEncoder : IEncoderPreset
    {
        public AnyColor? Matte { get; set; }
        public int? ZlibCompression { get; set; }
        public PngBitDepth? BitDepth { get; set; }
        public object ToImageflowDynamic() => new {libpng = new { depth = BitDepth?.ToString().ToLowerInvariant(), zlib_compression = ZlibCompression, matte = Matte?.ToImageflowDynamic()}};
    } 
    
    public class PngQuantEncoder : IEncoderPreset
    {
        public int? Quality { get; set; }
        
        public int? MinimumQuality { get; set; }
        
        public int? Speed { get; set; }
        /// <summary>
        /// When true, uses drastically more CPU time for a 1-2% reduction in file size
        /// </summary>
        public bool? MaximumDeflate { get; set; }
        public object ToImageflowDynamic() => new {pngquant = new
        {
            quality = Quality,
            minimum_quality = MinimumQuality,
            speed = Speed,
            maximum_deflate = MaximumDeflate
        }};
    } 


    public class LodePngEncoder : IEncoderPreset
    {
        /// <summary>
        /// When true, uses drastically more CPU time for a 1-2% reduction in file size
        /// </summary>
        public bool? MaximumDeflate { get; set; }
        public object ToImageflowDynamic() => new {lodepng = new { maximum_deflate = MaximumDeflate}};
    } 


    /// <summary>
    /// Deprecated. Use MozJpegEncoder instead
    /// </summary>
    public class LibJpegTurboEncoder : IEncoderPreset
    {
        public int? Quality { get; set; }
        public bool? Progressive { get; set; }
        public bool? OptimizeHuffmanCoding { get; set; }
        
        public object ToImageflowDynamic() => new {libjpegturbo = new { quality = Quality, progressive = Progressive, optimize_huffman_coding = OptimizeHuffmanCoding}};
    }

    public class MozJpegEncoder : IEncoderPreset
    {
        public int? Quality { get; set; }
        public bool? Progressive { get; set; }
        
        public object ToImageflowDynamic() => new {mozjpeg = new { quality = Quality, progressive = Progressive}};
    }
<commit_msg>Add constructors for MozJpegEncoder and PngQuantEncoder<commit_after>﻿namespace Imageflow.Fluent
{
    public interface IEncoderPreset
    {
        object ToImageflowDynamic();
    }
    
    public class GifEncoder : IEncoderPreset
    {
        public object ToImageflowDynamic() => new {gif = (string)null};
    } 
    /// <summary>
    /// Use LodePngEncoder instead
    /// </summary>
    public class LibPngEncoder : IEncoderPreset
    {
        public AnyColor? Matte { get; set; }
        public int? ZlibCompression { get; set; }
        public PngBitDepth? BitDepth { get; set; }
        public object ToImageflowDynamic() => new {libpng = new { depth = BitDepth?.ToString().ToLowerInvariant(), zlib_compression = ZlibCompression, matte = Matte?.ToImageflowDynamic()}};
    } 
    
    public class PngQuantEncoder : IEncoderPreset
    {
        /// <summary>
        /// Try to quantize the PNG first, falling back to lossless PNG if the minimumQuality value cannot be reached
        /// </summary>
        /// <param name="quality">The target visual quality</param>
        /// <param name="minimumQuality">The minimum visual quality below which to revert to lossless encoding</param>
        public PngQuantEncoder(int? quality, int? minimumQuality)
        {
            Quality = quality;
            MinimumQuality = minimumQuality;
        }
        public int? Quality { get; set; }
        
        public int? MinimumQuality { get; set; }
        
        public int? Speed { get; set; }
        /// <summary>
        /// When true, uses drastically more CPU time for a 1-2% reduction in file size
        /// </summary>
        public bool? MaximumDeflate { get; set; }
        public object ToImageflowDynamic() => new {pngquant = new
        {
            quality = Quality,
            minimum_quality = MinimumQuality,
            speed = Speed,
            maximum_deflate = MaximumDeflate
        }};
    } 


    public class LodePngEncoder : IEncoderPreset
    {
        /// <summary>
        /// When true, uses drastically more CPU time for a 1-2% reduction in file size
        /// </summary>
        public bool? MaximumDeflate { get; set; }
        public object ToImageflowDynamic() => new {lodepng = new { maximum_deflate = MaximumDeflate}};
    } 


    /// <summary>
    /// Deprecated. Use MozJpegEncoder instead
    /// </summary>
    public class LibJpegTurboEncoder : IEncoderPreset
    {
        public int? Quality { get; set; }
        public bool? Progressive { get; set; }
        public bool? OptimizeHuffmanCoding { get; set; }
        
        public object ToImageflowDynamic() => new {libjpegturbo = new { quality = Quality, progressive = Progressive, optimize_huffman_coding = OptimizeHuffmanCoding}};
    }

    public class MozJpegEncoder : IEncoderPreset
    {
        public MozJpegEncoder(int quality)
        {
            Quality = quality;
        }
        public MozJpegEncoder(int quality, bool progressive)
        {
            Quality = quality;
            Progressive = progressive;
        }
        public int? Quality { get; set; }
        public bool? Progressive { get; set; }
        
        public object ToImageflowDynamic() => new {mozjpeg = new { quality = Quality, progressive = Progressive}};
    }

{'fraction_non_alphanumeric': 0.09727761401075083, 'fraction_numerical': 0.001387203051846714, 'mean_word_length': 2.1727172717271728, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6186946', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1555, 'n_words': 468}