Class for defines that are used when a png image is read.
Inheritance: DefineCreator, IReadDefines
Ejemplo n.º 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"));
      }
    }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
 }