Package tv.porst.splib.binaryparser

Examples of tv.porst.splib.binaryparser.UINT16


    final UBits styleFlagsReserved = parser.readBits(3);
    final Flag styleFlagsHasFont = parseFlag(parser, 0x00006, fieldName + "::StyleFlagsHasFont");
    final Flag styleFlagsHasColor = parseFlag(parser, 0x00006, fieldName + "::StyleFlagsHasColor");
    final Flag styleFlagsHasYOffset = parseFlag(parser, 0x00006, fieldName + "::StyleFlagsHasYOffset");
    final Flag styleFlagsHasXOffset = parseFlag(parser, 0x00006, fieldName + "::StyleFlagsHasXOffset");
    final UINT16 fontID = parseUINT16If(parser, 0x00006, styleFlagsHasFont, fieldName + "::FontID");
    final RGB textColor = RGBParser.parseIf(parser, styleFlagsHasColor, fieldName + "::TextColor");
    final INT16 xOffset = parseINT16If(parser, 0x00006, styleFlagsHasXOffset, fieldName + "::XOffset");
    final INT16 yOffset = parseINT16If(parser, 0x00006, styleFlagsHasYOffset, fieldName + "::YOffset");
    final UINT16 textHeight = parseUINT16If(parser, 0x00006, styleFlagsHasFont, fieldName + "::TextHeight");
    final UINT8 glyphCount = parseUINT8(parser, 0x00006, fieldName + "::GlyphCount");

    final List<GlyphEntry> glyphEntries = new ArrayList<GlyphEntry>();

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


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

    final UINT16 width = parseUINT16(parser, 0x00006, fieldName + "::Width");
    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 color = RGBAParser.parseIf(parser, !hasFillFlag.value(), fieldName + "::Color");
    final FillStyle3 fillType = FillStyle3Parser.parseIf(parser, hasFillFlag, fieldName + "::FillType");

    return new LineStyle4(width, startCapStyle, joinStyle, hasFillFlag,
        noHScaleFlag, noVScaleFlag, pixelHintingFlag, reserved, noClose,
View Full Code Here

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

    final UINT16 condActionSize = parseUINT16(parser, 0x00006, fieldName + "::CondActionSize");
    final Flag condIdleToOverDown = parseFlag(parser, 0x00006, fieldName + "::CondIdleToOverDown");
    final Flag condOutDownToIdle = parseFlag(parser, 0x00006, fieldName + "::CondOutDownToIdle");
    final Flag condOutDownToOverDown = parseFlag(parser, 0x00006, fieldName + "::CondOutDownToOverDown");
    final Flag condOverDownToOutDown = parseFlag(parser, 0x00006, fieldName + "::CondOverDownToOutDown");
    final Flag condOverDownToOverUp = parseFlag(parser, 0x00006, fieldName + "::CondOverDownToOverUp");
    final Flag condOverUpToOverDown = parseFlag(parser, 0x00006, fieldName + "::CondOverUpToOverDown");
    final Flag condOverUpToIdle = parseFlag(parser, 0x00006, fieldName + "::CondOverUpToIdle");
    final Flag condIdleToOverUp = parseFlag(parser, 0x00006, fieldName + "::CondIdleToOverUp");
    final UBits condKeyPress = parseUBits(parser, 7, 0x00006, fieldName + "::CondKeyPress");
    final Flag condOverDownToIdle = parseFlag(parser, 0x00006, fieldName + "::CondOverDownToIdle");

    final int actionRecordSize = condActionSize.value() == 0 ? header.getNormalizedLength() - (parser.getBytePosition() - header.getBitPosition() / 8 + 1 - header.getHeaderLength()) : condActionSize.value() - 4 - 1;

    final List<Action> actions = ActionRecordParser.parse(parser, actionRecordSize, fieldName + "::Actions");

    final UINT8 actionEndFlag = parseUINT8(parser, 0x00006, "DefineButton::ActionEndFlag");

View Full Code Here

    final Flag buttonHasFilterList = parseFlag(parser, 0x00006, fieldName + "::ButtonHasFilterList");
    final Flag buttonStateHitTest = parseFlag(parser, 0x00006, fieldName + "::ButtonStateHitTest");
    final Flag buttonStateDown = parseFlag(parser, 0x00006, fieldName + "::ButtonStateDown");
    final Flag buttonStateOver = parseFlag(parser, 0x00006, fieldName + "::ButtonStateOver");
    final Flag buttonStateUp = parseFlag(parser, 0x00006, fieldName + "::ButtonStateUp");
    final UINT16 characterID = parseUINT16(parser, 0x00006, fieldName + "::CharacterID");
    final UINT16 placeDepth = parseUINT16(parser, 0x00006, fieldName + "::PlaceDepth");
    final Matrix placeMatrix = MatrixParser.parse(parser, fieldName + "::PlaceMatrix");

    return new ButtonRecord(buttonReserved, buttonHasBlendMode, buttonHasFilterList,
        buttonStateHitTest, buttonStateDown, buttonStateOver,
        buttonStateUp, characterID, placeDepth, placeMatrix);
View Full Code Here

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

    final UINT16 width = parseUINT16(parser, 0x00006, fieldName + "::Width");
    final RGBA color = RGBAParser.parse(parser, fieldName + "::Color");

    return new LineStyle3(width, color);

  }
