Package tv.porst.splib.binaryparser

Examples of tv.porst.splib.binaryparser.UBits


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

    final UBits spreadMode = parseUBits(parser, 2, 0x00006, fieldName + "::SpreadMode");
    final UBits interpolationMode = parseUBits(parser, 2, 0x00006, fieldName + "::InterpolationMode");
    final UBits numGradients = parseUBits(parser, 4, 0x00006, fieldName + "::NumGradients");

    final List<GradRecord> gradientRecords = new ArrayList<GradRecord>();

    for (int i=0;i<numGradients.value();i++) {
      gradientRecords.add(GradRecordParser.parse(parser, String.format("GradientRecord[%d]", i)));
    }

    final Fixed8 focalPoint = Fixed8Parser.parse(parser, fieldName + "::FocalPoint");

View Full Code Here


   * @return The parsed structure.
   *
   * @throws SWFParserException Thrown if the structure could not be parsed.
   */
  public static GlyphEntry parse(final SWFBinaryParser parser, final int glyphBits, final int advanceBits, final String fieldName) throws SWFParserException {
    final UBits glyphIndex = parseUBits(parser, glyphBits, 0x00006, fieldName + "::GlyphIndex");
    final Bits advanceIndex = parseSBits(parser, advanceBits, 0x00006, fieldName + "::AdvanceIndex");

    return new GlyphEntry(glyphIndex, advanceIndex);
  }
View Full Code Here

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

    final UBits numFillBits = parseUBits(parser, 4, 0x00006, fieldName + "::NumFillBits");
    final UBits numLineBits = parseUBits(parser, 4, 0x00006, fieldName + "::NumLineBits");

    final List<ShapeRecord> shapeRecords = new ArrayList<ShapeRecord>();

    ShapeRecord shapeRecord = null;

    UBits currentNumFillBits = numFillBits;
    UBits currentNumLineBits = numLineBits;

    do {

      shapeRecord = ShapeRecordParser.parse(parser, currentNumFillBits, currentNumLineBits, fieldName + "::ShapeRecord");

View Full Code Here

    for (int i=0;i<numZoneData.value();i++) {
      zoneData.add(ZoneDataParser.parse(parser, String.format("zoneData[%d]", i)));
    }

    final UBits reserved = parseUBits(parser, 6, 0x00006, fieldName + "::Reserved");
    final Flag zoneMaskY = parseFlag(parser, 0x00006, fieldName + "::ZoneMaskY");
    final Flag zoneMaskX = parseFlag(parser, 0x00006, fieldName + "::ZoneMaskX");

    return new ZoneRecord(numZoneData, new ZoneDataList(zoneData), reserved, zoneMaskY, zoneMaskX);
  }
View Full Code Here

    final Flag stateNewStyles = parseFlag(parser, 0x00006, fieldName + "::StateNewStyles");
    final Flag stateLineStyle = parseFlag(parser, 0x00006, fieldName + "::StateLineStyle");
    final Flag stateFillStyle1 = parseFlag(parser, 0x00006, fieldName + "::StateFillStyle1");
    final Flag stateFillStyle0 = parseFlag(parser, 0x00006, fieldName + "::StateFillStyle0");
    final Flag stateMoveTo = parseFlag(parser, 0x00006, fieldName + "::StateMoveTo");
    final UBits moveBits = parseUBitsIf(parser, 5, 0x00006, stateMoveTo, fieldName + "::MoveBits");
    final UBits moveDeltaX = parseUBitsIf(parser, moveBits == null ? 0 : moveBits.value(), 0x00006, stateMoveTo, fieldName + "::MoveDeltaX");
    final UBits moveDeltaY = parseUBitsIf(parser, moveBits == null ? 0 : moveBits.value(), 0x00006, stateMoveTo, fieldName + "::MoveDeltaY");
    final UBits fillStyle0 = parseUBitsIf(parser, fillBits == null ? 0 : fillBits.value(), 0x00006, stateFillStyle0, fieldName + "::FillStyle0");
    final UBits fillStyle1 = parseUBitsIf(parser, fillBits == null ? 0 : fillBits.value(), 0x00006, stateFillStyle1, fieldName + "::FillStyle1");
    final UBits lineStyle = parseUBitsIf(parser, lineBits == null ? 0 : lineBits.value(), 0x00006, stateLineStyle, fieldName + "::LineStyle");

    if (stateNewStyles.value()) {
      parser.align();
    }

    final FillStyleArray fillStyles = FillStyleArrayParser.parseIf(parser, stateNewStyles, fieldName + "::FillStyles");
    final LineStyleArray lineStyles = LineStyleArrayParser.parseIf(parser, stateNewStyles, fieldName + "LineStyles");
    final UBits numFillBits = parseUBitsIf(parser, 4, 0x00006, stateNewStyles, fieldName + "::NumFillBits");
    final UBits numLineBits = parseUBitsIf(parser, 4, 0x00006, stateNewStyles, fieldName + "::NumLineBits");

    return new StyleChangeRecord(typeFlag, stateNewStyles, stateLineStyle, stateFillStyle1,
        stateFillStyle0, stateMoveTo, moveBits, moveDeltaX, moveDeltaY, fillStyle0, fillStyle1,
        lineStyle, fillStyles, lineStyles, numFillBits, numLineBits);
  }
