do not apply color transform when it has the default values

This commit is contained in:
honfika@gmail.com
2016-02-07 10:23:29 +01:00
parent 09a7f68583
commit ab4a7bfbdb
23 changed files with 74 additions and 60 deletions

View File

@@ -114,7 +114,6 @@ import com.jpexs.decompiler.flash.tags.base.SoundTag;
import com.jpexs.decompiler.flash.tags.base.TextImportErrorHandler;
import com.jpexs.decompiler.flash.tags.base.TextTag;
import com.jpexs.decompiler.flash.treeitems.SWFList;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.sound.SoundFormat;
import com.jpexs.decompiler.flash.xfl.FLAVersion;
@@ -1931,7 +1930,7 @@ public class CommandLineArgumentParser {
//displayRect.Ymax *= zoom;
Matrix m = new Matrix();
//m.scale(zoom);
BufferedImage img = SWF.frameToImageGet(ds.getTimeline(), 0, 0, null, 0, displayRect, m, m, new ColorTransform(), Color.white, false, zoom).getBufferedImage();
BufferedImage img = SWF.frameToImageGet(ds.getTimeline(), 0, 0, null, 0, displayRect, m, m, null, Color.white, false, zoom).getBufferedImage();
PageFormat pf = new PageFormat();
pf.setOrientation(PageFormat.PORTRAIT);
Paper p = new Paper();

View File

@@ -27,7 +27,6 @@ import com.jpexs.decompiler.flash.tags.base.ImageTag;
import com.jpexs.decompiler.flash.tags.base.RenderContext;
import com.jpexs.decompiler.flash.timeline.Frame;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.helpers.Cache;
import com.jpexs.helpers.SerializableImage;
@@ -308,7 +307,7 @@ public class FolderPreviewPanel extends JPanel {
zoom = ratio;
}
}
imgSrc = SWF.frameToImageGet(swf.getTimeline(), fn.frame, fn.frame, null, 0, rect, new Matrix(), new Matrix(), new ColorTransform(), null, true, zoom);
imgSrc = SWF.frameToImageGet(swf.getTimeline(), fn.frame, fn.frame, null, 0, rect, new Matrix(), new Matrix(), null, null, true, zoom);
width = imgSrc.getWidth();
height = imgSrc.getHeight();
} else if (treeItem instanceof ImageTag) {
@@ -356,7 +355,7 @@ public class FolderPreviewPanel extends JPanel {
image.fillTransparent();
if (imgSrc == null) {
DrawableTag drawable = (DrawableTag) treeItem;
drawable.toImage(0, 0, 0, new RenderContext(), image, false, m, m, new ColorTransform());
drawable.toImage(0, 0, 0, new RenderContext(), image, false, m, m, null);
} else {
Graphics2D g = (Graphics2D) image.getGraphics();
g.setTransform(m.toTransform());

View File

@@ -40,7 +40,6 @@ import com.jpexs.decompiler.flash.timeline.DepthState;
import com.jpexs.decompiler.flash.timeline.Frame;
import com.jpexs.decompiler.flash.timeline.Timeline;
import com.jpexs.decompiler.flash.timeline.Timelined;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.ConstantColorColorTransform;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.helpers.ByteArrayRange;
@@ -778,7 +777,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
Matrix m = new Matrix();
m.translate(-rect.Xmin * zoom, -rect.Ymin * zoom);
m.scale(zoom);
timeline.toImage(frame, time, frame, renderContext, image, false, m, m, new ColorTransform());
timeline.toImage(frame, time, frame, renderContext, image, false, m, m, null);
Graphics2D gg = (Graphics2D) image.getGraphics();
gg.setStroke(new BasicStroke(3));