本文整理汇总了Java中javax.media.jai.KernelJAI类的典型用法代码示例。如果您正苦于以下问题:Java KernelJAI类的具体用法?Java KernelJAI怎么用?Java KernelJAI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KernelJAI类属于javax.media.jai包,在下文中一共展示了KernelJAI类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: computeEdgeDensityClutter
import javax.media.jai.KernelJAI; //导入依赖的package包/类
private double computeEdgeDensityClutter(PlanarImage image) {
// first compute the RenderedOp that computes both vertical and
// horizontal
// edge detection
KernelJAI sobelVertKernel = KernelJAI.GRADIENT_MASK_SOBEL_VERTICAL;
KernelJAI sobelHorizKernel = KernelJAI.GRADIENT_MASK_SOBEL_HORIZONTAL;
ParameterBlock pb = new ParameterBlock();
pb.addSource(image);
pb.add(sobelHorizKernel);
pb.add(sobelVertKernel);
RenderedOp renderedOp = JAI.create("gradientmagnitude", pb);
BufferedImage edgeImage = renderedOp.getAsBufferedImage();
// then compute a density value, i.e. the mean
int edgeTotal = 0;
for (int i = 0; i < edgeImage.getWidth(); i++)
for (int j = 0; j < edgeImage.getHeight(); j++)
edgeTotal += Math.abs(edgeImage.getRGB(i, j));
return Math.abs(edgeTotal / (edgeImage.getWidth() * edgeImage.getHeight()));
}
开发者ID:IGNF,项目名称:geoxygene,代码行数:22,代码来源:RasterClutterMethod.java
示例2: Convolve3x3OpImage
import javax.media.jai.KernelJAI; //导入依赖的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
示例3: DilateOpImage
import javax.media.jai.KernelJAI; //导入依赖的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
示例4: isFloydSteinbergKernel
import javax.media.jai.KernelJAI; //导入依赖的package包/类
/**
* Determines whether a kernel is the Floyd-Steinberg kernel.
*
* @param kernel The <code>KernelJAI</code> to examine.
* @return Whether the kernel argument is the Floyd-Steinberg kernel.
*/
private static boolean isFloydSteinbergKernel(KernelJAI kernel) {
int ky = kernel.getYOrigin();
return (kernel.getWidth() == 3 &&
kernel.getXOrigin() == 1 &&
kernel.getHeight() - ky == 2 &&
Math.abs(kernel.getElement(2, ky) - 7.0F/16.0F) <
FLOAT_EPSILON &&
Math.abs(kernel.getElement(0, ky+1) - 3.0F/16.0F) <
FLOAT_EPSILON &&
Math.abs(kernel.getElement(1, ky+1) - 5.0F/16.0F) <
FLOAT_EPSILON &&
Math.abs(kernel.getElement(2, ky+1) - 1.0F/16.0F) <
FLOAT_EPSILON);
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:22,代码来源:ErrorDiffusionOpImage.java
示例5: DilateBinaryOpImage
import javax.media.jai.KernelJAI; //导入依赖的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
示例6: packKernel
import javax.media.jai.KernelJAI; //导入依赖的package包/类
/** pack kernel into integers by row, aligned to the right;
* extra bits on the left are filled with 0 bits
* @params kernel - the given kernel (already rotated)
* @returns an integer array of ints from packed kernel data
*/
private final int[] packKernel(KernelJAI kernel){
int kw = kernel.getWidth();
int kh = kernel.getHeight();
int kwPack = (31+kw)/32;
int kerPacked[] = new int[kwPack * kh];
float[] kdata = kernel.getKernelData();
for (int j=0; j<kw; j++){
int m = j;
int lastCol = kwPack - 1;
bitShiftMatrixLeft(kerPacked, kh, kwPack);
for (int i=0; i< kh; i++, lastCol+=kwPack, m+= kw){
if (kdata[m] > .9F){ // same as == 1.0F
kerPacked[lastCol] |= 0x1;
}
}
}
return kerPacked;
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:24,代码来源:DilateBinaryOpImage.java
示例7: ConvolveOpImage
import javax.media.jai.KernelJAI; //导入依赖的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
示例8: create
import javax.media.jai.KernelJAI; //导入依赖的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
示例9: ErodeOpImage
import javax.media.jai.KernelJAI; //导入依赖的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
示例10: ErodeBinaryOpImage
import javax.media.jai.KernelJAI; //导入依赖的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
示例11: validateParameters
import javax.media.jai.KernelJAI; //导入依赖的package包/类
/**
* Validates the input parameters.
*
* <p> In addition to the standard checks performed by the
* superclass method, this method checks that "mask1" and "mask2"
* have the same dimensions.
*/
protected boolean validateParameters(ParameterBlock args,
StringBuffer msg) {
if (!super.validateParameters(args, msg)) {
return false;
}
KernelJAI h_kernel = (KernelJAI)args.getObjectParameter(0);
KernelJAI v_kernel = (KernelJAI)args.getObjectParameter(1);
/* Check if both kernels are equivalent in terms of dimensions. */
if ((h_kernel.getWidth() != v_kernel.getWidth()) ||
(h_kernel.getHeight() != v_kernel.getHeight())) {
msg.append(getName() + " " +
JaiI18N.getString("GradientMagnitudeDescriptor1"));
return false;
}
return true;
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:27,代码来源:GradientMagnitudeDescriptor.java
示例12: actionPerformed
import javax.media.jai.KernelJAI; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
// get the filename
JFileChooser fc = new JFileChooser();
fc.setFileFilter(new ImageFileFilter());
int returnVal = fc.showDialog(null, "Choose the image to assess");
if (returnVal != JFileChooser.APPROVE_OPTION) {
return;
}
File path = fc.getSelectedFile();
BufferedImage image;
try {
image = ImageIO.read(path);
TiledImage pImage = new TiledImage(image, true);
RasterClutterMethod clutterMethod = new RasterClutterMethod(pImage);
System.out.println(clutterMethod.getEdgeDensityClutter());
// export image
KernelJAI sobelVertKernel = KernelJAI.GRADIENT_MASK_SOBEL_VERTICAL;
KernelJAI sobelHorizKernel = KernelJAI.GRADIENT_MASK_SOBEL_HORIZONTAL;
ParameterBlock pb = new ParameterBlock();
pb.addSource(image);
pb.add(sobelHorizKernel);
pb.add(sobelVertKernel);
RenderedOp renderedOp = JAI.create("gradientmagnitude", pb);
BufferedImage edgeImage = renderedOp.getAsBufferedImage();
File outputfile = new File(path.getParent() + "\\"
+ path.getName().substring(0, path.getName().length() - 4)
+ "_edge.png");
ImageIO.write(edgeImage, "png", outputfile);
} catch (IOException e1) {
e1.printStackTrace();
}
}
开发者ID:IGNF,项目名称:geoxygene,代码行数:35,代码来源:CartoPlugin.java
示例13: createTargetProduct
import javax.media.jai.KernelJAI; //导入依赖的package包/类
private void createTargetProduct() throws OperatorException {
targetProduct = new Product(sourceProduct.getName(),
sourceProduct.getProductType(),
sourceProduct.getSceneRasterWidth(),
sourceProduct.getSceneRasterHeight());
targetProduct.setStartTime(sourceProduct.getStartTime());
targetProduct.setEndTime(sourceProduct.getEndTime());
targetProduct.setPreferredTileSize(pixelsPerCell, pixelsPerCell);
ProductUtils.copyMetadata(sourceProduct, targetProduct);
ProductUtils.copyTiePointGrids(sourceProduct, targetProduct);
ProductUtils.copyFlagBands(sourceProduct, targetProduct, true);
ProductUtils.copyMasks(sourceProduct, targetProduct);
Band b = sourceProduct.getBand(ScapeMConstants.VISIBILITY_BAND_NAME);
RenderedImage sourceImage = b.getSourceImage();
final int kernelSize = pixelsPerCell;
float[] kernelMatrix = new float[kernelSize * kernelSize];
for (int k = 0; k < kernelMatrix.length; k++) {
kernelMatrix[k] = 1.0f / (kernelSize * kernelSize);
}
KernelJAI kernel = new KernelJAI(kernelSize, kernelSize, kernelMatrix);
final BorderExtender borderExtender = BorderExtender.createInstance(BorderExtender.BORDER_COPY);
RenderingHints testHints = new RenderingHints(JAI.KEY_BORDER_EXTENDER, borderExtender);
RenderedOp targetImage = ConvolveDescriptor.create(sourceImage, kernel, testHints);
Band targetBand = ProductUtils.copyBand(ScapeMConstants.VISIBILITY_BAND_NAME, sourceProduct, targetProduct, false);
targetBand.setSourceImage(targetImage);
}
开发者ID:senbox-org,项目名称:s3tbx-scape-m,代码行数:32,代码来源:ScapeMSmoothSimpleKernelOp.java
示例14: populateKernelKAI
import javax.media.jai.KernelJAI; //导入依赖的package包/类
/**
* Populate interpolation map.
*/
private static synchronized void populateKernelKAI() {
if (kernelJAIMap == null) {
kernelJAIMap = new HashMap<KernelJAI, String>();
kernelJAIMap.put(KernelJAI.GRADIENT_MASK_SOBEL_HORIZONTAL,
"GRADIENT_MASK_SOBEL_HORIZONTAL");
kernelJAIMap.put(KernelJAI.GRADIENT_MASK_SOBEL_VERTICAL,
"GRADIENT_MASK_SOBEL_VERTICAL");
}
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:13,代码来源:KernelJAIValues.java
示例15: setValue
import javax.media.jai.KernelJAI; //导入依赖的package包/类
@Override
public void setValue(Object aValue) {
this.value = null;
this.expression = null;
if (aValue instanceof KernelJAI) {
this.value = (KernelJAI) aValue;
} else if ((aValue instanceof AttributeExpressionImpl)
|| (aValue instanceof LiteralExpressionImpl)
|| (aValue instanceof FunctionExpressionImpl)
|| (aValue instanceof MathExpressionImpl)) {
this.expression = (Expression) aValue;
}
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:15,代码来源:KernelJAIValues.java
示例16: create
import javax.media.jai.KernelJAI; //导入依赖的package包/类
/**
* Creates a new instance of an ordered dither operator according to the
* color map and dither mask kernel array.
*
* @param paramBlock The color map and dither mask kernel array objects.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
RenderedImage source = paramBlock.getRenderedSource(0);
ColorCube colorMap =
(ColorCube)paramBlock.getObjectParameter(0);
KernelJAI[] ditherMask = (KernelJAI[])paramBlock.getObjectParameter(1);
return new OrderedDitherOpImage(source, renderHints, layout,
colorMap, ditherMask);
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:21,代码来源:OrderedDitherRIF.java
示例17: GradientOpImage
import javax.media.jai.KernelJAI; //导入依赖的package包/类
/**
* Creates a GradientOpImage given the image source and
* the pair of orthogonal gradient kernels. 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_h the horizontal kernel.
* @param kernel_v the vertical kernel
*/
public GradientOpImage(RenderedImage source,
BorderExtender extender,
Map config,
ImageLayout layout,
KernelJAI kernel_h,
KernelJAI kernel_v) {
super(source,
layout,
config,
true,
extender,
kernel_h.getLeftPadding(),
kernel_h.getRightPadding(),
kernel_h.getTopPadding(),
kernel_h.getBottomPadding());
// Local copy of the kernels
this.kernel_h = kernel_h;
this.kernel_v = kernel_v;
//
// At this point both kernels should be of same width & height
// so it's enough to get the information from one of them
//
kw = kernel_h.getWidth();
kh = kernel_h.getHeight();
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:42,代码来源:GradientOpImage.java
示例18: create
import javax.media.jai.KernelJAI; //导入依赖的package包/类
/**
* Create a new instance of SeparableConvolveOpImage in the rendered layer.
* This method satisfies the implementation of RIF.
*
* @param paramBlock The source image and the convolution 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);
// Get the operation parameters.
int width = paramBlock.getIntParameter(0);
int height = paramBlock.getIntParameter(1);
int xOrigin = paramBlock.getIntParameter(2);
int yOrigin = paramBlock.getIntParameter(3);
// Allocate and initialize arrays.
float[] dataH = new float[width];
Arrays.fill(dataH, 1.0F/(float)width);
float[] dataV = null;
if(height == width) {
dataV = dataH;
} else {
dataV = new float[height];
Arrays.fill(dataV, 1.0F/(float)height);
}
// Construct a separable kernel.
KernelJAI kernel = new KernelJAI(width, height, xOrigin, yOrigin,
dataH, dataV);
// Construct and return the OpImage.
return new SeparableConvolveOpImage(paramBlock.getRenderedSource(0),
extender,
renderHints,
layout,
kernel);
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:44,代码来源:BoxFilterRIF.java
示例19: create
import javax.media.jai.KernelJAI; //导入依赖的package包/类
/**
* Implementation of "RIF" create().
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
KernelJAI kernel = createKernel(paramBlock.getFloatParameter(0));
return kernel == null ? paramBlock.getRenderedSource(0):
JAI.create("convolve", paramBlock.getRenderedSource(0), kernel);
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:11,代码来源:FilterCRIF.java
示例20: OrderedDitherOpImage
import javax.media.jai.KernelJAI; //导入依赖的package包/类
/**
* Constructs an OrderedDitherOpImage object. May be used to convert a
* single- or multi-band image into a single-band image with a color map.
*
* <p>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 layout An ImageLayout optionally containing the tile grid layout,
* SampleModel, and ColorModel, or null.
* @param colorMap The color map to use which must have a number of bands
* equal to the number of bands in the source image. The offset of this
* <code>ColorCube</code> must be the same for all bands.
* @param ditherMask An an array of <code>KernelJAI</code> objects the
* dimension of which must equal the number of bands in the source image.
* The <i>n</i>th element of the array contains a <code>KernelJAI</code>
* object which represents the dither mask matrix for the corresponding
* band. All <code>KernelJAI</code> objects in the array must have the
* same dimensions and contain floating point values between 0.0F and 1.0F.
*/
public OrderedDitherOpImage(RenderedImage source,
Map config,
ImageLayout layout,
ColorCube colorMap,
KernelJAI[] ditherMask) {
// Construct as a PointOpImage.
super(source, layoutHelper(layout, source, colorMap),
config, true);
// Initialize the instance variables derived from the color map.
numBands = colorMap.getNumBands();
mults = (int[])colorMap.getMultipliers().clone();
dims = (int[])colorMap.getDimsLessOne().clone();
adjustedOffset = colorMap.getAdjustedOffset();
// Initialize the instance variables derived from the dither mask.
maskWidth = ditherMask[0].getWidth();
maskHeight = ditherMask[0].getHeight();
// Initialize the data required to effect the operation.
// XXX Postpone until first invocation of computeRect()?
initializeDitherData(sampleModel.getTransferType(), ditherMask);
// Set flag to permit in-place operation.
permitInPlaceOperation();
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:48,代码来源:OrderedDitherOpImage.java
注:本文中的javax.media.jai.KernelJAI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论