View Full Code Here

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

    final UINT16 reserved = parseUINT16(parser, 0x00006, fieldName + "::Reserved");
    final ClipEventFlags allEventFlags = ClipEventFlagsParser.parse(parser, version, fieldName);

    final List<ClipActionRecord> clipActionRecords = new ArrayList<ClipActionRecord>();

    do {
View Full Code Here

    final Flag hasOutPoint= parseFlag(parser, 0x00006, fieldName + "::HasOutPoint");
    final Flag hasInPoint = parseFlag(parser, 0x00006, fieldName + "::HasInPoint");

    final UINT32 inPoint = parseUINT32If(parser, 0x00006, hasInPoint, fieldName + "::InPoint");
    final UINT32 outPoint = parseUINT32If(parser, 0x00006, hasOutPoint, fieldName + "::OutPoint");
    final UINT16 loopCount = parseUINT16If(parser, 0x000006, hasLoops, fieldName + "::LoopCount");
    final UINT8 envPoints = parseUINT8If(parser, 0x00006, hasEnvelope, fieldName + "::EnvPoints");

    final List<SoundEnvelope> envelopeRecords = new ArrayList<SoundEnvelope>();

    if (hasEnvelope.value()) {
View Full Code Here

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

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

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

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

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

    final UINT32 fileLength = parser.readUInt32();

    final Rect frameSize = RectParser.parse(parser, "SWFHeader::FrameSize");

    final UINT16 frameRate = parser.readUInt16();
    final UINT16 frameCount = parser.readUInt16();

    final TagParserResult tags = TagParser.parse(parser, version.value());

    return new SWFFile(parserInputData, wasCompressed, signature1, signature2, signature3, version, fileLength, frameSize, frameRate, frameCount, tags.getTags());
  }
View Full Code Here

public class ActionTryParser {

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

    final UINT16 length = parseUINT16(parser, 0x00006, fieldName + "::Length");
    final UBits reserved = parseUBits(parser, 5, 0x00006, fieldName + "::Reserved");
    final Flag catchInRegisterFlag = parseFlag(parser, 0x00006, fieldName + "::CatchInRegisterFlag");
    final Flag finallyBlockFlag = parseFlag(parser, 0x00006, fieldName + "::FinallyBlockFlag");
    final Flag catchBlockFlag = parseFlag(parser, 0x00006, fieldName + "::CatchBlockFlag");
    final UINT16 trySize = parseUINT16(parser, 0x00006, fieldName + "::TrySize");
    final UINT16 catchSize = parseUINT16(parser, 0x00006, fieldName + "::CatchSize");
    final UINT16 finallySize = parseUINT16(parser, 0x00006, fieldName + "::FinallySize");

    final AsciiString catchName = parseStringIf(parser, 0x00006, !catchInRegisterFlag.value(), "::CatchName");
    final UINT8 catchRegister = parseUINT8If(parser, 0x00006, catchInRegisterFlag, fieldName + "::CatchRegister");

    final List<Action> tryBody = ActionRecordParser.parse(parser, trySize.value(), fieldName + "::TryBody");
    final List<Action> catchBody = ActionRecordParser.parse(parser, catchSize.value(), fieldName + "::CatchBody");
    final List<Action> finallyBody = ActionRecordParser.parse(parser, finallySize.value(), fieldName + "::FinallyBody");

    return new ActionTry(actionCode, length, reserved, catchInRegisterFlag, finallyBlockFlag,
        catchBlockFlag, trySize, catchSize, finallySize, catchName, catchRegister,
        new ActionList(tryBody), new ActionList(catchBody), new ActionList(finallyBody));
  }
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.