Class for defines that are used when a png image is read.
Наследование: DefineCreator, IReadDefines
Пример #1
0
    public void Test_PreserveiCCP_SwapBytes()
    {
      PngReadDefines defines = new PngReadDefines()
      {
        PreserveiCCP = true,
        SwapBytes = false
      };

      using (MagickImage image = new MagickImage())
      {
        image.Settings.SetDefines(defines);

        Assert.AreEqual("True", image.Settings.GetDefine(MagickFormat.Png, "preserve-iCCP"));
        Assert.AreEqual(null, image.Settings.GetDefine(MagickFormat.Png, "swap-bytes"));
      }

      defines = new PngReadDefines()
      {
        PreserveiCCP = false,
        SwapBytes = true
      };

      using (MagickImage image = new MagickImage())
      {
        image.Settings.SetDefines(defines);

        Assert.AreEqual(null, image.Settings.GetDefine(MagickFormat.Png, "preserve-iCCP"));
        Assert.AreEqual("True", image.Settings.GetDefine(MagickFormat.Png, "swap-bytes"));
      }
    }
Пример #2
0
        private IDefines CreatePngReadDefines(XmlElement element)
        {
            if (element == null)
            {
                return(null);
            }
            PngReadDefines result = new PngReadDefines();

            result.PreserveiCCP = Variables.GetValue <Boolean>(element, "preserveiCCP");
            result.SkipProfiles = Variables.GetValue <Nullable <ImageMagick.Defines.ProfileTypes> >(element, "skipProfiles");
            result.SwapBytes    = Variables.GetValue <Boolean>(element, "swapBytes");
            return(result);
        }
Пример #3
0
        private IDefines CreatePngReadDefines(XmlElement element)
        {
            if (element == null)
            {
                return(null);
            }
            PngReadDefines result = new PngReadDefines();

            result.ChunkCacheMax  = GetValue <Nullable <Int64> >(element, "chunkCacheMax");
            result.ChunkMallocMax = GetValue <Nullable <Int64> >(element, "chunkMallocMax");
            result.IgnoreCrc      = GetValue <Boolean>(element, "ignoreCrc");
            result.PreserveiCCP   = GetValue <Boolean>(element, "preserveiCCP");
            result.SkipProfiles   = GetValue <Nullable <ImageMagick.Defines.ProfileTypes> >(element, "skipProfiles");
            result.SwapBytes      = GetValue <Boolean>(element, "swapBytes");
            return(result);
        }
Пример #4
0
 private IDefines CreatePngReadDefines(XmlElement element)
 {
   if (element == null)
     return null;
   PngReadDefines result = new PngReadDefines();
   result.PreserveCorruptImage = Variables.GetValue<Boolean>(element, "preserveCorruptImage");
   result.PreserveiCCP = Variables.GetValue<Boolean>(element, "preserveiCCP");
   result.SkipProfiles = Variables.GetValue<Nullable<ImageMagick.Defines.ProfileTypes>>(element, "skipProfiles");
   result.SwapBytes = Variables.GetValue<Boolean>(element, "swapBytes");
   return result;
 }