/** * Creates a SWF CXFormWithAlpha type for the common scenario where only an * alpha multiplier has been specified. The double value is converted into * an 8.8 fixed integer as required by the SWF format. * * @param alphaMultiplier The alpha multiplier value specified as a double * in the range 0.0 to 1.0 (inclusive). * @return a SWF CXFormWithAlpha value for the specified alpha multiplier. */ public static CXFormWithAlpha cxFormWithAlpha(double alphaMultiplier) { CXFormWithAlpha c = new CXFormWithAlpha(); c.setMultTerm(fixed8(1.0), fixed8(1.0), fixed8(1.0), fixed8(alphaMultiplier)); return c; }
/** * Creates a SWF CXFormWithAlpha type for the common scenario where only an * alpha multiplier has been specified. The double value is converted into * an 8.8 fixed integer as required by the SWF format. * * @param alphaMultiplier The alpha multiplier value specified as a double * in the range 0.0 to 1.0 (inclusive). * @return a SWF CXFormWithAlpha value for the specified alpha multiplier. */ public static CXFormWithAlpha cxFormWithAlpha(double alphaMultiplier) { CXFormWithAlpha c = new CXFormWithAlpha(); c.setMultTerm(fixed8(1.0), fixed8(1.0), fixed8(1.0), fixed8(alphaMultiplier)); return c; }
double greenOffset, double blueOffset) CXFormWithAlpha c = new CXFormWithAlpha(); int alphaMultTerm = fixed8(alphaMultiplier); int redMultTerm = fixed8(redMultiplier);
double greenOffset, double blueOffset) CXFormWithAlpha c = new CXFormWithAlpha(); int alphaMultTerm = fixed8(alphaMultiplier); int redMultTerm = fixed8(redMultiplier);
private CXFormWithAlpha readColorTransformWithAlpha() { bitStream.byteAlign(); final CXFormWithAlpha cxFormWithAlpha = new CXFormWithAlpha(); final boolean hasAddTerms = bitStream.readBit(); final boolean hasMultTerms = bitStream.readBit(); final int nbits = bitStream.readUB(4); if (hasMultTerms) { cxFormWithAlpha.setMultTerm( bitStream.readSB(nbits), bitStream.readSB(nbits), bitStream.readSB(nbits), bitStream.readSB(nbits)); } if (hasAddTerms) { cxFormWithAlpha.setAddTerm( bitStream.readSB(nbits), bitStream.readSB(nbits), bitStream.readSB(nbits), bitStream.readSB(nbits)); } return cxFormWithAlpha; }
private CXFormWithAlpha readColorTransformWithAlpha() { bitStream.byteAlign(); final CXFormWithAlpha cxFormWithAlpha = new CXFormWithAlpha(); final boolean hasAddTerms = bitStream.readBit(); final boolean hasMultTerms = bitStream.readBit(); final int nbits = bitStream.readUB(4); if (hasMultTerms) { cxFormWithAlpha.setMultTerm( bitStream.readSB(nbits), bitStream.readSB(nbits), bitStream.readSB(nbits), bitStream.readSB(nbits)); } if (hasAddTerms) { cxFormWithAlpha.setAddTerm( bitStream.readSB(nbits), bitStream.readSB(nbits), bitStream.readSB(nbits), bitStream.readSB(nbits)); } return cxFormWithAlpha; }