当前位置: 首页>>代码示例>>Java>>正文


Java LookupTable类代码示例

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


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

示例1: main

import java.awt.image.LookupTable; //导入依赖的package包/类
public static void main(String[] args) {
    LookupTable tbl = createReverseTable();
    LookupOp op = new LookupOp(tbl, null);

    for (ImageType t : ImageType.values()) {
        System.out.print(t);

        BufferedImage src = createSourceImage(t);

        BufferedImage dst = op.filter(src, null);

        int rgb = dst.getRGB(0, 0);

        System.out.printf(" Result: 0x%X ", rgb);

        if (rgb != argbReverse) {
            throw new RuntimeException("Test failed.");
        }
        System.out.println("Passed.");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:22,代码来源:IntImageReverseTest.java

示例2: toInverseVideo

import java.awt.image.LookupTable; //导入依赖的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: botonContrasteActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void botonContrasteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonContrasteActionPerformed

        try {
            VentanaInterna vi = (VentanaInterna) escritorio.getSelectedFrame();
            if (vi != null) {
                BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
                LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_SFUNCION);
                LookupOp lop = new LookupOp(ltp, null);
                BufferedImage imgdest = lop.filter(imgActual, null);

                if (imgdest != null) {
                    vi.getLienzo().setImageOriginal(imgdest);
                    vi.getLienzo().repaint();
                }
            }
        } catch (Exception e) {
            System.err.println("Error en el contraste");
        }
    }
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:20,代码来源:VentanaPrincipal.java

