Package org.photovault.image

Examples of org.photovault.image.ChannelMapRuleSet


                }
                RawSettingsFactory f = (RawSettingsFactory) digester.peek();
                f.setDaylightMultipliers( new double[] {rg, 1.0, bg} );
            }
        });
        digester.addRuleSet( new ChannelMapRuleSet( "*/photo/") );
        digester.addRule( "*/photo/color-mapping", new Rule() {
            public void end( String namespace, String name ) {
                PhotoInfo p = (PhotoInfo) digester.peek(1);
                ChannelMapOperationFactory f =
                        (ChannelMapOperationFactory) digester.peek();
                p.setColorChannelMapping( f.create() );               
            }
        });
       
        digester.addObjectCreate( "*/photo/raw-conversion", RawSettingsFactory.class );
        digester.addRule( "*/photo/raw-conversion", new Rule() {
            public void end( String namespace, String name ) {
                PhotoInfo p = (PhotoInfo)digester.peek(1);
                RawSettingsFactory f = (RawSettingsFactory) digester.peek();
                try {
                    p.setRawSettings( f.create() );
                } catch (PhotovaultException ex) {
                    digester.createSAXException( ex );
                }
            }
        })
       
        // Instance mappings
        digester.addFactoryCreate( "*/photo/instances/instance", new InstanceFactory() );
        digester.addCallMethod( "*/instance/file-size", "setFileSize", 0, new Class[] {Long.class} );
        digester.addCallMethod( "*/instance/width", "setWidth", 0, new Class[] {Integer.class} );
        digester.addCallMethod( "*/instance/height", "setHeight", 0, new Class[] {Integer.class} );
        digester.addCallMethod( "*/instance/crop", "setRotated", 1, new Class[] {Double.class} );
        digester.addCallParam( "*/instance/crop", 0, "rot" );
        digester.addFactoryCreate( "*/instance/crop", new RectangleFactory() );
        digester.addSetNext( "*/instance/crop", "setCropBounds" );
        digester.addRule( "*/instance/hash", new Rule() {
            public void body( String namespace, String name, String text ) {
                byte[] hash = Base64.decode( text );
                ImageInstance i = (ImageInstance) digester.peek();
                i.setHash( hash );
            }
        } );
        digester.addRuleSet( new ChannelMapRuleSet( "*/instance/") );
        digester.addRule( "*/instance/color-mapping", new Rule() {
            public void end( String namespace, String name ) {
                ImageInstance i = (ImageInstance) digester.peek(1);
                ChannelMapOperationFactory f =
                        (ChannelMapOperationFactory) digester.peek();
View Full Code Here

TOP

Related Classes of org.photovault.image.ChannelMapRuleSet

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.