本文整理汇总了Java中edu.uniklu.itec.mosaix.ImageFunctions类的典型用法代码示例。如果您正苦于以下问题:Java ImageFunctions类的具体用法?Java ImageFunctions怎么用?Java ImageFunctions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ImageFunctions类属于edu.uniklu.itec.mosaix包,在下文中一共展示了ImageFunctions类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mosaicImage
import edu.uniklu.itec.mosaix.ImageFunctions; //导入依赖的package包/类
private void mosaicImage() {
final int numTiles = mosaicTileCountSlider.getValue();
progressMosaic.setString("Running ...");
enableMosaicControls(false);
final ProgressMonitor progressMonitor = new ProgressMonitor(progressMosaic);
Runnable r = new Runnable() {
public void run() {
try {
float colorhist = 0f;
float colordist = 0f;
float texture = 0f;
if (mosaicOptionsAutocolorcorrelogram.isSelected()) {
texture = 1f;
} else if (mosaicOptionsCedd.isSelected()) {
colorhist = 1f;
} else {
colordist = 1f;
}
ImageFunctions iFunc = new ImageFunctions();
BufferedImage mosaic = iFunc.getMosaic(javax.imageio.ImageIO.read(new java.io.FileInputStream(textfieldMosaicImage.getText())),
new java.awt.Dimension(320, 320), new java.awt.Dimension(numTiles, numTiles),
colorhist,
colordist,
texture, textfieldIndexName.getText(),
progressMonitor);
mosaicImageLable.setIcon(new ImageIcon(ImageUtils.scaleImage(mosaic, Math.min(mosaicImageLable.getSize().width, mosaicImageLable.getSize().height))));
ImageIO.write(mosaic, "png", new FileOutputStream("result.png"));
progressMosaic.setString("Finished");
enableMosaicControls(true);
} catch (IOException ex) {
Logger.getLogger("global").log(Level.SEVERE, null, ex);
}
}
};
new Thread(r).start();
}