Package ptolemy.data

Examples of ptolemy.data.ImageToken


     */
    public void fire() throws IllegalActionException {
        super.fire();

        ParameterBlock parameters = new ParameterBlock();
        ImageToken imageToken = (ImageToken) input.get(0);
        Image awtImage = imageToken.asAWTImage();
        parameters.add(awtImage);

        RenderedOp jaiImage = JAI.create("awtImage", parameters);
        output.send(0, new JAIImageToken(jaiImage));
    }
View Full Code Here


     */
    public void fire() throws IllegalActionException {
        super.fire();

        if (input.hasToken(0)) {
            ImageToken imageToken = (ImageToken) input.get(0);
            Image image = imageToken.asAWTImage();
            Buffer buffer = ImageToBuffer.createBuffer(image, _frameRate);
            output.send(0, new JMFImageToken(buffer));
        }
    }
View Full Code Here

        int width = input.getWidth();
        int rotation = ((IntToken) (rotationInDegrees.getToken())).intValue();

        for (int i = 0; i < width; i++) {
            if (input.hasToken(i)) {
                ImageToken imageToken = (ImageToken) input.get(i);
                Image image = imageToken.asAWTImage();
                Image rotatedImage = Transform.rotate(image, rotation);
                output.broadcast(new AWTImageToken(rotatedImage));
            }
        }
    }
View Full Code Here

        super.fire();
        int width = input.getWidth();

        for (int i = 0; i < width; i++) {
            if (input.hasToken(i)) {
                ImageToken imageToken = (ImageToken) input.get(i);
                Image image = imageToken.asAWTImage();
                String description = "Image: " + image.getWidth(null) + " x "
                        + image.getHeight(null);
                Token out = new StringToken(description);
                output.broadcast(out);
            }
View Full Code Here

     *   contain an image, or if there is no director.
     *  @return True.
     */
    public boolean postfire() throws IllegalActionException {
        if (input.hasToken(0)) {
            ImageToken token = (ImageToken) input.get(0);
            Image value = token.asAWTImage();
            _icon.setImage(value);
        }

        return true;
    }
View Full Code Here

TOP

Related Classes of ptolemy.data.ImageToken

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.