Package tv.porst.splib.binaryparser

Examples of tv.porst.splib.binaryparser.UINT16


import tv.porst.swfretools.parser.SWFParserException;

public class ActionIfParser {

  public static ActionIf parse(final SWFBinaryParser parser, final UINT8 actionCode, final String fieldName) throws SWFParserException {
    final UINT16 length = parseUINT16(parser, 0x00006, fieldName + "::Length");
    final INT16 branchOffset = parseINT16(parser, 0x00006, fieldName + "::BranchOffset");

    return new ActionIf(actionCode, length, branchOffset);
  }
View Full Code Here


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

    final UINT8 fillStyleCount = parseUINT8(parser, 0x00006, fieldName + "::FillStyleCount");
    final UINT16 fillStyleCountExtended = parseUINT16If(parser, 0x00006, fillStyleCount.value() == 0xFF, fieldName + "::FillStyleCountExtended");

    final int normalizedCount = fillStyleCount.value() == 0xFF ? fillStyleCountExtended.value() : fillStyleCount.value();

    final List<MorphFillStyle> fillStyles = new ArrayList<MorphFillStyle>();

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

    final UINT8 fillStyleType = parseUINT8(parser, 0x00006, fieldName + "::FillStyleType");
    final int fillStyleTypeValue = fillStyleType.value();
    final RGBA color = RGBAParser.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 FillStyle3(fillStyleType, color, gradientMatrix, gradient, bitmapId, bitmapMatrix);

  }
View Full Code Here

   *
   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static VideoFrameTag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 streamId = parseUINT16(parser, 0x00006, "VideoFrame::StreamId");
    final UINT16 frameNum = parseUINT16(parser, 0x00006, "VideoFrame::FrameNum");

    final int dataBytes = header.getNormalizedLength() - UINT16.BYTE_LENGTH - UINT16.BYTE_LENGTH;

    final ByteArray videoData = parseByteArray(parser, dataBytes < 0 ? 0 : dataBytes, 0x00006, "VideoFrame::VideoData");

View Full Code Here

   *
   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 characterId = parseUINT16(parser, 0x00006, "DefineBitsLossless::CharacterId");
    final UINT8 bitmapFormat = parseUINT8(parser, 0x00006, "DefineBitsLossless::BitmapFormat");
    final UINT16 bitmapWidth = parseUINT16(parser, 0x00006, "DefineBitsLossless::BitmapWidth");
    final UINT16 bitmapHeight = parseUINT16(parser, 0x00006, "DefineBitsLossless::BitmapHeight");

    final int bitmapFormatValue = bitmapFormat.value();

    final UINT8 bitmapColorTableSize = parseUINT8If(parser, 0x00006, bitmapFormatValue == 3, "DefineBitsLossless::BitmapColorTableSize");

View Full Code Here

   *
   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static DefineTextTag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 characterId = parseUINT16(parser, 0x00006, "DefineText::CharacterId");
    final Rect textBounds = RectParser.parse(parser, "DefineText::TextBounds");
    final Matrix textMatrix = MatrixParser.parse(parser, "DefineText::TextMatrix");
    final UINT8 glyphBits = parseUINT8(parser, 0x00006, "DefineText::GlyphBits");
    final UINT8 advanceBits = parseUINT8(parser, 0x00006, "DefineText::AdvanceBits");

View Full Code Here

   *
   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static RemoveObject2Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 depth = parseUINT16(parser, 0x00006, "RemoveObject2::Depth");

    return new RemoveObject2Tag(header, depth);
  }
View Full Code Here

   *
   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static EnableDebugger2Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 reserved = parseUINT16(parser, 0x00006, "EnableDebugger2::Reserved");
    final AsciiString password = parseString(parser, 0x00006, "EnableDebugger2::Reserved");

    return new EnableDebugger2Tag(header, reserved, password);
  }
View Full Code Here

   *
   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static CSMTextSettingsTag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 textId = parseUINT16(parser, 0x00006, "CSMTextSettings::TextId");
    final UBits useFlashType = parseUBits(parser, 2, 0x00006, "CSMTextSettings::UseFlashType");
    final UBits gridFit = parseUBits(parser, 3, 0x00006, "CSMTextSettings::GridFit");
    final UBits reserved = parseUBits(parser, 3, 0x00006, "CSMTextSettings::Reserved");
    final Float32 thickness = parseFloat(parser, 0x00006, "CSMTextSettings::Thickness");
    final Float32 sharpness = parseFloat(parser, 0x00006, "CSMTextSettings::Sharpness");
View Full Code Here

   *
   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 buttonId = parseUINT16(parser, 0x00006, "DefineButtonCxform::ButtonId");
    final CxForm buttonColorTransform = CxFormParser.parse(parser, "DefineButtonCxform::ButtonColorTransform");

    return new DefineButtonCxformTag(header, buttonId, buttonColorTransform);
  }
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.