• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ShortLookupTable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: doTransform

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
@Override
public BufferedImage doTransform(BufferedImage src, BufferedImage dest) {
    float cr = cyanRed.getValueAsFloat();
    float mg = magentaGreen.getValueAsFloat();
    float yb = yellowBlue.getValueAsFloat();

    if ((cr == 0) && (mg == 0) && (yb == 0)) {
        return src;
    }

    int affect = affectParam.getValue();

    RGBLookup rgbLookup = new LookupCalculator(cr, mg, yb, affect).getLookup();

    BufferedImageOp filterOp = new FastLookupOp((ShortLookupTable) rgbLookup.getLookupOp());
    filterOp.filter(src, dest);

    return dest;
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:20,代码来源:ColorBalance.java


示例2: toInverseVideo

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
/**
 * For testing lookup tables
 */
public static Image toInverseVideo(Image source) {
	//
	BufferedImage src = new BufferedImage(source.getWidth(null), source
			.getHeight(null), BufferedImage.TYPE_INT_ARGB);
	Graphics g = src.getGraphics();
	g.drawImage(source, 0, 0, null);
	//
	short[][] lookup = new short[4][256];
	for (int c = 0; c < 4; c++) {
		for (short b = 0; b < 256; b++) {
			if (c == 3)
				lookup[c][b] = b;
			else
				lookup[c][b] = (short)(255 - b);
		}
	}
	LookupTable table = new ShortLookupTable(0, lookup);
	LookupOp op = new LookupOp (table, null);
	return op.filter(src, null);
}
 
开发者ID:mathieulegoc,项目名称:SmartTokens,代码行数:24,代码来源:GUIUtils.java


示例3: gammaCorrection

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
/**
 * Corrección gamma. Si 0 menor_que gamma menor_que 1 ilumina, si
 * gamma_mayor_que 1 oscurece
 *
 * @param cteA double
 * @param gamma double
 * @return LookupTable
 */
public static LookupTable gammaCorrection(double cteA, double gamma) {
    if (gamma <= 0) {
        return null;
    }
    // K: constante de normalización 
    double K = ((double) MAX_LEVEL) / (cteA * Math.pow(((double) MAX_LEVEL), gamma));
    short lt[] = new short[MAX_LEVEL + 1];
    for (int l = 0; l <= MAX_LEVEL; l++) {
        lt[l] = (short) (K * cteA * Math.pow((double) l, gamma));
    }
    ShortLookupTable slt = new ShortLookupTable(0, lt);
    if (ECHO) {
        plot(lt);
    }
    return slt;
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:25,代码来源:LookupTableProducer.java


示例4: invertImage

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
private static BufferedImage invertImage(final BufferedImage src) {
  final int w = src.getWidth();
  final int h = src.getHeight();
  final BufferedImage dst = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);

  final BufferedImageOp invertOp = new LookupOp(new ShortLookupTable(0, invertTable), null);
  return invertOp.filter(src, dst);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:9,代码来源:SegmenterFacade.java


示例5: doTransform

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
@Override
public BufferedImage doTransform(BufferedImage src, BufferedImage dest) {
    int numLevels = levels.getValue();
    RGBLookup rgbLookup = new RGBLookup();
    rgbLookup.initFromPosterize(numLevels);

    BufferedImageOp filterOp = new FastLookupOp((ShortLookupTable) rgbLookup.getLookupOp());
    filterOp.filter(src, dest);

    return dest;
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:12,代码来源:Posterize.java


示例6: colorExtractChannel

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
private static BufferedImage colorExtractChannel(BufferedImage src, BufferedImage dest, int channel) {
    LookupTable lookupTable;

    switch (channel) {
        case RED_CHANNEL:
            lookupTable = LookupFactory.createLookupForOnlyRed();
            break;
        case REMOVE_RED_CHANNEL:
            lookupTable = LookupFactory.createLookupForRemoveRed();
            break;
        case GREEN_CHANNEL:
            lookupTable = LookupFactory.createLookupForOnlyGreen();
            break;
        case REMOVE_GREEN_CHANNEL:
            lookupTable = LookupFactory.createLookupForRemoveGreen();
            break;
        case BLUE_CHANNEL:
            lookupTable = LookupFactory.createLookupForOnlyBlue();
            break;
        case REMOVE_BLUE_CHANNEL:
            lookupTable = LookupFactory.createLookupForRemoveBlue();
            break;
        default:
            throw new IllegalStateException("should not het here");
    }

    BufferedImageOp filterOp = new FastLookupOp((ShortLookupTable) lookupTable);
    filterOp.filter(src, dest);
    return dest;
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:31,代码来源:ExtractChannel.java


示例7: createLookupForRemoveRed

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
public static LookupTable createLookupForRemoveRed() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getNullMapping();
    lookupData[1] = getDefaultMapping();
    lookupData[2] = getDefaultMapping();
    return new ShortLookupTable(0, lookupData);
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:8,代码来源:LookupFactory.java


示例8: createLookupForOnlyRed

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
public static LookupTable createLookupForOnlyRed() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getDefaultMapping();
    lookupData[1] = getNullMapping();
    lookupData[2] = getNullMapping();
    return new ShortLookupTable(0, lookupData);
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:8,代码来源:LookupFactory.java


示例9: createLookupForRemoveGreen

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
public static LookupTable createLookupForRemoveGreen() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getDefaultMapping();
    lookupData[1] = getNullMapping();
    lookupData[2] = getDefaultMapping();
    return new ShortLookupTable(0, lookupData);
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:8,代码来源:LookupFactory.java


示例10: createLookupForOnlyGreen

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
public static LookupTable createLookupForOnlyGreen() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getNullMapping();
    lookupData[1] = getDefaultMapping();
    lookupData[2] = getNullMapping();
    return new ShortLookupTable(0, lookupData);
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:8,代码来源:LookupFactory.java


示例11: createLookupForRemoveBlue

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
public static LookupTable createLookupForRemoveBlue() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getDefaultMapping();
    lookupData[1] = getDefaultMapping();
    lookupData[2] = getNullMapping();
    return new ShortLookupTable(0, lookupData);
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:8,代码来源:LookupFactory.java


示例12: createLookupForOnlyBlue

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
public static LookupTable createLookupForOnlyBlue() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getNullMapping();
    lookupData[1] = getNullMapping();
    lookupData[2] = getDefaultMapping();
    return new ShortLookupTable(0, lookupData);
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:8,代码来源:LookupFactory.java


示例13: createLookupFrom3Arrays

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
public static LookupTable createLookupFrom3Arrays(short[] redMappings, short[] greenMappings, short[] blueMappings) {
    short[][] lookupData = new short[3][256];
    lookupData[0] = redMappings;
    lookupData[1] = greenMappings;
    lookupData[2] = blueMappings;
    return new ShortLookupTable(0, lookupData);
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:8,代码来源:LookupFactory.java


示例14: transform

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
@Override
public BufferedImage transform(BufferedImage src, BufferedImage dest) {

    if (rgbLookup == null) {
        throw new IllegalStateException("rgbLookup not initialized in DynamicLookupOp");
    }

    BufferedImageOp filterOp = new FastLookupOp((ShortLookupTable) rgbLookup.getLookupOp());
    filterOp.filter(src, dest);

    return dest;
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:13,代码来源:DynamicLookupFilter.java


示例15: buildLookupOpTab

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
private void buildLookupOpTab(JTabbedPane tabbedPane) {
    BufferedImage dstImage = null;
    short[] data = new short[256];
    for (int i = 0; i < 256; i++) {
        data[i] = (short) (255 - i);
    }
    LookupTable lookupTable = new ShortLookupTable(0, data);
    LookupOp op = new LookupOp(lookupTable, null);
    dstImage = op.filter(sourceImage, null);
    
    tabbedPane.add("Lookup", new JLabel(new ImageIcon(dstImage)));
}
 
开发者ID:romainguy,项目名称:filthy-rich-clients,代码行数:13,代码来源:ApplicationFrame.java


示例16: setupSwap

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
private void setupSwap()
{
    short[][] lookupArray = new short[4][256];
    for (int i = 0; i < lookupArray.length; i++)
    {
        for (short c = 0; c < lookupArray[i].length; c++)
        {
            lookupArray[i][c] = c;
        }
    }
    swapTable = new ShortLookupTable(0, lookupArray);
    swapOp = new LookupOp(swapTable, null);
}
 
开发者ID:GlitchCog,项目名称:ChatGameFontificator,代码行数:14,代码来源:Sprite.java


示例17: createColorizeOp

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
/**
 * @see <a href="http://stackoverflow.com/questions/23763/colorizing-images-in-java">Colorizing images in Java</a>
 * @see <a href="http://stackoverflow.com/questions/7621774/whats-the-appropriate-way-to-colorize-a-grayscale-image-with-transparency-in-ja">What's the appropriate way to colorize a grayscale image with transparency in Java?</a>
 *
 * @param colors An array, {R, G, B}
 *
 * @return
 */
protected static LookupOp createColorizeOp(int[] colors) {//short R1, short G1, short B1
    short[] alpha = new short[256];
    short[] red = new short[256];
    short[] green = new short[256];
    short[] blue = new short[256];

    //int Y = 0.3*R + 0.59*G + 0.11*B
    for (short i = 255; i < 256; i++) {//keep white white
        alpha[i] = i;
        red[i] = i;
        green[i] = i;
        blue[i] = i;
    }
    //red[255] = (short) 0;
    //green[255] = (short) 0;
    //blue[255] = (short) 0;
    for (short i = 0; i < 255; i++) {
        alpha[i] = i;
        red[i] = (short) (colors[0] * (float) i / 255.0);
        green[i] = (short) (colors[1] * (float) i / 255.0);
        blue[i] = (short) (colors[2] * (float) i / 255.0);
    }

    short[][] data = new short[][]{
        red, green, blue, alpha
    };

    LookupTable lookupTable = new ShortLookupTable(0, data);
    return new LookupOp(lookupTable, null);
}
 
开发者ID:Deliquescence,项目名称:ChainReactionClone,代码行数:39,代码来源:Colorizer.java


示例18: negativeFuction

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
/**
 * Función negativo
 */
public static LookupTable negativeFuction(){
    short lt[] = new short[MAX_LEVEL+1];
    for (int l=0; l<=MAX_LEVEL; l++) 
        lt[l] = (short)(MAX_LEVEL-l);     
    ShortLookupTable slt = new ShortLookupTable(0,lt);
    if(ECHO) plot(lt);
    return slt;
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:12,代码来源:LookupTableProducer.java


示例19: sFuction

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
/**
 * Función "S". Util para contrastar una imagen 
 */
public static LookupTable sFuction(double m, double e){
    // K: constante de normalización 
    double K = ((double)MAX_LEVEL)/(1.0/(1.0+Math.pow(m/((double)MAX_LEVEL),e)));
    short lt[] = new short[MAX_LEVEL+1];
    lt[0]=0;
    for (int l=1; l<=MAX_LEVEL; l++)
      lt[l] = (short)(K*(1.0/(1.0+Math.pow(m/(float)l,e))));
    ShortLookupTable slt = new ShortLookupTable(0,lt);
    if(ECHO) plot(lt);
    return slt;
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:15,代码来源:LookupTableProducer.java


示例20: logarithmFuction

import java.awt.image.ShortLookupTable; //导入依赖的package包/类
/**
 * Función logaritmo. Util para iluminar una imagen
 */
public static LookupTable logarithmFuction(){
    // K: constante de normalización 
    double K = ((double)MAX_LEVEL)/Math.log(1.0+((double)MAX_LEVEL));
    short lt[] = new short[MAX_LEVEL+1];
    for (int l=0; l<=MAX_LEVEL; l++)
      lt[l] = (short)(K*Math.log(1.0+(double)l));
    ShortLookupTable slt = new ShortLookupTable(0,lt);
    if(ECHO) plot(lt);
    return slt;
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:14,代码来源:LookupTableProducer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UnknownElementException类代码示例发布时间:2022-05-21
下一篇:
Java FileNotFoundException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap