* @throws MalformedTagException
* @see SWFWriter#writeMorphFillStyle
*/
private MorphFillStyle readMorphFillStyle(TagType tagType) throws MalformedTagException
{
final MorphFillStyle result = new MorphFillStyle();
final int fillStyleType = bitStream.readUI8();
result.setFillStyleType(fillStyleType);
switch (fillStyleType)
{
case FillStyle.SOLID_FILL:
final RGBA startColor = readRGBA();
final RGBA endColor = readRGBA();
result.setStartColor(startColor);
result.setEndColor(endColor);
break;
case FillStyle.LINEAR_GRADIENT_FILL:
case FillStyle.RADIAL_GRADIENT_FILL:
case FillStyle.FOCAL_RADIAL_GRADIENT_FILL:
final Matrix startGradientMatrix = readMatrix();
final Matrix endGradientMatrix = readMatrix();
final MorphGradient gradient = readMorphGradient();
result.setStartGradientMatrix(startGradientMatrix);
result.setEndGradientMatrix(endGradientMatrix);
result.setGradient(gradient);
if (fillStyleType == FillStyle.FOCAL_RADIAL_GRADIENT_FILL &&
tagType.getValue() == TagType.DefineMorphShape2.getValue())
{
result.setRatio1(bitStream.readSI16());
result.setRatio2(bitStream.readSI16());
}
break;
case FillStyle.REPEATING_BITMAP_FILL:
case FillStyle.CLIPPED_BITMAP_FILL:
case FillStyle.NON_SMOOTHED_REPEATING_BITMAP:
case FillStyle.NON_SMOOTHED_CLIPPED_BITMAP:
final int bitmapId = bitStream.readUI16();
final ICharacterTag bitmap = getTagById(bitmapId, tagType);
final Matrix startBitmapMatrix = readMatrix();
final Matrix endBitmapMatrix = readMatrix();
result.setBitmap(bitmap);
result.setStartBitmapMatrix(startBitmapMatrix);
result.setEndBitmapMatrix(endBitmapMatrix);
break;
default:
problems.add(new SWFUnknownFillStyleProblem(fillStyleType, true,
swfPath, bitStream.getOffset()));
throw new MalformedTagException();