本文整理匯總了Java中java.awt.image.BufferedImage.getWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java BufferedImage.getWidth方法的具體用法?Java BufferedImage.getWidth怎麽用?Java BufferedImage.getWidth使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.image.BufferedImage的用法示例。
在下文中一共展示了BufferedImage.getWidth方法的19個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: apply
點讚 3
import java.awt.image.BufferedImage; //導入方法依賴的package包/類
@Override
public final BufferedImage apply(BufferedImage img) {
float[][] matrix = getMatrix();
float[] data = getKernelData(matrix);
if(normalize)
normalize(data);
scale(data);
if(isZero(data))
return new BufferedImage(img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_RGB);
Kernel k = new Kernel(matrix[0].length, matrix.length, data);
ConvolveOp op = new ConvolveOp(k, ConvolveOp.EDGE_NO_OP, null);
BufferedImage img2 = new BufferedImage(img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_RGB);
img2.getGraphics().drawImage(img, 0, 0, null);
return op.filter(img2, null);
}
開發者ID:CalebKussmaul,項目名稱:GIFKR,代碼行數:20,
示例2: loadCropResult
點讚 3
import java.awt.image.BufferedImage; //導入方法依賴的package包/類
/**
* Load the segmented result of the crop image to a visualisation panel.
*/
private void loadCropResult(BufferedImage cropResult) {
// remove the old image if it exists
if (dPCropResult != null) {
this.remove(dPCropResult);
jPCropResult.remove(dPCropResult);
}
// load the viewer of the result
dPCropResult = new ResultPanel(cropResult, new Dimension(cropResult.getWidth(), cropResult.getHeight()), cropWindowConfig.getObjectColor());
dPCropResult.updateResultImg();
dPCropResult.setBackground(new java.awt.Color(255, 255, 255));
jPCropResult.add(dPCropResult);
this.validate();
this.repaint();
}
開發者ID:buni-rock,項目名稱:Pixie,代碼行數:22,
示例3: apply
點讚 3
import java.awt.image.BufferedImage; //導入方法依賴的package包/類
@Override
protected BufferedImage apply(BufferedImage img) {
float flength = 1 + (img.getWidth()-1) * threshold;
int length = Math.round(flength);
for (int y = 0, x = 0; y < img.getHeight(); y++) {
for(x = 0; x < img.getWidth() && ((img.getRGB(x, y) & 0xFF000000) == 0); x++);
int firstEnd = Math.round(flength*(x/length +1)) -1;
line(img, x, Math.min(img.getWidth()-1, firstEnd), y);
x = firstEnd+1;
for(float fx = x; x < img.getWidth()-length && ((img.getRGB(x + length, y) & 0xFF000000) != 0); fx += flength, x = Math.round(fx))
line(img, x, Math.round(fx + flength)-1, y);
int end = x;
for(; end < img.getWidth() - 1 && ((img.getRGB(end, y) & 0xFF000000) != 0); end++);
line(img, x, end, y);
}
return img;
}
開發者ID:CalebKussmaul,項目名稱:GIFKR,代碼行數:24,
示例4: resizeImage
點讚 3
import java.awt.image.BufferedImage; //導入方法依賴的package包/類
private static BufferedImage resizeImage(BufferedImage sample, double sampleMinLat, double sampleMaxLat, double tileMinLat, double tileMaxLat) {
BufferedImage img = new BufferedImage(TILE_SIZE, TILE_SIZE, BufferedImage.TYPE_3BYTE_BGR);
double tileScale = TILE_SIZE / (tileMinLat - tileMaxLat);
// s for source; d for destination; all measurements in pixels
int sx1 = 0;
int sy1 = 0;
int sx2 = sample.getWidth();
int sy2 = sample.getHeight();
int dx1 = 0;
int dy1 = (int) ((sampleMaxLat - tileMaxLat) * tileScale);
int dx2 = TILE_SIZE;
int dy2 = (int) ((sampleMinLat - tileMaxLat) * tileScale);
img.createGraphics().drawImage(sample, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
return img;
}
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:20,
示例5: uploadTextureImageSubImpl
點讚 3
import java.awt.image.BufferedImage; //導入方法依賴的package包/類
private static void uploadTextureImageSubImpl(BufferedImage p_110993_0_, int p_110993_1_,