Examples of TiledImage


Examples of com.lightcrafts.mediax.jai.TiledImage

    private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        theObject = in.readObject();
        if(isWritable) {
            theObject = new TiledImage((RenderedImage)theObject, true);
        }
    }
View Full Code Here

Examples of com.lightcrafts.mediax.jai.TiledImage

                // Create an ROI in destination rendered space.
                ROIShape roi = new ROIShape(at.createTransformedShape(rgn));

                // Create a TiledImage to contain the masked result.
                TiledImage ti = new TiledImage(rendering.getMinX(),
                                               rendering.getMinY(),
                                               rendering.getWidth(),
                                               rendering.getHeight(),
                                               rendering.getTileGridXOffset(),
                                               rendering.getTileGridYOffset(),
                                               rendering.getSampleModel(),
                                               rendering.getColorModel());

                // Set the TiledImage data source to the rendering.
                ti.set(rendering, roi);

                // Create a constant-valued image for the background.
                pb = new ParameterBlock();
                pb.add((float)ti.getWidth());
                pb.add((float)ti.getHeight());
                Byte[] bandValues =
                    new Byte[ti.getSampleModel().getNumBands()];
                for(int b = 0; b < bandValues.length; b++) {
                    bandValues[b] = new Byte((byte)255);
                }
                pb.add(bandValues);

                ImageLayout il = new ImageLayout();
                il.setSampleModel(ti.getSampleModel());
                RenderingHints rh = new RenderingHints(JAI.KEY_IMAGE_LAYOUT,
                                                       il);

                PlanarImage constImage = JAI.create("constant", pb, rh);

                // Compute a complement ROI.
                ROI complementROI =
                    (new ROIShape(ti.getBounds())).subtract(roi);;

                // Fill the background.
                int maxTileY = ti.getMaxTileY();
                int maxTileX = ti.getMaxTileX();
                for(int j = ti.getMinTileY(); j <= maxTileY; j++) {
                    for(int i = ti.getMinTileX(); i <= maxTileX; i++) {
                        if(!roi.intersects(ti.getTileRect(i, j))) {
                            ti.setData(constImage.getTile(i, j),
                                       complementROI);
                        }
                    }
                }
View Full Code Here

Examples of de.sciss.gui.TiledImage

  public LockButton( boolean grayscaleUnlock )
  {
    super();

    if( imgLockIcons == null ) {
      imgLockIcons = new TiledImage( getClass().getResource( "lock.png" ), 16, 16 );
    }
    icnLocked  = imgLockIcons.createIcon( 0, 0 );
    icnLockedD  = imgLockIcons.createIcon( 0, 1 );
    icnUnlocked = imgLockIcons.createIcon( grayscaleUnlock ? 2 : 1, 0 );
    icnUnlockedD= imgLockIcons.createIcon( grayscaleUnlock ? 2 : 1, 1 );
View Full Code Here

Examples of de.sciss.gui.TiledImage

  public LockButton( boolean grayscaleUnlock )
  {
    super();

    if( imgLockIcons == null ) {
      imgLockIcons = new TiledImage( getClass().getResource( "lock.png" ), 16, 16 );
    }
    icnLocked  = imgLockIcons.createIcon( 0, 0 );
    icnLockedD  = imgLockIcons.createIcon( 0, 1 );
    icnUnlocked = imgLockIcons.createIcon( grayscaleUnlock ? 2 : 1, 0 );
    icnUnlockedD= imgLockIcons.createIcon( grayscaleUnlock ? 2 : 1, 1 );
View Full Code Here

Examples of de.sciss.gui.TiledImage

   
    // ------- flags -------
   
    if( ((flags & TRIPLET) != 0) && small ) {
      if( imgTriplet == null ) {
        imgTriplet = new TiledImage( getClass().getResource( AquaFocusBorder.getAquaColorVariant() == 1 ? "paletteblue.png" : "palettegraphite.png" ), 11, 12 );
      }

      tripletML = new MouseAdapter() {
        public void mouseEntered( MouseEvent e )
        {
View Full Code Here

Examples of javax.media.jai.TiledImage

        // Create a grayscale colormodel.
        ComponentColorModel colorModel = new ComponentColorModel(
                new ICC_ColorSpace(ICC_Profile.getInstance(ColorSpace.CS_GRAY)),
                false, false, Transparency.OPAQUE, DataBuffer.TYPE_DOUBLE);
        TiledImage tiledImage = new TiledImage(0, 0, width, height, 0, 0,
                sampleModel, colorModel);
        tiledImage.setData(raster);

        ParameterBlock parameters = new ParameterBlock();
        parameters.addSource(tiledImage);

        switch (_dataFormat) {
View Full Code Here

Examples of javax.media.jai.TiledImage

            // Ensure that the image has the correct color space information
            WritableRaster r = img.getRaster();
            ColorSpace cs = ColorSpace.getInstance( ColorSpace.CS_LINEAR_RGB );
            ColorModel targetCM = new ComponentColorModel( cs, new int[]{16,16,16},
                    false, false, Transparency.OPAQUE, DataBuffer.TYPE_USHORT );
            rawImage = new TiledImage( new BufferedImage( targetCM, r,
                    true, null ), 256, 256 );

           
            final float[] DEFAULT_KERNEL_1D = {0.25f,0.5f,0.25f};
            ParameterBlock pb = new ParameterBlock();
View Full Code Here

Examples of javax.media.jai.TiledImage

        }

        //_dataType = _getDataType();
        SampleModel sampleModel = _initSampleModel(tileWidth, tileHeight);
        ColorModel colorModel = _initColorModel(sampleModel);
        TiledImage tiledImage = new TiledImage(0, 0, tileWidth, tileHeight, 0, 0, sampleModel, colorModel);
        Point origin = new Point(0, 0);
        Raster raster = RasterFactory.createWritableRaster(sampleModel, origin);

        try {
            raster = _fitsData.getPreviewImage(raster, factor);
        } catch (EOFException e) {
            //System.out.println("XXX FITSImage._getPreviewImage(): warning: " + e.toString());
        } catch (IndexOutOfBoundsException e) {
            //System.out.println("XXX FITSImage._getPreviewImage(): warning: " + e.toString());
        } catch (IOException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
        if (raster == null) {
            return null;
        }

        tiledImage.setData(raster);
        return tiledImage;
    }
View Full Code Here

Examples of javax.media.jai.TiledImage

                            /*
                             TODO: JAI seems to have problems in doing convolutions
                             for large image tiles. Split image to reasonably sized
                             tiles as a workaround for this.
                             */
                            ri = new TiledImage( ri, 256, 256 );
                            image =  new RenderedImageAdapter( ri );
                            originalSampleModel = image.getSampleModel();
                            originalColorModel = image.getColorModel();
                            final float[] DEFAULT_KERNEL_1D = {0.25f,0.5f,0.25f};
                            ParameterBlock pb = new ParameterBlock();
View Full Code Here

Examples of javax.media.jai.TiledImage

    private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        theObject = in.readObject();
        if(isWritable) {
            theObject = new TiledImage((RenderedImage)theObject, true);
        }
    }
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.