Package tv.porst.splib.binaryparser

Examples of tv.porst.splib.binaryparser.UINT16


public class AS3DataParser {

  public static AS3Data parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    final UINT16 minorVersion = parseUINT16(parser, 0x00006, fieldName + "::minor_version");
    final UINT16 majorVersion = parseUINT16(parser, 0x00006, fieldName + "::major_version");
    final ConstantPool constantPool = ConstantPoolParser.parse(parser, fieldName + "::constant_pool");

    final EncodedU30 methodCount = EncodedU30Parser.parse(parser, fieldName + "::method_count");

    final List<MethodInfo> methodInfos = new ArrayList<MethodInfo>();
View Full Code Here


   *
   * @throws SWFParserException Thrown if the structure could not be parsed.
   */
  public static MorphLineStyle2 parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    final UINT16 startWidth = parseUINT16(parser, 0x00006, fieldName + "::StartWidth");
    final UINT16 endWidth = parseUINT16(parser, 0x00006, fieldName + "::EndWidth");
    final UBits startCapStyle = parseUBits(parser, 2, 0x00006, fieldName + "::StartCapStyle");
    final UBits joinStyle = parseUBits(parser, 2, 0x00006, fieldName + "::JoinStyle");
    final Flag hasFillFlag = parseFlag(parser, 0x00006, fieldName + "::HasFillFlag");
    final Flag noHScaleFlag = parseFlag(parser, 0x00006, fieldName + "::NoHScaleFlag");
    final Flag noVScaleFlag = parseFlag(parser, 0x00006, fieldName + "::NoVScaleFlag");
    final Flag pixelHintingFlag = parseFlag(parser, 0x00006, fieldName + "::PixelHintingFlag");
    final UBits reserved = parseUBits(parser, 5, 0x00006, fieldName + "::Reserved");
    final Flag noClose = parseFlag(parser, 0x00006, fieldName + "::NoClose");
    final UBits endCapStyle = parseUBits(parser, 2, 0x00006, fieldName + "::EndCapStyle");
    final UINT16 miterLimitFactor = parseUINT16If(parser, 0x00006, joinStyle.value() == 2, fieldName + "::MiterLimitFactor");
    final RGBA startColor = RGBAParser.parseIf(parser, !hasFillFlag.value(), fieldName + "::StartColor");
    final RGBA endColor = RGBAParser.parseIf(parser, !hasFillFlag.value(), fieldName + "::EndColor");
    final MorphFillStyle fillType = MorphFillStyleParser.parseIf(parser, hasFillFlag, fieldName + "::FillType");

    return new MorphLineStyle2(startWidth, endWidth, startCapStyle, joinStyle, hasFillFlag,
View Full Code Here

   *
   * @throws SWFParserException Thrown if the structure could not be parsed.
   */
  public static MorphLineStyle parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    final UINT16 startWidth = parseUINT16(parser, 0x00006, fieldName + "::StartWidth");
    final UINT16 endWidth = parseUINT16(parser, 0x00006, fieldName + "::EndWidth");
    final RGBA startColor = RGBAParser.parse(parser, fieldName + "::StartColor");
    final RGBA endColor = RGBAParser.parse(parser, fieldName + "::EndColor");

    return new MorphLineStyle(startWidth, endWidth, startColor, endColor);
  }
View Full Code Here

   * @throws SWFParserException Thrown if the structure could not be parsed.
   */
  public static SoundEnvelope parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    final UINT32 pos44 = parseUINT32(parser, 0x00006, fieldName + "::Pos44");
    final UINT16 leftLevel = parseUINT16(parser, 0x00006, fieldName + "LeftLevel");
    final UINT16 rightLevel = parseUINT16(parser, 0x00006, fieldName + "RightLevel");

    return new SoundEnvelope(pos44, leftLevel, rightLevel);
  }
View Full Code Here

public class ActionDefineFunction2Parser {

