Package tv.porst.splib.binaryparser

Examples of tv.porst.splib.binaryparser.UINT8


    final CxFormWithAlpha colorTransform = CxFormWithAlphaParser.parseIf(parser, placeFlagHasColorTransform, "PlaceObject3::CxFormWithAlpha");
    final UINT16 ratio = parseUINT16If(parser, 0x00006, placeFlagHasRatio, "PlaceObject3::Ratio");
    final AsciiString name = parseStringIf(parser, 0x00006, placeFlagHasName, "PlaceObject3::Name");
    final UINT16 clipDepth = parseUINT16If(parser, 0x00006, placeFlagHasClipDepth, "PlaceObject3::ClipDepth");
    final FilterList surfaceFilterList = FilterListParser.parseIf(parser, placeFlagHasFilterList, "PlaceObject3::SurfaceFilterList");
    final UINT8 blendMode = parseUINT8If(parser, 0x00006, placeFlagHasBlendMode, "PlaceObject3::BlendMode");
    final UINT8 bitmapCache = parseUINT8If(parser, 0x00006, placeFlagHasCacheAsBitmap, "PlaceObject3::BitmapCache");
    final ClipActions clipActions = parseIf(parser, version, placeFlagHasClipActions, "PlaceObject3::ClipActions");

    parser.align();

    return new PlaceObject3Tag(header, placeFlagHasClipActions, placeFlagHasClipDepth, placeFlagHasName,
View Full Code Here


      characters.add(ButtonRecord2Parser.parse(parser, String.format("DefineButton2::Characters[%d]", characters.size())));

    } while (true);

    final UINT8 characterEndFlag = parseUINT8(parser, 0x00006, "DefineButton2::CharacterEndFlag");

    final List<ButtonCondAction> actions = new ArrayList<ButtonCondAction>();

    if (actionOffset.value() != 0) {
View Full Code Here

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

    final AsciiString url = parseString(parser, 0x00006, "ImportAssets2::URL");
    final UINT8 reserved = parseUINT8(parser, 0x00006, "ImportAssets2::Reserved");
    final UINT8 reserved2 = parseUINT8(parser, 0x00006, "ImportAssets2::Reserved2");
    final UINT16 count = parseUINT16(parser, 0x00006, "ImportAssets2::Count");

    final List<Symbol> symbols = new ArrayList<Symbol>();

    for (int i=0;i<count.value();i++) {
View Full Code Here

    final Flag fontFlagsANSI = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsANSI");
    final Flag fontFlagsWideOffsets = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsWideOffsets");
    final Flag fontFlagsWideCodes = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsWideCodes");
    final Flag fontFlagsItalic = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsItalic");
    final Flag fontFlagsBold = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsBold");
    final UINT8 languageCode = parseUINT8(parser, 0x00006, "DefineFont3::LanguageCode");
    final UINT8 fontNameLen = parseUINT8(parser, 0x00006, "DefineFont3::FontNameLen");
    final AsciiString fontName = parseString(parser, fontNameLen.value(), 0x00006, "DefineFont3::FontName");
    final UINT16 numGlyphs = parseUINT16(parser, 0x00006, "DefineFont3::NumGlyphs");

    final List<IParsedINTElement> offsetTable = new ArrayList<IParsedINTElement>();

    for (int i=0;i<numGlyphs.value();i++) {
View Full Code Here

    final Flag fontFlagsANSI = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsANSI");
    final Flag fontFlagsWideOffsets = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsWideOffsets");
    final Flag fontFlagsWideCodes = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsWideCodes");
    final Flag fontFlagsItalic = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsItalic");
    final Flag fontFlagsBold = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsBold");
    final UINT8 languageCode = parseUINT8(parser, 0x00006, "Define2::LanguageCode");
    final UINT8 fontNameLen = parseUINT8(parser, 0x00006, "DefineFont2::FontNameLen");
    final AsciiString fontName = parseString(parser, fontNameLen.value(), 0x00006, "DefineFont2::FontName");
    final UINT16 numGlyphs = parseUINT16(parser, 0x00006, "DefineFont2::NumGlyphs");

    final List<IParsedINTElement> offsetTable = new ArrayList<IParsedINTElement>();

    for (int i=0;i<numGlyphs.value();i++) {
View Full Code Here

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

    final AsciiString name = parseString(parser, 0x00006, "FrameLabel::Name");
    final UINT8 namedAnchorFlag = parseUINT8If(parser, 0x00006, header.getNormalizedLength() == name.value().length() + 1 + 1, "FrameLabel::NamedAnchorFlag");

    return new FrameLabelTag(header, name, namedAnchorFlag);
  }
View Full Code Here

  public static DefineText2Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

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

    final List<TextRecord2> textRecords = new ArrayList<TextRecord2>();

    do {
      if (parser.peekUInt8().value() == 0) {
        break;
      }

      textRecords.add(TextRecord2Parser.parse(parser, glyphBits.value(), advanceBits.value(), String.format("DefineText::TextRecords2[%d]", textRecords.size())));

    } while (true);

    final UINT8 end = parseUINT8(parser, 0x00006, "DefineText2Parser::EndOfRecordsFlag");

    return new DefineText2Tag(header, characterId, textBounds, textMatrix, glyphBits, advanceBits, new TextRecord2List(textRecords), end);
  }
View Full Code Here

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

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

    final int bitmapFormatValue = bitmapFormat.value();

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

    final int numberOfBytes = header.getNormalizedLength() - 2 - 1 - 2 - 2 - (bitmapColorTableSize == null ? 0 : 1);
    final ByteArray zlibBitmapData = parseByteArray(parser, numberOfBytes, 0x00006, "DefineBitsLossless::ZlibBitmapData");

    return new DefineBitsLossless2Tag(header, characterId, bitmapFormat, bitmapWidth, bitmapHeight, bitmapColorTableSize, zlibBitmapData);
View Full Code Here

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

    final UINT16 fontId = parseUINT16(parser, 0x00006, "DefineFontInfo::FontId");
    final UINT8 fontNameLen = parseUINT8(parser, 0x00006, "DefineFontInfo::FontNameLen");
    final AsciiString fontName = parseString(parser, fontNameLen.value(), 0x00006, "DefineFontInfo::FontName");
    final UBits fontFlagsReserved = parseUBits(parser, 2, 0x00006, "DefineFontInfo::FontFlagsReserved");
    final Flag fontFlagsSmallText = parseFlag(parser, 0x00006, "DefineFontInfo::FontFlagsSmallText");
    final Flag fontFlagsShiftJIS = parseFlag(parser, 0x00006, "DefineFontInfo::FontFlagsShiftJIS");
    final Flag fontFlagsANSI = parseFlag(parser, 0x00006, "DefineFontInfo::FontFlagsANSI");
    final Flag fontFlagsItalic = parseFlag(parser, 0x00006, "DefineFontInfo::FontFlagsItalic");
    final Flag fontFlagsBold = parseFlag(parser, 0x00006, "DefineFontInfo::FontFlagsBold");
    final Flag fontFlagsWideCodes = parseFlag(parser, 0x00006, "DefineFontInfo::FontFlagsWideCodes");

    final int remainingBytes = header.getNormalizedLength() - 2 - 1 - fontNameLen.value() - 1;

    final int numberOfGlyphs = remainingBytes / (fontFlagsWideCodes.value() ? 2 : 1);

    final List<IParsedINTElement> codeTable = new ArrayList<IParsedINTElement>();

View Full Code Here

    try {

      while (parser.getBytePosition() - startOffset < actionRecordSize) {

        final UINT8 actionCode = parseUINT8(parser, 0x00006, fieldName + "::ActionCode");

        switch (actionCode.value()) {
        case ActionCodes.ActionEnd: actions.add(new ActionEnd(actionCode)); break;
        case ActionCodes.ActionNextFrame: actions.add(new ActionNextFrame(actionCode)); break;
        case ActionCodes.ActionPreviousFrame: actions.add(new ActionPreviousFrame(actionCode)); break;
        case ActionCodes.ActionPlay: actions.add(new ActionPlay(actionCode)); break;
        case ActionCodes.ActionStop: actions.add(new ActionStop(actionCode)); break;
View Full Code Here

TOP

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

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.