本文整理汇总了Java中javax.media.jai.BorderExtender类的典型用法代码示例。如果您正苦于以下问题:Java BorderExtender类的具体用法?Java BorderExtender怎么用?Java BorderExtender使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BorderExtender类属于javax.media.jai包,在下文中一共展示了BorderExtender类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addBorder
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* add a border to image
* @param thickness
* @param color
* @param borderType
*/
public void addBorder(int thickness, Color color, int borderType) throws ExpressionException{
double colorArray[] = {color.getRed(), color.getGreen(), color.getBlue()};
BorderExtender borderExtender = new BorderExtenderConstant(colorArray);
ParameterBlock params = new ParameterBlock();
params.addSource(image());
params.add(thickness);
params.add(thickness);
params.add(thickness);
params.add(thickness);
if(BORDER_TYPE_CONSTANT==borderType) params.add(borderExtender);
else params.add(BorderExtender.createInstance(borderType));
//else if(BORDER_TYPE_WRAP==borderType)params.add(BorderExtender.createInstance(BorderExtender.BORDER_REFLECT));
image((JAI.create("border", params)).getAsBufferedImage());
}
开发者ID:lucee,项目名称:Lucee4,代码行数:25,代码来源:Image.java
示例2: translate
import javax.media.jai.BorderExtender; //导入依赖的package包/类
public void translate(int xtrans, int ytrans, Object interpolation) throws ExpressionException {
RenderingHints hints = new RenderingHints(RenderingHints.KEY_INTERPOLATION,interpolation);
if(interpolation!=RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR) {
hints.add(new RenderingHints(JAI.KEY_BORDER_EXTENDER, BorderExtender.createInstance(1)));
}
ParameterBlock pb = new ParameterBlock();
pb.addSource(image());
BufferedImage img = JAI.create("translate", pb).getAsBufferedImage();
Graphics2D graphics = img.createGraphics();
graphics.clearRect(0, 0, img.getWidth(), img.getHeight());
AffineTransform at = new AffineTransform();
at.setToIdentity();
graphics.drawImage(image(), new AffineTransformOp(at, hints), xtrans, ytrans);
graphics.dispose();
image(img);
}
开发者ID:lucee,项目名称:Lucee4,代码行数:19,代码来源:Image.java
示例3: call
import javax.media.jai.BorderExtender; //导入依赖的package包/类
public static String call(PageContext pc, Object name, double thickness, String color, String strBorderType) throws PageException {
//if(name instanceof String) name=pc.getVariable(Caster.toString(name));
strBorderType=strBorderType.trim().toLowerCase();
int borderType=Image.BORDER_TYPE_CONSTANT;
if("zero".equals(strBorderType)) borderType=BorderExtender.BORDER_ZERO;
else if("constant".equals(strBorderType)) borderType=Image.BORDER_TYPE_CONSTANT;
else if("copy".equals(strBorderType)) borderType=BorderExtender.BORDER_COPY;
else if("reflect".equals(strBorderType)) borderType=BorderExtender.BORDER_REFLECT;
else if("wrap".equals(strBorderType)) borderType=BorderExtender.BORDER_WRAP;
Image image=Image.toImage(pc,name);
image.addBorder((int)thickness,ColorCaster.toColor(color),borderType);
return null;
}
开发者ID:lucee,项目名称:Lucee4,代码行数:17,代码来源:ImageAddBorder.java
示例4: blur
import javax.media.jai.BorderExtender; //导入依赖的package包/类
public void blur(int blurFactor) throws ExpressionException{
ParameterBlock params = new ParameterBlock();
params.addSource(image());
params.add(blurFactor);
RenderingHints hint= new RenderingHints(JAI.KEY_BORDER_EXTENDER,BorderExtender.createInstance(1));
image(JAI.create("boxfilter", params, hint).getAsBufferedImage());
}
开发者ID:lucee,项目名称:Lucee,代码行数:8,代码来源:Image.java
示例5: computeTileStack
import javax.media.jai.BorderExtender; //导入依赖的package包/类
@Override
public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle tarRec, ProgressMonitor pm) throws OperatorException {
Rectangle srcRec = new Rectangle(tarRec.x - OFF, tarRec.y - OFF, tarRec.width + BOX, tarRec.height + BOX);
BorderExtender borderExtender = BorderExtender.createInstance(BorderExtender.BORDER_ZERO);
Tile latTile = getSourceTile(aotProduct.getBand("latitude"), srcRec, borderExtender);
Tile aotTile = getSourceTile(aotProduct.getBand(AotConsts.aot.name), srcRec, borderExtender);
Tile aotErrTile = getSourceTile(aotProduct.getBand(AotConsts.aotErr.name), srcRec, borderExtender);
Tile tarAotTile = targetTiles.get(targetProduct.getBand(AotConsts.aot.name));
Tile tarAotErrTile = targetTiles.get(targetProduct.getBand(AotConsts.aotErr.name));
Tile tarAotFlagsTile = targetTiles.get(targetProduct.getBand(AotConsts.aotFlags.name));
double noDataVal = aotTile.getRasterDataNode().getGeophysicalNoDataValue();
float aotPixel;
float aotErrPixel;
for (int y = tarRec.y; y < tarRec.y + tarRec.height; y++) {
for (int x = tarRec.x; x < tarRec.x + tarRec.width; x++) {
double climAot = calcClimAot(latTile.getSampleFloat(x, y));
aotPixel = aotTile.getSampleFloat(x, y);
aotErrPixel = aotErrTile.getSampleFloat(x, y);
if (Double.compare(noDataVal, aotPixel) != 0) {
tarAotTile.setSample(x, y, aotPixel);
tarAotErrTile.setSample(x, y, aotErrPixel);
tarAotFlagsTile.setSample(x, y, 0);
} else {
float[] fillResult = new float[2];
int flagPixel = fillPixel(x, y, aotTile, aotErrTile, climAot, noDataVal, fillResult);
tarAotTile.setSample(x, y, fillResult[0]);
tarAotErrTile.setSample(x, y, fillResult[1]);
tarAotFlagsTile.setSample(x, y, flagPixel);
}
}
}
}
开发者ID:senbox-org,项目名称:s2tbx,代码行数:38,代码来源:S2AerosolGapFillingOp.java
示例6: Convolve3x3OpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Creates a Convolve3x3OpImage given a ParameterBlock containing the image
* source and a 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.
* @param cobbleSources a boolean indicating whether computeRect()
* expects contiguous sources.
*/
public Convolve3x3OpImage(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;
if ((kernel.getWidth() != 3) ||
(kernel.getHeight() != 3) ||
(kernel.getXOrigin() != 1) ||
(kernel.getYOrigin() != 1)) {
throw new RuntimeException(JaiI18N.getString("Convolve3x3OpImage0"));
}
if (sampleModel.getDataType() == DataBuffer.TYPE_BYTE) {
float kdata[] = kernel.getKernelData();
float k0 = kdata[0],
k1 = kdata[1],
k2 = kdata[2],
k3 = kdata[3],
k4 = kdata[4],
k5 = kdata[5],
k6 = kdata[6],
k7 = kdata[7],
k8 = kdata[8];
for (int j = 0; j < 256; j++) {
byte b = (byte)j;
float f = (float)j;
tables[0][b+128] = k0*f+0.5f;
tables[1][b+128] = k1*f;
tables[2][b+128] = k2*f;
tables[3][b+128] = k3*f;
tables[4][b+128] = k4*f;
tables[5][b+128] = k5*f;
tables[6][b+128] = k6*f;
tables[7][b+128] = k7*f;
tables[8][b+128] = k8*f;
}
}
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:67,代码来源:Convolve3x3OpImage.java
示例7: DilateOpImage
import javax.media.jai.BorderExtender; //导入依赖的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
示例8: AffineBicubicOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Constructs an AffineBicubicOpImage 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 AffineBicubicOpImage(RenderedImage source,
BorderExtender extender,
Map config,
ImageLayout layout,
AffineTransform transform,
Interpolation interp,
double[] backgroundValues) {
super(source,
extender,
config,
layout,
transform,
interp,
backgroundValues);
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:26,代码来源:AffineBicubicOpImage.java
示例9: MinFilterOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Creates a MinFilterOpImage given an image source, an
* optional BorderExtender, a maskType and maskSize. The image
* dimensions are derived 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 maskType the filter mask type.
* @param maskSize the filter mask size.
*/
public MinFilterOpImage(RenderedImage source,
BorderExtender extender,
Map config,
ImageLayout layout,
MinFilterShape maskType,
int maskSize) {
super(source,
layout,
config,
true,
extender,
(maskSize-1)/2,
(maskSize-1)/2,
(maskSize/2),
(maskSize/2));
this.maskType = maskType;
this.maskSize = maskSize;
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:34,代码来源:MinFilterOpImage.java
示例10: MedianFilterOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Creates a MedianFilterOpImage given an image source, an
* optional BorderExtender, a maskType and maskSize. The image
* dimensions are derived 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 maskType the filter mask type.
* @param maskSize the filter mask size.
*/
public MedianFilterOpImage(RenderedImage source,
BorderExtender extender,
Map config,
ImageLayout layout,
MedianFilterShape maskType,
int maskSize) {
super(source,
layout,
config,
true,
extender,
(maskSize-1)/2,
(maskSize-1)/2,
(maskSize/2),
(maskSize/2));
this.maskType = maskType;
this.maskSize = maskSize;
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:33,代码来源:MedianFilterOpImage.java
示例11: AffineBilinearOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Constructs an AffineBilinearOpImage 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 AffineBilinearOpImage(RenderedImage source,
BorderExtender extender,
Map config,
ImageLayout layout,
AffineTransform transform,
Interpolation interp,
double[] backgroundValues) {
super(source,
extender,
config,
layout,
transform,
interp,
backgroundValues);
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:26,代码来源:AffineBilinearOpImage.java
示例12: MaxFilterOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Creates a MaxFilterOpImage given an image source, an
* optional BorderExtender, a maskType and maskSize. The image
* dimensions are derived 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 maskType the filter mask type.
* @param maskSize the filter mask size.
*/
public MaxFilterOpImage(RenderedImage source,
BorderExtender extender,
Map config,
ImageLayout layout,
MaxFilterShape maskType,
int maskSize) {
super(source,
layout,
config,
true,
extender,
(maskSize-1)/2,
(maskSize-1)/2,
(maskSize/2),
(maskSize/2));
this.maskType = maskType;
this.maskSize = maskSize;
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:35,代码来源:MaxFilterOpImage.java
示例13: DilateBinaryOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Creates a DilateBinaryOpImage 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 DilateBinaryOpImage(RenderedImage source,
BorderExtender extender,
Map config,
ImageLayout layout,
KernelJAI kernel) {
super(source,
layout,
configHelper(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();
kwPack = (kw+31)/32;
kdataPack = packKernel(kernel);
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:37,代码来源:DilateBinaryOpImage.java
示例14: ConvolveOpImage
import javax.media.jai.BorderExtender; //导入依赖的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
示例15: BorderOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Constructor.
*
* @param source The source image.
* @param layout The destination image layout.
* @param leftPad The amount of padding to the left of the source.
* @param rightPad The amount of padding to the right of the source.
* @param topPad The amount of padding to the top of the source.
* @param bottomPad The amount of padding to the bottom of the source.
* @param type The border type.
* @param constants The constants used with border type
* <code>BorderDescriptor.BORDER_CONST_FILL</code>,
* stored as reference.
*/
public BorderOpImage(RenderedImage source,
Map config,
ImageLayout layout,
int leftPad,
int rightPad,
int topPad,
int bottomPad,
BorderExtender extender) {
super(vectorize(source),
layoutHelper(layout, source,
leftPad, rightPad, topPad, bottomPad),
config, true);
this.extender = extender;
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:30,代码来源:BorderOpImage.java
示例16: create
import javax.media.jai.BorderExtender; //导入依赖的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
示例17: AffineBicubic2OpImage
import javax.media.jai.BorderExtender; //导入依赖的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
示例18: ErodeOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Creates a ErodeOpImage given a ParameterBlock containing the image
* source and pre-rotated erosion 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 erosion KernelJAI.
*/
public ErodeOpImage(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,代码来源:ErodeOpImage.java
示例19: ErodeBinaryOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Creates a ErodeBinaryOpImage given a ParameterBlock containing the image
* source and pre-rotated erosion 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 erosion KernelJAI.
*/
public ErodeBinaryOpImage(RenderedImage source,
BorderExtender extender,
Map config,
ImageLayout layout,
KernelJAI kernel) {
super(source,
layout,
configHelper(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();
kwPack = (kw+31)/32;
kdataPack = packKernel(kernel);
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:39,代码来源:ErodeBinaryOpImage.java
示例20: AffineGeneralOpImage
import javax.media.jai.BorderExtender; //导入依赖的package包/类
/**
* Constructs an AffineGeneralOpImage 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 AffineGeneralOpImage(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;
interp_width = interp.getWidth();
interp_height = interp.getHeight();
interp_left = interp.getLeftPadding();
interp_top = interp.getTopPadding();
interp_right = interp_width - interp_left - 1;
interp_bottom = interp_height - interp_top - 1;
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:37,代码来源:AffineGeneralOpImage.java
注:本文中的javax.media.jai.BorderExtender类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论