  public static ActionDefineFunction2 parse(final SWFBinaryParser parser, final UINT8 actionCode, final String fieldName) throws SWFParserException {

    final UINT16 length = parseUINT16(parser, 0x00006, fieldName + "::Length");
    final AsciiString functionName = parseString(parser, 0x00006, "::FunctionName");
    final UINT16 numParams = parseUINT16(parser, 0x00006, fieldName + "::NumParams");
    final UINT8 registerCount = parseUINT8(parser, 0x00006, fieldName + "::RegisterCount");
    final Flag preloadParentFlag = parseFlag(parser, 0x00006, fieldName + "::PreloadParentFlag");
    final Flag preloadRootFlag = parseFlag(parser, 0x00006, fieldName + "::PreloadRootFlag");
    final Flag suppressSuperFlag = parseFlag(parser, 0x00006, fieldName + "::SuppressSuperFlag");
    final Flag preloadSuperFlag = parseFlag(parser, 0x00006, fieldName + "::PreloadSuperFlag");
    final Flag suppressArgumentsFlag = parseFlag(parser, 0x00006, fieldName + "::SuppressArgumentsFlag");
    final Flag preloadArgumentsFlag = parseFlag(parser, 0x00006, fieldName + "::PreloadArgumentsFlag");
    final Flag suppressThisFlag = parseFlag(parser, 0x00006, fieldName + "::SuppressThisFlag");
    final Flag preloadThisFlag = parseFlag(parser, 0x00006, fieldName + "::PreloadThisFlag");
    final UBits reserved = parseUBits(parser, 7, 0x00006, fieldName + "::Reserved");
    final Flag preloadGlobalFlag = parseFlag(parser, 0x00006, fieldName + "::PreloadGlobalFlag");

    final List<RegisterParam> registerParams = new ArrayList<RegisterParam>();

    for (int i=0;i<numParams.value();i++) {
      registerParams.add(RegisterParamParser.parse(parser, fieldName + String.format("::RegisterParams[%d]", i)));
    }

    final UINT16 codeSize = parseUINT16(parser, 0x00006, fieldName + "::CodeSize");

    final List<Action> code = ActionRecordParser.parse(parser, codeSize.value(), fieldName + "::Code");

    return new ActionDefineFunction2(actionCode, length, functionName, numParams, registerCount, preloadParentFlag,
        preloadRootFlag, suppressSuperFlag, preloadSuperFlag, suppressArgumentsFlag,
        preloadArgumentsFlag, suppressThisFlag, preloadThisFlag, reserved, preloadGlobalFlag,
        new RegisterParamList(registerParams), codeSize, new ActionList(code));
View Full Code Here

    final UINT8 fillStyleType = parseUINT8(parser, 0x00006, fieldName + "::FillStyleType");
    final int fillStyleTypeValue = fillStyleType.value();
    final RGB color = RGBParser.parseIf(parser, fillStyleTypeValue == 0x00, fieldName + "::Color");
    final Matrix gradientMatrix = MatrixParser.parseIf(parser, fillStyleTypeValue == 0x10 || fillStyleTypeValue == 0x12 || fillStyleTypeValue == 0x13, fieldName + "::GradientMatrix");
    final IGradient gradient = getGradient(parser, fillStyleTypeValue, fieldName + "::Gradient");
    final UINT16 bitmapId = parseUINT16If(parser, 0x00006, fillStyleTypeValue >= 0x40 && fillStyleTypeValue <= 0x43, fieldName + "::BitmapID");
    final Matrix bitmapMatrix= MatrixParser.parseIf(parser, fillStyleTypeValue >= 0x40 && fillStyleTypeValue <= 0x43, fieldName + "::BitmapMatrix");

    return new FillStyle(fillStyleType, color, gradientMatrix, gradient, bitmapId, bitmapMatrix);
  }
View Full Code Here

  public static LineStyleArray parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    parser.align();

    final UINT8 lineStyleCount = parseUINT8(parser, 0x00006, fieldName + "::LineStyleCount");
    final UINT16 lineStyleCountExtended = parseUINT16If(parser, 0x00006, lineStyleCount.value() == 0xFF, fieldName + "::LineStyleCountExtended");

    final int normalizedCount = lineStyleCount.value() == 0xFF ? lineStyleCountExtended.value() : lineStyleCount.value();

    final List<LineStyle> lineStyles = new ArrayList<LineStyle>();

    for (int i=0;i<normalizedCount;i++) {
      lineStyles.add(LineStyleParser.parse(parser, String.format("LineStyles[%d]", i)));
View Full Code Here

   *
   * @throws SWFParserException Thrown if the structure could not be parsed.
   */
  public static Symbol parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    final UINT16 tag = parseUINT16(parser, 0x00006, fieldName + "::Tag");
    final AsciiString name = parseString(parser, 0x00006, fieldName + "::Name");

    return new Symbol(tag, name);
  }
View Full Code Here

   * @throws SWFParserException Thrown if the structure could not be parsed.
   */
  public static MorphLineStyleArray2 parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    final UINT8 lineStyleCount = parseUINT8(parser, 0x00006, fieldName + "::LineStyleCount");
    final UINT16 lineStyleCountExtended = parseUINT16If(parser, 0x00006, lineStyleCount.value() == 0xFF, fieldName + "::LineStyleCountExtended");

    final int normalizedCount = lineStyleCount.value() == 0xFF ? lineStyleCountExtended.value() : lineStyleCount.value();

    final List<MorphLineStyle2> lineStyles = new ArrayList<MorphLineStyle2>();

    for (int i=0;i<normalizedCount;i++) {
      lineStyles.add(MorphLineStyle2Parser.parse(parser, String.format(fieldName + "::LineStyles[%d]", lineStyles.size())));
View Full Code Here

   *
   * @throws SWFParserException Thrown if the structure could not be parsed.
   */
  public static LineStyle parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    final UINT16 lineStyleType = parseUINT16(parser, 0x00006, fieldName + "::LineStyleType");
    final RGB color = RGBParser.parse(parser, fieldName + "::Color");

    return new LineStyle(lineStyleType, color);
  }
View Full Code Here

TOP

Related Classes of tv.porst.splib.binaryparser.UINT16

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.