Package tv.porst.splib.binaryparser

Examples of tv.porst.splib.binaryparser.Flag


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

    final Flag placeFlagHasClipActions = parseFlag(parser, 0x00006, "PlaceObject2::PlaceFlagHasClipActions");
    final Flag placeFlagHasClipDepth = parseFlag(parser, 0x00006, "PlaceObject2::PlaceFlagHasClipDepth");
    final Flag placeFlagHasName = parseFlag(parser, 0x00006, "PlaceObject2::PlaceFlagHasName");
    final Flag placeFlagHasRatio = parseFlag(parser, 0x00006, "PlaceObject2::PlaceFlagHasRatio");
    final Flag placeFlagHasColorTransform = parseFlag(parser, 0x00006, "PlaceObject2::PlaceFlagHasColorTransform");
    final Flag placeFlagHasMatrix = parseFlag(parser, 0x00006, "PlaceObject2::PlaceFlagHasMatrix");
    final Flag placeFlagHasCharacter = parseFlag(parser, 0x00006, "PlaceObject2::PlaceFlagHasCharacter");
    final Flag placeFlagHasMove = parseFlag(parser, 0x00006, "PlaceObject2::PlaceFlagHasMove");
    final UINT16 depth = parseUINT16(parser, 0x00005, "PlaceObject2::Depth");
    final UINT16 characterId = parseUINT16If(parser, 0x00006, placeFlagHasCharacter, "PlaceObject2::CharacterId");
    final Matrix matrix = MatrixParser.parseIf(parser, placeFlagHasMatrix, "PlaceObject2::Matrix");
    final CxFormWithAlpha colorTransform = CxFormWithAlphaParser.parseIf(parser, placeFlagHasColorTransform, "PlaceObject2::CxFormWithAlpha");
    final UINT16 ratio = parseUINT16If(parser, 0x00006, placeFlagHasRatio, "PlaceObject2::Ratio");
View Full Code Here


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

    final UBits reserved = parseUBits(parser, 1, 0x00006, "FileAttributes::Reserved");
    final Flag useDirectBit = parseFlag(parser, 0x00006, "FileAttributes::UseDirectBit");
    final Flag useGPU = parseFlag(parser, 0x00006, "FileAttributes::UseGPU");
    final Flag hasMetadata = parseFlag(parser, 0x00006, "FileAttributes::HasMetadata");
    final Flag actionScript3 = parseFlag(parser, 0x00006, "FileAttributes::ActionScript3");
    final UBits reserved2 = parseUBits(parser, 2, 0x00006, "FileAttributes::Reserved2");
    final Flag useNetwork = parseFlag(parser, 0x00006, "FileAttributes::UseNetwork");
    final UBits reserved3 = parseUBits(parser, 24, 0x00006, "FileAttributes::Reserved3");

    return new FileAttributesTag(header, reserved, useDirectBit, useGPU, hasMetadata, actionScript3, reserved2, useNetwork, reserved3);
  }
View Full Code Here

    final Rect startBounds = RectParser.parse(parser, "DefineMorphShape2::StartBounds");
    final Rect endBounds = RectParser.parse(parser, "DefineMorphShape2::EndBounds");
    final Rect startEdgeBounds = RectParser.parse(parser, "DefineMorphShape2::StartEdgeBounds");
    final Rect endEdgeBounds = RectParser.parse(parser, "DefineMorphShape2::EndEdgeBounds");
    final UBits reserved = parseUBits(parser, 6, 0x00006, "DefineMorphShape::Reserved");
    final Flag useNonScalingStrokes = parseFlag(parser, 0x00006, "DefineMorphShape2::UseNonScalingStrokes");
    final Flag useScalingStrokes = parseFlag(parser, 0x00006, "DefineMorphShape2::UseScalingStrokes");
    final UINT32 offset = parseUINT32(parser, 0x00006, "DefineMorphShape2::Offset");
    final MorphFillStyleArray morphFillStyles = MorphFillStyleArrayParser.parse(parser, "DefineMorphShape::MorphFillStyleArray");
    final MorphLineStyleArray2 morphLineStyles = MorphLineStyleArray2Parser.parse(parser, "DefineMorphShape::MorphLineSyleArray");
    final Shape startEdges = ShapeParser.parse(parser, "DefineMorphShape2::StartEdges");
    final Shape endEdges = ShapeParser.parse(parser, "DefineMorphShape2::EndEdges");
View Full Code Here

    final UINT16 shapeId = parseUINT16(parser, 0x00006, "DefineShape4::ShapeID");

    final Rect shapeBounds = RectParser.parse(parser, "DefineShape4::ShapeBounds");
    final Rect edgeBounds = RectParser.parse(parser, "DefineShape4::EdgeBounds");
    final UBits reserved = parseUBits(parser, 5, 0x00006, "DefineShape4::Reserved");
    final Flag usesFillWindingRule = parseFlag(parser, 0x00006, "DefineShape4::UsesFillWindingRule");
    final Flag usesNonScalingStrokes = parseFlag(parser, 0x00006, "DefineShape4::UsesNonScalingStrokes");
    final Flag usesScalingStrokes = parseFlag(parser, 0x00006, "DefineShape4::UsesScalingStrokes");
    final ShapeWithStyle4 shapes = ShapeWithStyle4Parser.parse(parser, "DefineShape4::Shapes");

    return new DefineShape4Tag(header, shapeId, shapeBounds, edgeBounds, reserved, usesFillWindingRule, usesNonScalingStrokes, usesScalingStrokes, shapes);
  }
View Full Code Here

    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>();

    for (int i=0;i<numberOfGlyphs;i++) {
      if (fontFlagsWideCodes.value()) {
        codeTable.add(parseUINT16(parser, 0x00006, String.format("DefineFontInfo::CodeTable[%d]", i)));
      }
      else {
        codeTable.add(parseUINT8(parser, 0x00006, String.format("DefineFontInfo::CodeTable[%d]", i)));
      }
View Full Code Here

   */
  public static DefineFont4Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 fontId = parseUINT16(parser, 0x00006, "DefineText2::FontId");
    final UBits fontFlagsReserved = parseUBits(parser, 5, 0x00006, "DefineFont4::FontFlagsReserved");
    final Flag fontFlagsHasFontData = parseFlag(parser, 0x00006, "DefineFont4::FontFlagsHasFontData");
    final Flag fontFlagsItalic = parseFlag(parser, 0x00006, "DefineFont4::FontFlagsItalic");
    final Flag fontFlagsBold = parseFlag(parser, 0x00006, "DefineFont4::FontFlagsBold");
    final AsciiString fontName = parseString(parser, 0x00006, "DefineFont4::FontName");

    final int remainingLength = header.getNormalizedLength() - 1 - 1 - fontName.value().length() - 1;

    final ByteArray fontData = parseByteArrayIf(parser, remainingLength, 0x00006, fontFlagsHasFontData, "DefineFont4::FontData");
View Full Code Here

    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();
View Full Code Here

    final Fixed blurX = FixedParser.parse(parser, fieldName + "::BlurX");
    final Fixed blurY = FixedParser.parse(parser, fieldName + "::BlurY");
    final Fixed angle = FixedParser.parse(parser, fieldName + "::Angle");
    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

    if (fieldName == null) {
      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");
View Full Code Here

TOP

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

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.