Examples of ImageDisplay


Examples of com.smoker.imagesearch.view.ImageDisplay

    displayMessage(JOptionPane.INFORMATION_MESSAGE, ResourceStrings.AboutText);
  }

  private void createAndShowMainGUI()
  {
    imageDisplay = new ImageDisplay(this);
    settings = new Settings();
    if (indexCreator.isIndexFiled())
    {
      load();
    }
View Full Code Here

Examples of net.imagej.display.ImageDisplay

  @Test
  public final void testExtractMask() {
    Dataset dataset = getDatasetService().create(new long [] { 15, 25 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    RectangleOverlay o = new RectangleOverlay(context.getContext());
    o.setOrigin(5, 0);
    o.setOrigin(16, 1);
    o.setExtent(6, 0);
    o.setExtent(7, 1);
View Full Code Here

Examples of net.imagej.display.ImageDisplay

      }
    };
    Dataset dataset = getDatasetService().create(new long [] { 30, 30 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    getOverlayService().addOverlays(iDisplay, Collections.singletonList((Overlay)o));
    for (DataView v:iDisplay) {
      v.setSelected(true);
    }
    Img<BitType> mask = OverlayUtils.extractMask(iDisplay);
View Full Code Here

Examples of net.imagej.display.ImageDisplay

  public void testNoOverlay() {
    // Make sure that extractMask returns null if no overlay.
    Dataset dataset = getDatasetService().create(new long [] { 30, 30 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    for (DataView v:iDisplay) {
      v.setSelected(true);
    }
    assertNull(OverlayUtils.extractMask(iDisplay));
  }
View Full Code Here

Examples of net.imagej.display.ImageDisplay

  @Test
  public void testDeselectedOverlay() {
    Dataset dataset = getDatasetService().create(new long [] { 15, 25 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    RectangleOverlay o = new RectangleOverlay(context.getContext());
    o.setOrigin(5, 0);
    o.setOrigin(3, 1);
    o.setExtent(6, 0);
    o.setExtent(7, 1);
View Full Code Here

Examples of net.imagej.display.ImageDisplay

  @Test
  public void testTwoOverlays() {
    Dataset dataset = getDatasetService().create(new long [] { 30, 30 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    final ArrayList<Overlay> oo = new ArrayList<Overlay>();
    for (double [][] coords:new double [][][] {
        { { 5, 6}, { 3, 7 }},
        { { 1, 4}, { 14, 5}}
    }) {
View Full Code Here

Examples of org.jpedal.render.ImageDisplay

        Graphics2D g2;

        PdfObject Resources=pdfObject.getDictionary(PdfDictionary.Resources);

        ObjectStore localStore = new ObjectStore();
        DynamicVectorRenderer imageDisplay = new ImageDisplay(pageIndex,false, 5000, localStore);

        PdfStreamDecoder currentImageDecoder = new PdfStreamDecoder(currentPdfFile);
        currentImageDecoder.setParameters(true, true, renderMode,0);

        externalHandlers.addHandlers(currentImageDecoder);

        //currentImageDecoder.setObjectValue(ValueTypes.Name, filename);
        currentImageDecoder.setObjectValue(ValueTypes.ObjectStore,localStore);
        currentImageDecoder.setFloatValue(BaseDecoder.Multiplier, multiplyer);
        currentImageDecoder.setObjectValue(ValueTypes.PDFPageData,pageData);
        currentImageDecoder.setIntValue(ValueTypes.PageNum, pageIndex);

        currentImageDecoder.setObjectValue(ValueTypes.DynamicVectorRenderer,imageDisplay);

        res.setupResources(currentImageDecoder, true, Resources,pageIndex,currentPdfFile);

        //can for max
        if(multiplyer==-2){

            multiplyer=-1;
            currentImageDecoder.setFloatValue(BaseDecoder.Multiplier, multiplyer);

            PdfStreamDecoderForSampling currentImageDecoder2 = new PdfStreamDecoderForSampling(currentPdfFile);
            currentImageDecoder2.setParameters(true, true, renderMode,0);

            //currentImageDecoder2.setObjectValue(ValueTypes.Name, filename);
            currentImageDecoder2.setObjectValue(ValueTypes.ObjectStore,localStore);
            currentImageDecoder2.setFloatValue(BaseDecoder.Multiplier, multiplyer);
            currentImageDecoder2.setObjectValue(ValueTypes.PDFPageData,pageData);
            currentImageDecoder2.setIntValue(ValueTypes.PageNum, pageIndex);
            currentImageDecoder2.setObjectValue(ValueTypes.DynamicVectorRenderer,imageDisplay);

            res.setupResources(currentImageDecoder2, true, Resources,pageIndex,currentPdfFile);

            /** bare minimum to get value*/
            multiplyer=currentImageDecoder2.decodePageContentForImageSampling(pdfObject);

            int bestQualityMaxScalingToUse = 0;
            if(instance_bestQualityMaxScaling != null)
                bestQualityMaxScalingToUse = instance_bestQualityMaxScaling;
            else if (bestQualityMaxScaling != null)
                bestQualityMaxScalingToUse = bestQualityMaxScaling;

            if (bestQualityMaxScalingToUse > 0 && multiplyer > bestQualityMaxScalingToUse) {
                multiplyer = bestQualityMaxScalingToUse;
            }

            currentImageDecoder2.setFloatValue(BaseDecoder.Multiplier, multiplyer);
            currentImageDecoder.setFloatValue(BaseDecoder.Multiplier, multiplyer);
        }

        if(!allowPagesSmallerThanPageSize &&
                !instance_allowPagesSmallerThanPageSize &&
                multiplyer<1 && multiplyer>0)
            multiplyer=1;

        //allow for value not set
        if(multiplyer==-1)
            multiplyer=1;

        /**
         * setup transformations and image
         */


        AffineTransform imageScaling = setPageParametersForImage(scaling*multiplyer, pageIndex,pageData);

        //include scaling in size
        int mediaH = (int) (scaling*pageData.getMediaBoxHeight(pageIndex));
        int rotation = pageData.getRotation(pageIndex);

        int crw = (int) (scaling*pageData.getCropBoxWidth(pageIndex));
        int crh = (int) (scaling*pageData.getCropBoxHeight(pageIndex));
        int crx = (int) (scaling*pageData.getCropBoxX(pageIndex));
        int cry = (int) (scaling*pageData.getCropBoxY(pageIndex));

        boolean rotated = false;
        int w, h;
        if ((rotation == 90) || (rotation == 270)) {
            h = (int) (crw*multiplyer); // * scaling);
            w = (int) (crh*multiplyer); // * scaling);
            rotated = true;
        } else {
            w = (int) (crw*multiplyer); // * scaling);
            h = (int) (crh*multiplyer); // * scaling);
        }

        image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);

        Graphics graphics = image.getGraphics();

        g2 = (Graphics2D) graphics;

        if (!imageIsTransparent) {
            g2.setColor(Color.white);
            g2.fillRect(0, 0, w, h);
        }

        /**
         * adjustment for upside down images
         */
        if(rotation==180){
            g2.translate(crx*2*multiplyer, -(cry*2*multiplyer));
        }

        /**
         * pass in values as needed for patterns
         */
        ((DynamicVectorRenderer)currentImageDecoder.getObjectValue(ValueTypes.DynamicVectorRenderer)).setScalingValues(crx*multiplyer, (crh*multiplyer) + cry, multiplyer*scaling);


        g2.setRenderingHints(ColorSpaces.hints);
        g2.transform(imageScaling);

        if (rotated){

            if(rotation==90){//90

                if(multiplyer<1){
                    cry = (int)(imageScaling.getTranslateX() + cry);
                    crx = (int)(imageScaling.getTranslateY() + crx);

                }else{
                    cry = (int)((imageScaling.getTranslateX()/multiplyer) + cry);
                    crx = (int)((imageScaling.getTranslateY()/multiplyer) + crx);
                }
                g2.translate(-crx, -cry);

            }else{ //270
                if(cry<0)
                    g2.translate(-crx, mediaH-crh+cry);
                else
                    g2.translate(-crx,mediaH-crh-cry);
            }
        }

        /** decode and print in 1 go */
        currentImageDecoder.setObjectValue(ValueTypes.DirectRendering, g2);//(Graphics2D) graphics);
        imageDisplay.setG2(g2);
        if (pdfObject != null){
            currentImageDecoder.decodePageContent(pdfObject);
        }

        g2.setClip(null);
View Full Code Here

Examples of ptolemy.domains.sdf.lib.vq.ImageDisplay

        //         prnPanel.setLayout(new BorderLayout());
        //         prnPanel.add(new JLabel("SNR (dB)"), BorderLayout.NORTH);
        //         displayPanel.add(prnPanel, BorderLayout.SOUTH);

        CompositeEntity toplevel = (CompositeEntity) _toplevel;
        ImageDisplay consumer = (ImageDisplay) toplevel.getEntity("Compressed");
        compressedPanel.add(new JLabel("Compressed"), BorderLayout.NORTH);
        consumer.place(compressedPanel);
        displayPanel.add(compressedPanel, BorderLayout.EAST);
        consumer.setBackground(null);

        ImageDisplay original = (ImageDisplay) toplevel.getEntity("Original");
        originalPanel.add(new JLabel("Original"), BorderLayout.NORTH);
        original.place(originalPanel);
        displayPanel.add(originalPanel, BorderLayout.WEST);
        original.setBackground(null);

        SequencePlotter plot = (SequencePlotter) toplevel
                .getEntity("Signal To Noise Ratio");

        JPanel plotPanel = new JPanel();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.