Package tv.porst.splib.binaryparser

Examples of tv.porst.splib.binaryparser.UBits


    if (fieldName == null) {
      throw new IllegalArgumentException("Field name argument must not be null");
    }

    final Flag hasScale = parseFlag(parser, 0x00006, fieldName + "::HasScale");
    final UBits nScaleBits = parseUBitsIf(parser, 5, 0x00006, hasScale.value(), fieldName + "::NScaleBits");
    final UBits scaleX = parseUBitsIf(parser, nScaleBits == null ? 0 : nScaleBits.value(), 0x00006, hasScale.value(), fieldName + "::ScaleX");
    final UBits scaleY = parseUBitsIf(parser, nScaleBits == null ? 0 : nScaleBits.value(), 0x00006, hasScale.value(), fieldName + "::ScaleY");
    final Flag hasRotate = parseFlag(parser, 0x00006, fieldName + "::HasRotate");
    final UBits nRotateBits = parseUBitsIf(parser, 5, 0x00006, hasRotate.value(), fieldName + "::NRotateBits");
    final UBits rotateSkew0 = parseUBitsIf(parser, nRotateBits == null ? 0 : nRotateBits.value(), 0x00006, hasRotate.value(), fieldName + "::rotateSkew0");
    final UBits rotateSkew1 = parseUBitsIf(parser, nRotateBits == null ? 0 : nRotateBits.value(), 0x00006, hasRotate.value(), fieldName + "::rotateSkew1");
    final UBits nTranslateBits = parseUBits(parser, 5, 0x00006, fieldName + "::NTranslateBits");
    final UBits translateX = parseUBits(parser, nTranslateBits == null ? 0 : nTranslateBits.value(), 0x00006, fieldName + "::TranslateX");
    final UBits translateY = parseUBits(parser, nTranslateBits == null ? 0 : nTranslateBits.value(), 0x00006, fieldName + "::TranslateY");

    parser.align();

    return new Matrix(hasScale, nScaleBits, scaleX, scaleY, hasRotate, nRotateBits, rotateSkew0, rotateSkew1, nTranslateBits, translateX, translateY);
  }
View Full Code Here


    final Fixed distance = FixedParser.parse(parser, fieldName + "::Distance");
    final Fixed8 strength = Fixed8Parser.parse(parser, fieldName + "::Strength");
    final Flag innerShadow = parseFlag(parser, 0x00006, fieldName + "::InnerShadow");
    final Flag knockout = parseFlag(parser, 0x00006, fieldName + "::KnockoutFilters");
    final Flag compositeSource = parseFlag(parser, 0x00006, fieldName + "::CompositeSource");
    final UBits passes = parseUBits(parser, 5, 0x00006, fieldName + "::Passes");

    return new DropShadowFilter(dropShadowColor, blurX, blurY, angle, distance, strength, innerShadow, knockout, compositeSource, passes);
  }
View Full Code Here

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

    final Flag typeFlag = parseFlag(parser, 0x00006, fieldName + "::NumberOfFilters");
    final UBits endOfShape = parseUBits(parser, 5, 0x00006, fieldName + "::EndOfShape");

    return new EndShapeRecord(typeFlag, endOfShape);
  }
View Full Code Here

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

    final FillStyleArray fillStyles = FillStyleArrayParser.parse(parser, fieldName + "::FillStyles");
    final LineStyleArray lineStyles = LineStyleArrayParser.parse(parser, fieldName + "::LineStyle");
    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

      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 alphaMultTerm = 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");
    final Bits alphaAddTerm = parseSBitsIf(parser, nBits.value(), 0x00006, hasAddTerms.value(), fieldName + "::BlueAddTerm");

    parser.align();

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

   */
  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");

View Full Code Here

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

    final Fixed blurX = FixedParser.parse(parser, fieldName + "::BlurX");
    final Fixed blurY = FixedParser.parse(parser, fieldName + "::BlurY");
    final UBits passes = parseUBits(parser, 5, 0x00006, fieldName + "::Passes");
    final UBits reserved = parseUBits(parser, 3, 0x00006, fieldName + "::Reserved");

    return new BlurFilter(blurX, blurY, passes, reserved);
  }
View Full Code Here

    if (parser == null) {
      throw new IllegalArgumentException("Parser argument must not be null");
    }

    final UBits nBits = parseUBits(parser, 5, 0x00006, fieldName + "::NBits");

    // It is unclear what happens if nBits is 0. This situation is not specified
    // in the SWF file format reference.

    if (nBits.value() == 0) {
      parser.align();
      return new Rect(nBits, null, null, null, null);
    }

    final Bits xMin = parseSBits(parser, nBits.value(), 0x00006, fieldName + "::XMin");
    final Bits xMax = parseSBits(parser, nBits.value(), 0x00006, fieldName + "::XMax");
    final Bits yMin = parseSBits(parser, nBits.value(), 0x00006, fieldName + "::YMin");
    final Bits yMax = parseSBits(parser, nBits.value(), 0x00006, fieldName + "::YMax");

    parser.align();

    return new Rect(nBits, xMin, xMax, yMin, yMax);
  }
View Full Code Here

    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++) {
View Full Code Here

      matrix.add(parseFloat(parser, 0x00006, String.format(fieldName + "::Matrix[%d]", i)));
    }

    final RGBA defaultColor = RGBAParser.parse(parser, fieldName + "::DefaultColor");

    final UBits reserved = parseUBits(parser, 6, 0x00006, fieldName + "Reserved");
    final Flag clamp = parseFlag(parser, 0x00006, fieldName + "::Clamp");
    final Flag preserveAlpha = parseFlag(parser, 0x00006, fieldName + "::PreserveAlpha");

    return new ConvolutionFilter(matrixX, matrixY, divisor, bias, new Float32List(matrix), defaultColor, reserved, clamp, preserveAlpha);
  }
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.