示例4: botonIluminarActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void botonIluminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonIluminarActionPerformed
    try {
        VentanaInterna vi = (VentanaInterna) escritorio.getSelectedFrame();
        if (vi != null) {
            BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
            LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_LOGARITHM);
            LookupOp lop = new LookupOp(ltp, null);
            BufferedImage imgdest = lop.filter(imgActual, null);

            if (imgdest != null) {
                vi.getLienzo().setImageOriginal(imgdest);
                vi.getLienzo().repaint();
            }
        }
    } catch (Exception e) {
        System.err.println("Error al iluminar");
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:19,代码来源:VentanaPrincipal.java

示例5: botonOscurecerActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void botonOscurecerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonOscurecerActionPerformed
    try {
        VentanaInterna vi = (VentanaInterna) escritorio.getSelectedFrame();
        if (vi != null) {
            BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
            LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_POWER);
            LookupOp lop = new LookupOp(ltp, null);
            BufferedImage imgdest = lop.filter(imgActual, null);
            if (imgdest != null) {
                vi.getLienzo().setImageOriginal(imgdest);
                vi.getLienzo().repaint();
            }
        }
    } catch (Exception e) {
        System.err.println("Error al oscurecer");
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:18,代码来源:VentanaPrincipal.java

示例6: createLookupTable

import java.awt.image.LookupTable; //导入依赖的package包/类
/**
 * Crea objetos LookupTable usando valores por defecto
 */
static LookupTable createLookupTable(int type){
    switch(type){
        case TYPE_NEGATIVE:
             return negativeFuction(); 
        case TYPE_SFUNCION:
             return sFuction(DEFAULT_M_SFUNCTION,DEFAULT_E_SFUNCTION);    
        case TYPE_LOGARITHM:
             return logarithmFuction();     
        case TYPE_POWER:
             return powerFuction(DEFAULT_POWER);     
        case TYPE_ROOT:
             return rootFuction(DEFAULT_ROOT);
        case TYPE_GAMMA_CORRECTION:
             return gammaCorrection(DEFAULT_A_GAMMA,DEFAULT_GAMMA);    
        default:
             return null;
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:22,代码来源:LookupTableProducer.java

示例7: botonContrasteActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void botonContrasteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonContrasteActionPerformed

        try {
            VentanaInternaImagen vi = (VentanaInternaImagen) selectInternalWindows();
            if (vi != null) {
                BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
                LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_SFUNCION);
                LookupOp lop = new LookupOp(ltp, null);
                BufferedImage imgdest = lop.filter(imgActual, null);

                if (imgdest != null) {
                    vi.getLienzo().setImageOriginal(imgdest);
                    vi.getLienzo().repaint();
                }
            }
        } catch (Exception e) {
            System.err.println("Error en el contraste");
        }
    }
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:20,代码来源:VentanaPrincipal.java

示例8: botonIluminarActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void botonIluminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonIluminarActionPerformed
    try {
        VentanaInternaImagen vi = (VentanaInternaImagen) selectInternalWindows();
        if (vi != null) {
            BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
            LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_LOGARITHM);
            LookupOp lop = new LookupOp(ltp, null);
            BufferedImage imgdest = lop.filter(imgActual, null);

            if (imgdest != null) {
                vi.getLienzo().setImageOriginal(imgdest);
                vi.getLienzo().repaint();
            }
        }
    } catch (Exception e) {
        System.err.println("Error al iluminar");
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:19,代码来源:VentanaPrincipal.java

示例9: botonOscurecerActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void botonOscurecerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonOscurecerActionPerformed
    try {
        VentanaInternaImagen vi = (VentanaInternaImagen) selectInternalWindows();
        if (vi != null) {
            BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
            LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_POWER);
            LookupOp lop = new LookupOp(ltp, null);
            BufferedImage imgdest = lop.filter(imgActual, null);
            if (imgdest != null) {
                vi.getLienzo().setImageOriginal(imgdest);
                vi.getLienzo().repaint();
            }
        }
    } catch (Exception e) {
        System.err.println("Error al oscurecer");
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:18,代码来源:VentanaPrincipal.java

示例10: negativeActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void negativeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_negativeActionPerformed
    try {
        VentanaInternaImagen vi = (VentanaInternaImagen) selectInternalWindows();
        if (vi != null) {
            BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
            LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_NEGATIVE);
            LookupOp lop = new LookupOp(ltp, null);
            BufferedImage imgdest = lop.filter(imgActual, null);

            if (imgdest != null) {
                vi.getLienzo().setImageOriginal(imgdest);
                vi.getLienzo().repaint();
            }
        }
    } catch (Exception e) {
        System.err.println("Error en el contraste");
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:19,代码来源:VentanaPrincipal.java

示例11: createLookupTable

import java.awt.image.LookupTable; //导入依赖的package包/类
/**
 * Crea objetos LookupTable usando valores por defecto
 */
static LookupTable createLookupTable(int type) {
    switch (type) {
        case TYPE_NEGATIVE:
            return negativeFuction();
        case TYPE_SFUNCION:
            return sFuction(DEFAULT_M_SFUNCTION, DEFAULT_E_SFUNCTION);
        case TYPE_LOGARITHM:
            return logarithmFuction();
        case TYPE_POWER:
            return powerFuction(DEFAULT_POWER);
        case TYPE_ROOT:
            return rootFuction(DEFAULT_ROOT);
        case TYPE_GAMMA_CORRECTION:
            return gammaCorrection(DEFAULT_A_GAMMA, DEFAULT_GAMMA);
        default:
            return null;
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:22,代码来源:LookupTableProducer.java

示例12: gammaCorrection

import java.awt.image.LookupTable; //导入依赖的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

示例13: botonContrasteActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void botonContrasteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonContrasteActionPerformed

      try {
          VentanaInterna vi = (VentanaInterna) escritorio.getSelectedFrame();
          if (vi != null) {
              BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
              LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_SFUNCION);
              LookupOp lop = new LookupOp(ltp, null);
              BufferedImage imgdest = lop.filter(imgActual, null);
              
              if (imgdest != null){
                  vi.getLienzo().setImageOriginal(imgdest);
                  vi.getLienzo().repaint();
              }
          }
      } catch (Exception e) {
          System.err.println("Error en el contraste");
      }
  }
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:20,代码来源:VentanaPrincipal.java

示例14: botonIluminarActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void botonIluminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonIluminarActionPerformed
    try {
        VentanaInterna vi = (VentanaInterna) escritorio.getSelectedFrame();
        if (vi != null) {
            BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
            LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_LOGARITHM);
            LookupOp lop = new LookupOp(ltp, null);
            BufferedImage imgdest = lop.filter(imgActual, null);
            
            if (imgdest != null){
                vi.getLienzo().setImageOriginal(imgdest);
                vi.getLienzo().repaint();
            }
        }
    } catch (Exception e) {
        System.err.println("Error al iluminar");
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:19,代码来源:VentanaPrincipal.java

示例15: botonOscurecerActionPerformed

import java.awt.image.LookupTable; //导入依赖的package包/类
private void botonOscurecerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonOscurecerActionPerformed
    try {
        VentanaInterna vi = (VentanaInterna) escritorio.getSelectedFrame();
        if (vi != null) {
            BufferedImage imgActual = convertImageType(vi.getLienzo().getImageActual(), BufferedImage.TYPE_INT_RGB);
            LookupTable ltp = LookupTableProducer.createLookupTable(LookupTableProducer.TYPE_POWER);
            LookupOp lop = new LookupOp(ltp, null);
            BufferedImage imgdest = lop.filter(imgActual, null);
            if (imgdest != null){
                vi.getLienzo().setImageOriginal(imgdest);
                vi.getLienzo().repaint();
            }
        }
    } catch (Exception e) {
        System.err.println("Error al oscurecer");
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:18,代码来源:VentanaPrincipal.java


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