当前位置: 首页>>代码示例>>Java>>正文


Java ImageLayout类代码示例

本文整理汇总了Java中javax.media.jai.ImageLayout的典型用法代码示例。如果您正苦于以下问题:Java ImageLayout类的具体用法?Java ImageLayout怎么用?Java ImageLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ImageLayout类属于javax.media.jai包,在下文中一共展示了ImageLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LookupOpImage

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
 * Constructor.
 *
 * <p>If a <code>SampleModel</code> is supplied in the <code>layout</code>
 * parameter, it may be ignored in case it's unsuitable for this
 * operation. In this case the default <code>SampleModel</code>
 * and <code>ColorModel</code> are used.
 *
 * @param source  The source image.
 * @param layout  The destination image layout.
 * @param table   The table used to perform the lookup operation,
 *                stored by reference.
 */
public LookupOpImage(RenderedImage source,
                     Map config,
                     ImageLayout layout,
                     LookupTableJAI table) {
    super(source, layout, config, true);

    this.table = table;

    SampleModel sm = source.getSampleModel();	// source sample model

    if (sampleModel.getTransferType() != table.getDataType() ||
        sampleModel.getNumBands() !=
            table.getDestNumBands(sm.getNumBands())) {
        /*
         * The current SampleModel is not suitable for the supplied
         * source and lookup table. Create a suitable SampleModel
         * and ColorModel for the destination image.
         */
        sampleModel = table.getDestSampleModel(sm, tileWidth, tileHeight);
        if(colorModel != null &&
           !JDKWorkarounds.areCompatibleDataModels(sampleModel,
                                                   colorModel)) {
            colorModel = ImageUtil.getCompatibleColorModel(sampleModel,
                                                           config);
        }
    }

    // Set flag to permit in-place operation.
    permitInPlaceOperation();

    // Initialize the colormap if necessary.
    initializeColormapOperation();
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:47,代码来源:LookupOpImage.java

示例2: create

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
 * Create a new instance of GradientOpImage in the rendered layer.
 * This method satisfies the implementation of RIF.
 *
 * @param paramBlock  The source image and the gradient's
 *                    horizontal kernel & vertical kernel.
 */
public RenderedImage create(ParameterBlock paramBlock,
                            RenderingHints renderHints) {
     // Get ImageLayout from renderHints if any.
    ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
    

    // Get BorderExtender from renderHints if any.
    BorderExtender extender = RIFUtil.getBorderExtenderHint(renderHints);
    
    RenderedImage source = paramBlock.getRenderedSource(0);

    // Get the Horizontal & Vertical kernels
    KernelJAI kern_h = (KernelJAI)paramBlock.getObjectParameter(0);
    KernelJAI kern_v = (KernelJAI)paramBlock.getObjectParameter(1);
    
    return new GradientOpImage(source,
                               extender,
                               renderHints,
                               layout,
                               kern_h,
                               kern_v);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:30,代码来源:GradientRIF.java

示例3: AffineBicubic2OpImage

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
 * Constructs an AffineBicubic2OpImage from a RenderedImage source,
 *
 * @param source a RenderedImage.
 * @param extender a BorderExtender, or null.
 * @param layout an ImageLayout optionally containing the tile grid layout,
 *        SampleModel, and ColorModel, or null.
 * @param interp an Interpolation object to use for resampling
 * @param transform the desired AffineTransform.
 */
public AffineBicubic2OpImage(RenderedImage source,
                             BorderExtender extender,
                             Map config,
                             ImageLayout layout,
                             AffineTransform transform,
                             Interpolation interp,
                             double[] backgroundValues) {
    super(source,
          extender,
          config,
          layout,
          transform,
          interp,
          backgroundValues);

    subsampleBits = interp.getSubsampleBitsH();
    shiftvalue = 1 << subsampleBits;
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:29,代码来源:AffineBicubic2OpImage.java

示例4: CompositeNoDestAlphaOpImage

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
    * Constructor.
    *
    * @param source1  The foreground source image.
    * @param source2  The background source image.

    * @param layout  The destination image layout.
    * @param alpha1  The alpha image for the first source.
    * @param alpha2  The alpha image for the second source. If
    *        <code>null</code>, the second source is assumed to be opaque.
    * @param premultiplied  Indicates whether both sources and destination
    *        have their alpha premultiplied.
    */
   public CompositeNoDestAlphaOpImage(RenderedImage source1,
                                      RenderedImage source2,
                                      Map config,
                                      ImageLayout layout,
                                      RenderedImage alpha1,
                                      RenderedImage alpha2,
                                      boolean premultiplied) {
       super(source1, source2, layout, config, true);

       this.alpha1 = alpha1;
       this.alpha2 = alpha2;
       this.premultiplied = premultiplied;

tags = getFormatTags();
   }
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:29,代码来源:CompositeNoDestAlphaOpImage.java

示例5: create

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
 * Factory method for creating a TileOpImage instance.
 *
 * @param imageFile     The JP2 file
 * @param cacheDir      The directory where decompressed tiles will be extracted
 * @param bandIdx       The index of the band for which the operator is created
 * @param row           The row of the tile in the scene layout
 * @param col           The column of the tile in the scene layout
 * @param tileLayout    The scene layout
 * @param imageModel    The multi-level image model
 * @param dataType      The data type of the tile raster
 * @param level         The resolution at which the tile is created
 */
public static PlanarImage create(Path imageFile, Path cacheDir, int bandIdx,
                                 int row, int col, TileLayout tileLayout,
                                 MultiLevelModel imageModel, int dataType, int level) throws IOException {
    Assert.notNull(cacheDir, "cacheDir");
    Assert.notNull(tileLayout, "imageLayout");
    Assert.notNull(imageModel, "imageModel");
    if (imageFile != null) {
        //jp2TileOpImage.setTileCache(null); // the MosaicOpImage will be in the cache
        return new JP2TileOpImage(imageFile, bandIdx, cacheDir, row, col, tileLayout, imageModel, dataType, level);
    } else {
        int targetWidth = tileLayout.tileWidth;
        int targetHeight = tileLayout.tileHeight;
        Dimension targetTileDim = getTileDimAtResolutionLevel(tileLayout.tileWidth, tileLayout.tileHeight, level);
        SampleModel sampleModel = ImageUtils.createSingleBandedSampleModel(dataType, targetWidth, targetHeight);
        ImageLayout imageLayout = new ImageLayout(0, 0, targetWidth, targetHeight, 0, 0, targetTileDim.width, targetTileDim.height, sampleModel, null);
        return ConstantDescriptor.create((float) imageLayout.getWidth(null),
                (float) imageLayout.getHeight(null),
                new Short[]{0},
                new RenderingHints(JAI.KEY_IMAGE_LAYOUT, imageLayout));
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:35,代码来源:JP2TileOpImage.java

示例6: create

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
 * Creates a new instance of <code>OverlayOpImage</code>
 * in the rendered layer.
 *
 * @param args   The two source images.
 * @param hints  Optionally contains destination image layout.
 */
public RenderedImage create(ParameterBlock args,
                            RenderingHints renderHints) {
    // Get ImageLayout from renderHints if any.
    ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
    

    return new OverlayOpImage(args.getRenderedSource(0),
                              args.getRenderedSource(1),
                              renderHints,
                              layout);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:19,代码来源:OverlayCRIF.java

示例7: create

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
    * Creates a new instance of <code>BandMergeOpImage</code> in the
    * rendered layer. This method satisifies the implementation of RIF.
    *
    * @param paramBlock   The two or more source images to be "BandMerged"
    * together, and their corresponding float array vector. 
    * @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);
       
   
// get vector of RenderedImage sources and parameters
Vector sources = paramBlock.getSources();
//Vector params  = paramBlock.getParameters();

return new BandMergeOpImage(sources,
			    renderHints,
			    layout);

   }
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:24,代码来源:BandMergeCRIF.java

示例8: sampleModelHelper

import javax.media.jai.ImageLayout; //导入依赖的package包/类
private static SampleModel sampleModelHelper(int numBands,
                                             ImageLayout layout) {
    SampleModel sampleModel;
    if (layout!= null && layout.isValid(ImageLayout.SAMPLE_MODEL_MASK)) {
        sampleModel = layout.getSampleModel(null);

        if (sampleModel.getNumBands() != numBands) {
            throw new RuntimeException(JaiI18N.getString("ImageFunctionRIF0"));
        }
    } else { // Create a SampleModel.
        // Use a dummy width and height, OpImage will fix them
        sampleModel = RasterFactory.createBandedSampleModel(
                                                      DataBuffer.TYPE_FLOAT,
                                                      1, 1,
                                                      numBands);
    }

    return sampleModel;
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:20,代码来源:ImageFunctionOpImage.java

示例9: DilateOpImage

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
    * Creates a DilateOpImage given a ParameterBlock containing the image
    * source and pre-rotated dilation kernel.  The image dimensions are 
    * derived
    * from the source image.  The tile grid layout, SampleModel, and
    * ColorModel may optionally be specified by an ImageLayout
    * object.
    *
    * @param source a RenderedImage.
    * @param extender a BorderExtender, or null.
    * @param layout an ImageLayout optionally containing the tile grid layout,
    *        SampleModel, and ColorModel, or null.
    * @param kernel the pre-rotated dilation KernelJAI.
    */
   public DilateOpImage(RenderedImage source,
                          BorderExtender extender,
                          Map config,
                          ImageLayout layout,
                          KernelJAI kernel) {
super(source,
             layout,
             config,
             true,
             extender,
             kernel.getLeftPadding(),
             kernel.getRightPadding(),
             kernel.getTopPadding(),
             kernel.getBottomPadding());
       
this.kernel = kernel;
kw = kernel.getWidth();
kh = kernel.getHeight();
kx = kernel.getXOrigin();
ky = kernel.getYOrigin();

       kdata = kernel.getKernelData();
   }
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:38,代码来源:DilateOpImage.java

示例10: readAig

import javax.media.jai.ImageLayout; //导入依赖的package包/类
private void readAig( File mapFile ) throws IllegalArgumentException, IOException {
    final ImageLayout l = new ImageLayout();
    l.setTileGridXOffset(0).setTileGridYOffset(0).setTileHeight(512).setTileWidth(512);

    Hints hints = new Hints();
    hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, l));

    final URL url = mapFile.toURI().toURL();
    final Object source = url;
    final BaseGDALGridCoverage2DReader reader = new AIGReader(source, hints);
    originalEnvelope = reader.getOriginalEnvelope();
    if (!doEnvelope) {
        outRaster = (GridCoverage2D) reader.read(generalParameter);

        resample();
        checkNovalues();
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:OmsRasterReader.java

示例11: XorConstOpImage

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param source     The source image.
 * @param layout     The destination image layout.
 * @param constants  The constants to be xored, stored as reference.
 */
public XorConstOpImage(RenderedImage source,
  Map config,
                       ImageLayout layout,
  int[] constants) {
    super(source, layout, config, true);

    int numBands = getSampleModel().getNumBands();

    if (constants.length < numBands) {
        this.constants = new int[numBands];
        for (int i = 0; i < numBands; i++) {
            this.constants[i] = constants[0];
        }
    } else {
        this.constants = (int[])constants.clone();
    }

    // Set flag to permit in-place operation.
    permitInPlaceOperation();

    // Initialize the colormap if necessary.
    initializeColormapOperation();
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:31,代码来源:XorConstOpImage.java

示例12: AndConstOpImage

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param source     The source image.
 * @param layout     The destination image layout.
 * @param constants  The constants to be anded, stored as reference.
 */
public AndConstOpImage(RenderedImage source,
                       Map config,
                       ImageLayout layout,
                       int[] constants) {
    super(source, layout, config, true);

    int numBands = getSampleModel().getNumBands();

    if (constants.length < numBands) {
        this.constants = new int[numBands];
        for (int i = 0; i < numBands; i++) {
            this.constants[i] = constants[0];
        }
    } else {
 this.constants = (int[])constants.clone();
    }

    // Set flag to permit in-place operation.
    permitInPlaceOperation();

    // Initialize the colormap if necessary.
    initializeColormapOperation();
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:31,代码来源:AndConstOpImage.java

示例13: ConvolveOpImage

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
    * Creates a ConvolveOpImage given a ParameterBlock containing the image
    * source and pre-rotated convolution kernel.  The image dimensions are 
    * derived
    * from the source image.  The tile grid layout, SampleModel, and
    * ColorModel may optionally be specified by an ImageLayout
    * object.
    *
    * @param source a RenderedImage.
    * @param extender a BorderExtender, or null.
    * @param layout an ImageLayout optionally containing the tile grid layout,
    *        SampleModel, and ColorModel, or null.
    * @param kernel the pre-rotated convolution KernelJAI.
    */
   public ConvolveOpImage(RenderedImage source,
                          BorderExtender extender,
                          Map config,
                          ImageLayout layout,
                          KernelJAI kernel) {
super(source,
             layout,
             config,
             true,
             extender,
             kernel.getLeftPadding(),
             kernel.getRightPadding(),
             kernel.getTopPadding(),
             kernel.getBottomPadding());
       
this.kernel = kernel;
kw = kernel.getWidth();
kh = kernel.getHeight();
kx = kernel.getXOrigin();
ky = kernel.getYOrigin();
   }
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:36,代码来源:ConvolveOpImage.java

示例14: AddConstOpImage

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param source     The source image.
 * @param layout     The destination image layout.
 * @param constants  The constants to be added, stored as reference.
 */
public AddConstOpImage(RenderedImage source,
                       Map config,
                       ImageLayout layout,
                       double[] constants) {
    super(source, layout, config, true);

    int numBands = getSampleModel().getNumBands();

    if (constants.length < numBands) {
        this.constants = new double[numBands];
        for (int i = 0; i < numBands; i++) {
            this.constants[i] = constants[0];
        }
    } else {
        this.constants = (double[])constants.clone();
    }

    // Set flag to permit in-place operation.
    permitInPlaceOperation();

    // Initialize the colormap if necessary.
    initializeColormapOperation();
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:31,代码来源:AddConstOpImage.java

示例15: MultiplyConstOpImage

import javax.media.jai.ImageLayout; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param source     The source image.
 * @param layout     The destination image layout.
 * @param constants  The constants to be multiplied, stored as reference.
 */
public MultiplyConstOpImage(RenderedImage source,
                            Map config,
                            ImageLayout layout,
                            double[] constants) {
    super(source, layout, config, true);

    int numBands = getSampleModel().getNumBands();

    if (constants.length < numBands) {
        this.constants = new double[numBands];
        for (int i = 0; i < numBands; i++) {
            this.constants[i] = constants[0];
        }
    } else {
        this.constants = (double[])constants.clone();
    }

    // Set flag to permit in-place operation.
    permitInPlaceOperation();

    // Initialize the colormap if necessary.
    initializeColormapOperation();
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:31,代码来源:MultiplyConstOpImage.java


注:本文中的javax.media.jai.ImageLayout类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。