frame SVG export: opacity fixed

This commit is contained in:
Honfika
2014-04-20 10:11:15 +02:00
parent 2fe575a1d5
commit 9a90572312
10 changed files with 21 additions and 70 deletions

View File

@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.AsTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.AsTypeLateIns;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;

View File

@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.abc.avm2.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.IsTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.IsTypeLateIns;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;

View File

@@ -331,15 +331,15 @@ public class DefineMorphShape2Tag extends CharacterTag implements MorphShapeTag
@Override
public String toSVG(SVGExporterContext exporterContext, int ratio, ColorTransform colorTransform, int level) {
ExportRectangle rect = new ExportRectangle(getRect());
SVGExporter svgExporter = new SVGExporter(rect, new ColorTransform());
SVGExporter svgExporter = new SVGExporter(rect, colorTransform);
if (ratio == -2) {
SHAPEWITHSTYLE beginShapes = getShapeAtRatio(0);
SHAPEWITHSTYLE endShapes = getShapeAtRatio(65535);
SVGMorphShapeExporter exporter = new SVGMorphShapeExporter(swf, beginShapes, endShapes, svgExporter, null, new ColorTransform() /*FIXME?*/);
SVGMorphShapeExporter exporter = new SVGMorphShapeExporter(swf, beginShapes, endShapes, svgExporter, null, colorTransform);
exporter.export();
} else {
SHAPEWITHSTYLE shapes = getShapeAtRatio(ratio);
SVGShapeExporter exporter = new SVGShapeExporter(swf, shapes, svgExporter, null, new ColorTransform() /*FIXME?*/);
SVGShapeExporter exporter = new SVGShapeExporter(swf, shapes, svgExporter, null, colorTransform);
exporter.export();
}
return svgExporter.getSVG();

View File

@@ -314,15 +314,15 @@ public class DefineMorphShapeTag extends CharacterTag implements MorphShapeTag {
@Override
public String toSVG(SVGExporterContext exporterContext, int ratio, ColorTransform colorTransform, int level) {
ExportRectangle rect = new ExportRectangle(getRect());
SVGExporter svgExporter = new SVGExporter(rect, new ColorTransform());
SVGExporter svgExporter = new SVGExporter(rect, colorTransform);
if (ratio == -2) {
SHAPEWITHSTYLE beginShapes = getShapeAtRatio(0);
SHAPEWITHSTYLE endShapes = getShapeAtRatio(65535);
SVGMorphShapeExporter exporter = new SVGMorphShapeExporter(swf, beginShapes, endShapes, svgExporter, null, new ColorTransform() /*FIXME?*/);
SVGMorphShapeExporter exporter = new SVGMorphShapeExporter(swf, beginShapes, endShapes, svgExporter, null, colorTransform);
exporter.export();
} else {
SHAPEWITHSTYLE shapes = getShapeAtRatio(ratio);
SVGShapeExporter exporter = new SVGShapeExporter(swf, shapes, svgExporter, null, new ColorTransform() /*FIXME?*/);
SVGShapeExporter exporter = new SVGShapeExporter(swf, shapes, svgExporter, null, colorTransform);
exporter.export();
}
return svgExporter.getSVG();

View File

@@ -18,13 +18,8 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.exporters.ExportRectangle;
import com.jpexs.decompiler.flash.exporters.SVGExporter;
import com.jpexs.decompiler.flash.exporters.SVGExporterContext;
import com.jpexs.decompiler.flash.exporters.shape.SVGShapeExporter;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
@@ -55,15 +50,6 @@ public class DefineShape2Tag extends ShapeTag {
return shapes.getNeededCharacters();
}
@Override
public String toSVG(SVGExporterContext exporterContext, int ratio, ColorTransform colorTransform, int level) {
ExportRectangle rect = new ExportRectangle(getRect());
SVGExporter svgExporter = new SVGExporter(rect, new ColorTransform());
SVGShapeExporter exporter = new SVGShapeExporter(swf, getShapes(), svgExporter, null, new ColorTransform() /*FIXME?*/);
exporter.export();
return svgExporter.getSVG();
}
@Override
public int getCharacterId() {
return shapeId;

View File

@@ -18,13 +18,8 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.exporters.ExportRectangle;
import com.jpexs.decompiler.flash.exporters.SVGExporter;
import com.jpexs.decompiler.flash.exporters.SVGExporterContext;
import com.jpexs.decompiler.flash.exporters.shape.SVGShapeExporter;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
@@ -60,19 +55,6 @@ public class DefineShape3Tag extends ShapeTag {
return shapeBounds;
}
@Override
public String toSVG(SVGExporterContext exporterContext, int ratio, ColorTransform colorTransform, int level) {
ExportRectangle rect = new ExportRectangle(getRect());
SVGExporter svgExporter = new SVGExporter(rect, new ColorTransform());
SVGShapeExporter exporter = new SVGShapeExporter(swf, getShapes(), svgExporter, null, new ColorTransform() /*FIXME?*/);
exporter.export();
return svgExporter.getSVG();
}
/* @Override
public void toImage(int frame, int ratio, java.awt.Point mousePos, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) {
BitmapExporter.exportTo(swf, getShapes(), null, image, transformation, colorTransform);
}*/
@Override
public int getCharacterId() {
return shapeId;

View File

@@ -18,13 +18,8 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.exporters.ExportRectangle;
import com.jpexs.decompiler.flash.exporters.SVGExporter;
import com.jpexs.decompiler.flash.exporters.SVGExporterContext;
import com.jpexs.decompiler.flash.exporters.shape.SVGShapeExporter;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
@@ -63,15 +58,6 @@ public class DefineShape4Tag extends ShapeTag {
return shapes.getNeededCharacters();
}
@Override
public String toSVG(SVGExporterContext exporterContext, int ratio, ColorTransform colorTransform, int level) {
ExportRectangle rect = new ExportRectangle(getRect());
SVGExporter svgExporter = new SVGExporter(rect, new ColorTransform());
SVGShapeExporter exporter = new SVGShapeExporter(swf, getShapes(), svgExporter, null, new ColorTransform() /*FIXME?*/);
exporter.export();
return svgExporter.getSVG();
}
@Override
public int getCharacterId() {
return shapeId;

View File

@@ -19,13 +19,8 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.exporters.ExportRectangle;
import com.jpexs.decompiler.flash.exporters.SVGExporter;
import com.jpexs.decompiler.flash.exporters.SVGExporterContext;
import com.jpexs.decompiler.flash.exporters.shape.SVGShapeExporter;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
@@ -93,15 +88,6 @@ public class DefineShapeTag extends ShapeTag {
return shapeId;
}
@Override
public String toSVG(SVGExporterContext exporterContext, int ratio, ColorTransform colorTransform, int level) {
ExportRectangle rect = new ExportRectangle(getRect());
SVGExporter svgExporter = new SVGExporter(rect, new ColorTransform());
SVGShapeExporter exporter = new SVGShapeExporter(swf, getShapes(), svgExporter, null, new ColorTransform() /*FIXME?*/);
exporter.export();
return svgExporter.getSVG();
}
@Override
public int getNumFrames() {
return 1;

View File

@@ -18,7 +18,11 @@ package com.jpexs.decompiler.flash.tags.base;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.exporters.BitmapExporter;
import com.jpexs.decompiler.flash.exporters.ExportRectangle;
import com.jpexs.decompiler.flash.exporters.Matrix;
import com.jpexs.decompiler.flash.exporters.SVGExporter;
import com.jpexs.decompiler.flash.exporters.SVGExporterContext;
import com.jpexs.decompiler.flash.exporters.shape.SVGShapeExporter;
import com.jpexs.decompiler.flash.timeline.DepthState;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
@@ -48,4 +52,13 @@ public abstract class ShapeTag extends CharacterTag implements BoundedTag, Drawa
public void toImage(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, SerializableImage image, Matrix transformation, ColorTransform colorTransform) {
BitmapExporter.export(swf, getShapes(), null, image, transformation, colorTransform);
}
@Override
public String toSVG(SVGExporterContext exporterContext, int ratio, ColorTransform colorTransform, int level) {
ExportRectangle rect = new ExportRectangle(getRect());
SVGExporter svgExporter = new SVGExporter(rect, colorTransform);
SVGShapeExporter exporter = new SVGShapeExporter(swf, getShapes(), svgExporter, null, colorTransform);
exporter.export();
return svgExporter.getSVG();
}
}

View File

@@ -312,7 +312,7 @@ public abstract class TextTag extends CharacterTag implements BoundedTag, Drawab
int x = 0;
int y = 0;
List<SHAPE> glyphs = new ArrayList<>();
SVGExporter svgExporter = new SVGExporter(null, new ColorTransform());
SVGExporter svgExporter = new SVGExporter(null, colorTransform);
for (TEXTRECORD rec : textRecords) {
if (rec.styleFlagsHasColor) {
if (numText == 2) {
@@ -341,7 +341,7 @@ public abstract class TextTag extends CharacterTag implements BoundedTag, Drawab
// shapeNum: 1
SHAPE shape = glyphs.get(entry.glyphIndex);
svgExporter.createNewGroup(mat);
SVGShapeExporter exporter = new SVGShapeExporter(swf, shape, svgExporter, textColor, new ColorTransform() /*FIXME?*/);
SVGShapeExporter exporter = new SVGShapeExporter(swf, shape, svgExporter, textColor, colorTransform);
exporter.export();
x += entry.glyphAdvance;
}