// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using SharpDX.Win32; namespace SharpDX.WIC { /// /// BitmapEncoderOptions used for encoding. /// public class BitmapEncoderOptions : PropertyBag { /// /// Initializes a new instance of the class. /// /// The property bag pointer. public BitmapEncoderOptions(IntPtr propertyBagPointer) : base(propertyBagPointer) { } /// /// Gets or sets the image quality. /// /// /// The image quality. /// /// /// Range value: 0-1.0f /// Applicable Codecs: JPEG, HDPhoto /// public float ImageQuality { get { return Get(ImageQualityKey); } set { Set(ImageQualityKey, value);} } private static readonly PropertyBagKey ImageQualityKey = new PropertyBagKey("ImageQuality"); /// /// Gets or sets the compression quality. /// /// /// The compression quality. /// /// /// Range value: 0-1.0f /// Applicable Codecs: TIFF /// public float CompressionQuality { get { return Get(CompressionQualityKey); } set { Set(CompressionQualityKey, value); } } private static readonly PropertyBagKey CompressionQualityKey = new PropertyBagKey("CompressionQuality"); /// /// Gets or sets a value indicating whether loss less compression is enabled. /// /// /// true if [loss less]; otherwise, false. /// /// /// Range value: true-false /// Applicable Codecs: HDPhoto /// public bool LossLess { get { return Get(LosslessKey); } set { Set(LosslessKey, value); } } private static readonly PropertyBagKey LosslessKey = new PropertyBagKey("Lossless"); /// /// Gets or sets the bitmap transform. /// /// /// The bitmap transform. /// /// /// Range value: /// Applicable Codecs: JPEG /// public BitmapTransformOptions BitmapTransform { get { return Get(BitmapTransformKey); } set { Set(BitmapTransformKey, value); } } private static readonly PropertyBagKey BitmapTransformKey = new PropertyBagKey("BitmapTransform"); /// /// Gets or sets a value indicating whether [interlace option]. /// /// /// true if [interlace option]; otherwise, false. /// /// /// Range value: true-false /// Applicable Codecs: PNG /// public bool InterlaceOption { get { return Get(InterlaceOptionKey); } set { Set(InterlaceOptionKey, value); } } private static readonly PropertyBagKey InterlaceOptionKey = new PropertyBagKey("InterlaceOption"); /// /// Gets or sets the filter option. /// /// /// The filter option. /// /// /// Range value: /// Applicable Codecs: PNG /// public PngFilterOption FilterOption { get { return Get(FilterOptionKey); } set { Set(FilterOptionKey, value); } } private static readonly PropertyBagKey FilterOptionKey = new PropertyBagKey("FilterOption"); /// /// Gets or sets the TIFF compression method. /// /// /// The TIFF compression method. /// /// /// Range value: /// Applicable Codecs: TIFF /// public TiffCompressionOption TiffCompressionMethod { get { return Get(TiffCompressionMethodKey); } set { Set(TiffCompressionMethodKey, value); } } private static readonly PropertyBagKey TiffCompressionMethodKey = new PropertyBagKey("TiffCompressionMethod"); /// /// Gets or sets the luminance. /// /// /// The luminance. /// /// /// Range value: 64 Entries (DCT) /// Applicable Codecs: JPEG /// public uint[] Luminance { get { return Get(LuminanceKey); } set { Set(LuminanceKey, value); } } private static readonly PropertyBagKey LuminanceKey = new PropertyBagKey("Luminance"); /// /// Gets or sets the chrominance. /// /// /// The chrominance. /// /// /// Range value: 64 Entries (DCT) /// Applicable Codecs: JPEG /// public uint[] Chrominance { get { return Get(ChrominanceKey); } set { Set(ChrominanceKey, value); } } private static readonly PropertyBagKey ChrominanceKey = new PropertyBagKey("Chrominance"); /// /// Gets or sets the JPEG Y Cr Cb subsampling. /// /// /// The JPEG Y Cr Cb subsampling. /// /// /// Range value: /// Applicable Codecs: JPEG /// public JpegYCrCbSubsamplingOption JpegYCrCbSubsampling { get { return Get(JpegYCrCbSubsamplingKey); } set { Set(JpegYCrCbSubsamplingKey, value); } } private static readonly PropertyBagKey JpegYCrCbSubsamplingKey = new PropertyBagKey("JpegYCrCbSubsampling"); /// /// Gets or sets a value indicating whether [suppress app0]. /// /// /// true if [suppress app0]; otherwise, false. /// /// /// Range value: true-false /// Applicable Codecs: JPEG /// public bool SuppressApp0 { get { return Get(SuppressApp0Key); } set { Set(SuppressApp0Key, value); } } private static readonly PropertyBagKey SuppressApp0Key = new PropertyBagKey("SuppressApp0"); } }