diff --git a/CHANGELOG.md b/CHANGELOG.md index db57681ad..6b3155eb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. - SVG Shapes import - non-scaling strokes - Support for DefineShape4 nonzero winding rule - display, svg (import, export), canvas export - Generic tag editor - MORPHLINESTYLE2 has enum selection for cap and join style +- Generic tag editor - Default values for filters ### Fixed - Close action on SWF inside DefineBinaryData diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/BEVELFILTER.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/BEVELFILTER.java index 6e066b10a..717de8ffb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/BEVELFILTER.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/BEVELFILTER.java @@ -36,68 +36,68 @@ public class BEVELFILTER extends FILTER { /** * Color of the shadow */ - public RGBA shadowColor; + public RGBA shadowColor = new RGBA(Color.BLACK); /** * Color of the highlight */ - public RGBA highlightColor; + public RGBA highlightColor = new RGBA(Color.WHITE); /** * Horizontal blur amount */ @SWFType(BasicType.FIXED) - public double blurX; + public double blurX = 5; /** * Vertical blur amount */ @SWFType(BasicType.FIXED) - public double blurY; + public double blurY = 5; /** * Radian angle of the drop shadow */ @SWFType(BasicType.FIXED) - public double angle; + public double angle = 45 * Math.PI / 180; /** * Distance of the drop shadow */ @SWFType(BasicType.FIXED) - public double distance; + public double distance = 5; /** * Strength of the drop shadow */ @SWFType(BasicType.FIXED8) - public float strength; + public float strength = 1f; /** * Inner shadow mode */ - public boolean innerShadow; + public boolean innerShadow = true; /** * Knockout mode */ - public boolean knockout; + public boolean knockout = false; /** * Composite source */ - public boolean compositeSource; + public boolean compositeSource = true; /** * OnTop mode */ - public boolean onTop; + public boolean onTop = false; /** * Number of blur passes */ @SWFType(value = BasicType.UB, count = 4) - public int passes; + public int passes = 1; /** * Constructor diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/BLURFILTER.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/BLURFILTER.java index 630e43561..892fd9abd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/BLURFILTER.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/BLURFILTER.java @@ -38,19 +38,19 @@ public class BLURFILTER extends FILTER { * Horizontal blur amount */ @SWFType(BasicType.FIXED) - public double blurX; + public double blurX = 5; /** * Vertical blur amount */ @SWFType(BasicType.FIXED) - public double blurY; + public double blurY = 5; /** * Number of blur passes */ @SWFType(value = BasicType.UB, count = 5) - public int passes; + public int passes = 1; @Reserved @SWFType(value = BasicType.UB, count = 3) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/CONVOLUTIONFILTER.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/CONVOLUTIONFILTER.java index 95748eb3a..d6ddc82e4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/CONVOLUTIONFILTER.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/CONVOLUTIONFILTER.java @@ -63,7 +63,11 @@ public class CONVOLUTIONFILTER extends FILTER { * Matrix values */ @SWFType(BasicType.FLOAT) - public float[] matrix = new float[9]; + public float[] matrix = new float[] { + 0, 0, 0, + 0, 1, 0, + 0, 0, 0 + }; /** * Default color for pixels outside the image diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/DROPSHADOWFILTER.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/DROPSHADOWFILTER.java index 6dae52917..2e7e8632c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/DROPSHADOWFILTER.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/DROPSHADOWFILTER.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.RGBA; import com.jpexs.decompiler.flash.types.annotations.SWFType; import com.jpexs.helpers.SerializableImage; +import java.awt.Color; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -35,58 +36,58 @@ public class DROPSHADOWFILTER extends FILTER { /** * Color of the shadow */ - public RGBA dropShadowColor; + public RGBA dropShadowColor = new RGBA(Color.BLACK); /** * Horizontal blur amount */ @SWFType(BasicType.FIXED) - public double blurX; + public double blurX = 5; /** * Vertical blur amount */ @SWFType(BasicType.FIXED) - public double blurY; + public double blurY = 5; /** * Radian angle of the drop shadow */ @SWFType(BasicType.FIXED) - public double angle; + public double angle = 45 * Math.PI / 180; /** * Distance of the drop shadow */ @SWFType(BasicType.FIXED) - public double distance; + public double distance = 5; /** * Strength of the drop shadow */ @SWFType(BasicType.FIXED8) - public float strength; + public float strength = 1f; /** * Inner shadow mode */ - public boolean innerShadow; + public boolean innerShadow = false; /** * Knockout mode */ - public boolean knockout; + public boolean knockout = false; /** * Composite source */ - public boolean compositeSource; + public boolean compositeSource = true; /** * Number of blur passes */ @SWFType(value = BasicType.UB, count = 5) - public int passes; + public int passes = 1; /** * Constructor diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GLOWFILTER.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GLOWFILTER.java index 72a50fac5..722a427ac 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GLOWFILTER.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GLOWFILTER.java @@ -16,12 +16,12 @@ */ package com.jpexs.decompiler.flash.types.filters; -import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.RGBA; import com.jpexs.decompiler.flash.types.annotations.SWFType; import com.jpexs.helpers.SerializableImage; +import java.awt.Color; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -35,46 +35,46 @@ public class GLOWFILTER extends FILTER { /** * Color of the shadow */ - public RGBA glowColor; + public RGBA glowColor = new RGBA(Color.RED); /** * Horizontal blur amount */ @SWFType(BasicType.FIXED) - public double blurX; + public double blurX = 5; /** * Vertical blur amount */ @SWFType(BasicType.FIXED) - public double blurY; + public double blurY = 5; /** * Strength of the glow */ @SWFType(BasicType.FIXED8) - public float strength; + public float strength = 1; /** * Inner glow mode */ - public boolean innerGlow; + public boolean innerGlow = false; /** * Knockout mode */ - public boolean knockout; + public boolean knockout = false; /** * Composite source */ - public boolean compositeSource; + public boolean compositeSource = true; /** * Number of blur passes */ @SWFType(value = BasicType.UB, count = 5) - public int passes; + public int passes = 1; /** * Constructor diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GRADIENTBEVELFILTER.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GRADIENTBEVELFILTER.java index 3cbf3161e..abaa29512 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GRADIENTBEVELFILTER.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GRADIENTBEVELFILTER.java @@ -38,69 +38,75 @@ public class GRADIENTBEVELFILTER extends FILTER { * Gradient colors */ @SWFType(countField = "numColors") - public RGBA[] gradientColors = new RGBA[0]; + public RGBA[] gradientColors = new RGBA[] { + new RGBA(Color.WHITE), + new RGBA(255, 0, 0, 0), + new RGBA(Color.BLACK) + }; /** * Gradient ratios */ @SWFType(value = BasicType.UI8, countField = "numColors") - public int[] gradientRatio = new int[0]; + public int[] gradientRatio = new int[] { + 0, 128, 255 + }; /** * Horizontal blur amount */ @SWFType(BasicType.FIXED) - public double blurX; + public double blurX = 5; /** * Vertical blur amount */ @SWFType(BasicType.FIXED) - public double blurY; + public double blurY = 5; /** * Radian angle of the gradient bevel */ @SWFType(BasicType.FIXED) - public double angle; + public double angle = 45 * Math.PI / 180; /** * Distance of the gradient bevel */ @SWFType(BasicType.FIXED) - public double distance; + public double distance = 5; /** * Strength of the gradient bevel */ @SWFType(BasicType.FIXED8) - public float strength; + public float strength = 1; /** * Inner bevel mode */ - public boolean innerShadow; + public boolean innerShadow = true; /** * Knockout mode */ - public boolean knockout; + public boolean knockout = false; /** * Composite source */ - public boolean compositeSource; + public boolean compositeSource = true; /** * OnTop mode */ - public boolean onTop; + public boolean onTop = false; /** * Number of blur passes */ @SWFType(value = BasicType.UB, count = 4) - public int passes; + public int passes = 1; public GRADIENTBEVELFILTER() { super(7); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GRADIENTGLOWFILTER.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GRADIENTGLOWFILTER.java index 8a2540969..cdbc2c611 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GRADIENTGLOWFILTER.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/GRADIENTGLOWFILTER.java @@ -38,69 +38,74 @@ public class GRADIENTGLOWFILTER extends FILTER { * Gradient colors */ @SWFType(countField = "numColors") - public RGBA[] gradientColors = new RGBA[0]; + public RGBA[] gradientColors = new RGBA[] { + new RGBA(255, 255, 255, 0), + new RGBA(Color.BLACK) + }; /** * Gradient ratios */ @SWFType(value = BasicType.UI8, countField = "numColors") - public int[] gradientRatio; + public int[] gradientRatio = new int[] { + 0, 255 + }; /** * Horizontal blur amount */ @SWFType(BasicType.FIXED) - public double blurX; + public double blurX = 5; /** * Vertical blur amount */ @SWFType(BasicType.FIXED) - public double blurY; + public double blurY = 5; /** * Radian angle of the gradient glow */ @SWFType(BasicType.FIXED) - public double angle; + public double angle = 45 * Math.PI / 180; /** * Distance of the gradient glow */ @SWFType(BasicType.FIXED) - public double distance; + public double distance = 5; /** * Strength of the gradient glow */ @SWFType(BasicType.FIXED8) - public float strength; + public float strength = 1; /** * Inner glow mode */ - public boolean innerShadow; + public boolean innerShadow = false; /** * Knockout mode */ - public boolean knockout; + public boolean knockout = false; /** * Composite source */ - public boolean compositeSource; + public boolean compositeSource = true; /** * OnTop mode */ - public boolean onTop; + public boolean onTop = false; /** * Number of blur passes */ @SWFType(value = BasicType.UB, count = 4) - public int passes; + public int passes = 1; /** * Constructor