View Full Code Here

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

    final UBits pix15Reserved = parseUBits(parser, 1, 0x00006, fieldName + "::Pix15Reserved");
    final UBits pix15Red = parseUBits(parser, 5, 0x00006, fieldName + "::Pix15Red");
    final UBits pix15Green = parseUBits(parser, 5, 0x00006, fieldName + "::Pix15Green");
    final UBits pix15Blue = parseUBits(parser, 5, 0x00006, fieldName + "::Pix15Blue");

    return new Pix15(pix15Reserved, pix15Red, pix15Blue, pix15Green);
  }
View Full Code Here

   */
  public static ShapeWithStyle4 parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    final FillStyle3Array fillStyles = FillStyle3ArrayParser.parse(parser, fieldName + "::FillStyles");
    final LineStyle4Array lineStyles = LineStyle4ArrayParser.parse(parser, fieldName + "::LineStyles");
    final UBits numFillBits = parseUBits(parser, 4, 0x00006, fieldName + "::NumFillBits");
    final UBits numLineBits = parseUBits(parser, 4, 0x00006, fieldName + "::NumLineBits");
    final List<Shape4Record> shapeRecords = new ArrayList<Shape4Record>();

    Shape4Record shapeRecord = null;

    UBits currentNumFillBits = numFillBits;
    UBits currentNumLineBits = numLineBits;

    do {

      shapeRecord = ShapeRecord4Parser.parse(parser, currentNumFillBits, currentNumLineBits, fieldName + "::ShapeRecord");

View Full Code Here

    final Fixed8 strength = Fixed8Parser.parse(parser, fieldName + "::Strength");
    final Flag innerShadow = parseFlag(parser, 0x00006, fieldName + "::InnerShadow");
    final Flag knockout = parseFlag(parser, 0x00006, fieldName + "::KnockOut");
    final Flag compositeSource = parseFlag(parser, 0x00006, fieldName + "::CompositeSource");
    final Flag onTop = parseFlag(parser, 0x00006, fieldName + "::OnTop");
    final UBits passes = parseUBits(parser, 4, 0x00006, fieldName + "::Passes");

    return new GradientGlowFilter(numColors, new RGBAList(gradientColors), new UINT8List(gradientRatio), blurX, blurY, angle, distance, strength, innerShadow, knockout, compositeSource, onTop, passes);
  }
View Full Code Here

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

    final Flag textRecordType = parseFlag(parser, 0x00006, fieldName + "::TextRecordType");
    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");
View Full Code Here

      throw new IllegalArgumentException("Field name argument must not be null");
    }

    final Flag hasAddTerms = parseFlag(parser, 0x00006, fieldName + "::HasAddTerms");
    final Flag hasMultTerms = parseFlag(parser, 0x00006, fieldName + "::HasMultTerms");
    final UBits nBits = parseUBits(parser, 4, 0x00006, fieldName + "::NBits");
    final Bits redMultTerm = parseSBitsIf(parser, nBits.value(), 0x00006, hasMultTerms.value(), fieldName + "::RedMultTerm");
    final Bits greenMultTerm = parseSBitsIf(parser, nBits.value(), 0x00006, hasMultTerms.value(), fieldName + "::GreenMultTerm");
    final Bits blueMultTerm = parseSBitsIf(parser, nBits.value(), 0x00006, hasMultTerms.value(), fieldName + "::BlueMultTerm");
    final Bits redAddTerm = parseSBitsIf(parser, nBits.value(), 0x00006, hasAddTerms.value(), fieldName + "::RedAddTerm");
    final Bits greenAddTerm = parseSBitsIf(parser, nBits.value(), 0x00006, hasAddTerms.value(), fieldName + "::GreenAddTerm");
    final Bits blueAddTerm = parseSBitsIf(parser, nBits.value(), 0x00006, hasAddTerms.value(), fieldName + "::BlueAddTerm");

    parser.align();

    return new CxForm(hasAddTerms, hasMultTerms, nBits, redMultTerm, greenMultTerm, blueMultTerm, redAddTerm, greenAddTerm, blueAddTerm);
  }
View Full Code Here

TOP

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

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.