Package com.lightcrafts.mediax.jai

Examples of com.lightcrafts.mediax.jai.ImageLayout


        ColorModel cm = new ComponentColorModel(new BogusColorSpace(2),
                                                false, false, Transparency.OPAQUE, DataBuffer.TYPE_USHORT);
        SampleModel sm = cm.createCompatibleSampleModel(source.getWidth(), source.getHeight());

        return new ImageLayout(source.getMinX(), source.getMinY(),
                        source.getWidth(), source.getHeight(),
                        source.getTileGridXOffset(), source.getTileGridYOffset(),
                        source.getTileWidth(), source.getTileHeight(),
                        sm, cm);
    }
View Full Code Here


    private double sigmoid(double x) {
        return x + intensity * x * (1 - 1 / (1 + Math.exp(-6*(x - 0.01))));
    }

    public HDROpImage(RenderedImage source, RenderedImage mask, double intensity, double gamma, double detail, Map config) {
        super(source, mask, new ImageLayout(source), config, true);

        int numBandsSrc = source.getSampleModel().getNumBands();
        int numBandsMask = mask.getSampleModel().getNumBands();
        int dataType = source.getSampleModel().getDataType();

View Full Code Here

     * @param renderHints  Optionally contains destination image layout.
     */
    public RenderedImage create(ParameterBlock paramBlock,
                                RenderingHints renderHints) {
        // Get ImageLayout from renderHints if any.
        ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);


        return new UnSharpMaskOpImage(paramBlock.getRenderedSource(0),
                                      paramBlock.getRenderedSource(1),
                                      renderHints,
View Full Code Here

                          dataType, tileWidth, tileHeight, numBands);
        } else {
            sampleModel = RasterFactory.createPixelInterleavedSampleModel(
                                  dataType, tileWidth, tileHeight, numBands);
        }
        return new ImageLayout(minX, minY, width, height,
                               tileX, tileY, tileWidth, tileHeight,
                               sampleModel, createComponentColorModel());
    }
View Full Code Here

     * @param renderHints  Optionally contains destination image layout.
     */
    public RenderedImage create(ParameterBlock paramBlock,
                                RenderingHints renderHints) {
        // Get ImageLayout from renderHints if any.
        ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);

        return new BlendOpImage(paramBlock.getRenderedSource(0),
                                paramBlock.getRenderedSource(1),
                                (String) paramBlock.getObjectParameter(0),
                                (Double) paramBlock.getObjectParameter(1),
View Full Code Here

    private static ImageLayout createLayout(RenderedImage source) {
        ColorModel cm = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_GRAY),
                                                false, false,
                                                Transparency.OPAQUE, DataBuffer.TYPE_BYTE);

        ImageLayout layout = new ImageLayout(source);
        layout.setColorModel(cm);
        layout.setSampleModel(cm.createCompatibleSampleModel(source.getWidth(), source.getHeight()));
        return layout;
    }
View Full Code Here

        }
        return dst;
    }

    public static void main (String args[]) {
        ImageLayout layout = new ImageLayout();
        layout.setTileWidth(64);
        layout.setTileHeight(64);
        layout.setColorModel(OpImageTester.createComponentColorModel());

        PlanarImage image =
            new RandomOpImage(0, 0, 100, 100,
                              RasterFactory.createPixelInterleavedSampleModel(
                                              DataBuffer.TYPE_BYTE, 64, 64, 3),
View Full Code Here

     * This method satisfies the implementation of RIF.
     */
    public RenderedImage create(ParameterBlock paramBlock,
                                RenderingHints renderHints) {
        // Get ImageLayout from renderHints if any.
        ImageLayout layout = (renderHints == null) ? null :
      (ImageLayout)renderHints.get(JAI.KEY_IMAGE_LAYOUT);
       
        return OpImageTester.createRandomOpImage(renderHints, layout);
    }
View Full Code Here

                    new LCTIFFReader.TIFFImage( fileName );
                if (tiffImage.getTileWidth() != JAIContext.TILE_WIDTH ||
                    tiffImage.getTileHeight() != JAIContext.TILE_HEIGHT) {
                    final RenderingHints formatHints = new RenderingHints(
                        JAI.KEY_IMAGE_LAYOUT,
                        new ImageLayout(
                            0, 0, JAIContext.TILE_WIDTH, JAIContext.TILE_HEIGHT,
                            tiffImage.getSampleModel(),
                            tiffImage.getColorModel()
                        )
                    );
View Full Code Here

        final SampleModel tsm = ccm.createCompatibleSampleModel(
            JAIContext.TILE_WIDTH, JAIContext.TILE_HEIGHT
        );

        // Layout of the output image.
        final ImageLayout layout = new ImageLayout(
            0, 0, m_width, m_height, 0, 0, JAIContext.TILE_WIDTH,
            JAIContext.TILE_HEIGHT, tsm, ccm
        );

        // The output image itself, directly allocated in the file cache.
View Full Code Here

TOP

Related Classes of com.lightcrafts.mediax.jai.ImageLayout

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.