lib/java-psd-library-encontra/psd-parser/src/psd/parser/layer/additional/LayerEffectsParser.java
private PSDEffect parseSolidFill(PsdInputStream stream) throws IOException {

        int version = stream.readInt(); //Version: 2

        String blendSig = stream.readString(4);
        if (!blendSig.equals("8BIM")){
            throw new Error("Invalid Blend mode signature for Effect: " + blendSig );
        }

        String blendModeKey = stream.readString(4);

        //Highlight color: 2 bytes for space followed by 4 * 2 byte color component
        stream.skipBytes(3);

        int colorR = stream.readUnsignedByte();
        stream.skipBytes(1);
        int colorG = stream.readUnsignedByte();
        stream.skipBytes(1);
        int colorB = stream.readUnsignedByte();

        Color highlightColor = new Color(colorR, colorG, colorB);

        stream.skipBytes(2);

        float opacity = new Float(stream.readUnsignedByte()/255.0);

        boolean effectEnabled = stream.readBoolean();

        //Highlight color: 2 bytes for space followed by 4 * 2 byte color component
        stream.skipBytes(3);

        colorR = stream.readUnsignedByte();
        stream.skipBytes(1);
        colorG = stream.readUnsignedByte();
        stream.skipBytes(1);
        colorB = stream.readUnsignedByte();

        Color nativeColor = new Color(colorR, colorG, colorB);

        stream.skipBytes(2);

        SolidFillEffect effect = new SolidFillEffect();
        effect.setVersion(version);
        effect.setBlendMode(BlendMode.getByName(blendModeKey));
        effect.setEnabled(effectEnabled);
        effect.setHighlightColor(highlightColor);
        effect.setOpacity(opacity);
        effect.setNativeColor(nativeColor);

        return effect;
    }
/**
     * Parses the stream to create a SolidFill effect.
     * @param stream
     * @return
     * @throws IOException
     */
Parses the stream to create a SolidFill effect.
@param stream
@return
@throws IOException
Parses the stream to create a SolidFill effect . @param stream @return @throws IOException
private PSDEffect parseSolidFill(PsdInputStream stream) throws IOException {
        int version = stream.readInt(); 
        String blendSig = stream.readString(4);
        if (!blendSig.equals("8BIM")){
            throw new Error("Invalid Blend mode signature for Effect: " + blendSig );
        }
        String blendModeKey = stream.readString(4);
        stream.skipBytes(3);
        int colorR = stream.readUnsignedByte();
        stream.skipBytes(1);
        int colorG = stream.readUnsignedByte();
        stream.skipBytes(1);
        int colorB = stream.readUnsignedByte();
        Color highlightColor = new Color(colorR, colorG, colorB);
        stream.skipBytes(2);
        float opacity = new Float(stream.readUnsignedByte()/255.0);
        boolean effectEnabled = stream.readBoolean();
        stream.skipBytes(3);
        colorR = stream.readUnsignedByte();
        stream.skipBytes(1);
        colorG = stream.readUnsignedByte();
        stream.skipBytes(1);
        colorB = stream.readUnsignedByte();
        Color nativeColor = new Color(colorR, colorG, colorB);
        stream.skipBytes(2);
        SolidFillEffect effect = new SolidFillEffect();
        effect.setVersion(version);
        effect.setBlendMode(BlendMode.getByName(blendModeKey));
        effect.setEnabled(effectEnabled);
        effect.setHighlightColor(highlightColor);
        effect.setOpacity(opacity);
        effect.setNativeColor(nativeColor);
        return effect;
    }
private PSDEffect parseSolidFill ( PsdInputStream stream ) throws IOException { int version = stream . readInt ( ) ; String blendSig = stream . readString ( 4 ) ; if ( ! blendSig . equals ( "8BIM" ) ) { throw new Error ( "Invalid Blend mode signature for Effect: " + blendSig ) ; } String blendModeKey = stream . readString ( 4 ) ; stream . skipBytes ( 3 ) ; int colorR = stream . readUnsignedByte ( ) ; stream . skipBytes ( 1 ) ; int colorG = stream . readUnsignedByte ( ) ; stream . skipBytes ( 1 ) ; int colorB = stream . readUnsignedByte ( ) ; Color highlightColor = new Color ( colorR , colorG , colorB ) ; stream . skipBytes ( 2 ) ; float opacity = new Float ( stream . readUnsignedByte ( ) / 255.0 ) ; boolean effectEnabled = stream . readBoolean ( ) ; stream . skipBytes ( 3 ) ; colorR = stream . readUnsignedByte ( ) ; stream . skipBytes ( 1 ) ; colorG = stream . readUnsignedByte ( ) ; stream . skipBytes ( 1 ) ; colorB = stream . readUnsignedByte ( ) ; Color nativeColor = new Color ( colorR , colorG , colorB ) ; stream . skipBytes ( 2 ) ; SolidFillEffect effect = new SolidFillEffect ( ) ; effect . setVersion ( version ) ; effect . setBlendMode ( BlendMode . getByName ( blendModeKey ) ) ; effect . setEnabled ( effectEnabled ) ; effect . setHighlightColor ( highlightColor ) ; effect . setOpacity ( opacity ) ; effect . setNativeColor ( nativeColor ) ; return effect ; }
Parses the stream to create a SolidFill effect.
Parses the stream to create a SolidFill effect .
//Version: 2 //Highlight color: 2 bytes for space followed by 4 * 2 byte color component //Highlight color: 2 bytes for space followed by 4 * 2 byte color component