Package jsky.image

Examples of jsky.image.ImageProcessor


        double x = p.x, y = p.y;

        int width = _imageDisplay.getImageWidth(),
                height = _imageDisplay.getImageHeight();

        ImageProcessor imageProcessor = _imageDisplay.getImageProcessor();
        boolean flipY = (imageProcessor.getFlipY() != imageProcessor.getReverseY());
        if (imageProcessor.isInvertedYAxis())
            flipY = !flipY;
        if (flipY)
            y = height - c - y;

        if (imageProcessor.getFlipX())
            x = width - c - x;

        p.setLocation(x, y);
    }
View Full Code Here


     *
     * @param p the point to rotate
     * @param factor set to 1 to rotate, -1 to undo the rotation
     */
    public void rotate(Point2D.Double p, int factor) {
        ImageProcessor imageProcessor = _imageDisplay.getImageProcessor();

        // angle is in rad
        double angle = imageProcessor.getAngle() * -factor;
        if (angle == 0.0)
            return;

        double cx = _imageDisplay.getImageWidth() / 2.0;
        double cy = _imageDisplay.getImageHeight() / 2.0;
View Full Code Here

     *
     * @param pane the Diva GraphicsPane to use (contains the layers used to display the
     *             image and graphics)
     */
    public DivaMainImageDisplay(GraphicsPane pane) {
        super(pane, new ImageProcessor(), "Main Image");

        _historyList = new ImageHistoryList(this);
        setDownloadState(false);
        updateEnabledStates();

View Full Code Here

        JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem("Flip Y");
        menuItem.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                JCheckBoxMenuItem rb = (JCheckBoxMenuItem) e.getSource();
                ImageProcessor imageProcessor = _imageDisplay.getImageProcessor();
                imageProcessor.setFlipY(rb.getState());
                imageProcessor.update();
            }
        });

        return menuItem;
    }
View Full Code Here

        ItemListener itemListener = new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                JRadioButtonMenuItem rb = (JRadioButtonMenuItem) e.getSource();
                double rad = Math.PI / 180.;
                ImageProcessor imageProcessor = _imageDisplay.getImageProcessor();
                if (rb.isSelected()) {
                    if (rb.getText().equals("No Rotation")) {
                        imageProcessor.setAngle(0.0);
                    } else if (rb.getText().equals("  90 deg")) {
                        imageProcessor.setAngle(90.0 * rad);
                    } else if (rb.getText().equals(" 180 deg")) {
                        imageProcessor.setAngle(180.0 * rad);
                    } else if (rb.getText().equals(" -90 deg")) {
                        imageProcessor.setAngle(-90.0 * rad);
                    }
                    //else if (rb.getText().equals("  45 deg (XXX not impl)")) {
                    //    imageProcessor.setAngle(45.0*rad);
                    //}
                    imageProcessor.update();
                }
            }
        };

        b1.addItemListener(itemListener);
View Full Code Here

        JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem("Flip X");
        menuItem.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                JCheckBoxMenuItem rb = (JCheckBoxMenuItem) e.getSource();
                ImageProcessor imageProcessor = _imageDisplay.getImageProcessor();
                imageProcessor.setFlipX(rb.getState());
                imageProcessor.update();
            }
        });

        return menuItem;
    }
View Full Code Here

    public ImagePanner(MainImageDisplay mainImageDisplay, int width, int height) {
        _imageDisplay = new ImageDisplay("pan window");
        _imageDisplay.setPrescaled(true);
        _imageDisplay.addImageGraphicsHandler(this);

        ImageProcessor ip = _imageDisplay.getImageProcessor();
        ip.removeChangeListener((ChangeListener) _imageDisplay); // not needed here
        ip.setName("Panner ip"); // for debugging

        JComponent c = (JComponent) _imageDisplay;
        _panWidth = width;
        _panHeight = height;
        c.setPreferredSize(new Dimension(_panWidth, _panHeight));
View Full Code Here

        // try to save time by getting a prescaled thumbnail image
        if (_pannerImage == null) {
            _pannerImage = _getPannerImage();
        }

        ImageProcessor ip = _imageDisplay.getImageProcessor();
        ip.setSourceImage(_pannerImage, _mainImageDisplay.getImageProcessor());
        ip.update();

        _imageDisplay.updateImage();
    }
View Full Code Here

     * Construct an image display widget with the given name.
     *
     * @param name name to associate with this instance
     */
    public ImageDisplay(String name) {
        this(new ImageProcessor(), name);
    }
View Full Code Here

            // try to extract the pixel value under the mouse and display it
            p = new Point2D.Double(e.getX(), e.getY());
            imageDisplay.getCoordinateConverter().screenToUserCoords(p, false);
            float pixel = imageDisplay.getPixelValue(p, 0);

            ImageProcessor imageProcessor = imageDisplay.getImageProcessor();
            if (pixel == imageProcessor.getBlank()) {
                pixelValueTextField.setText(_I18N.getString("blank"));
            } else {
                pixelValueTextField.setText(String.valueOf(pixel));
            }
        } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of jsky.image.ImageProcessor

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.