Java 类java.awt.image.LookupTable 实例源码

项目:jdk8u-jdk    文件:IntImageReverseTest.java   
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.");
    }
}
项目:openjdk-jdk10    文件:IntImageReverseTest.java   
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.");
    }
}
项目:openjdk9    文件:IntImageReverseTest.java   
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.");
    }
}
项目:jdk8u_jdk    文件:IntImageReverseTest.java   
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.");
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:IntImageReverseTest.java   
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.");
    }
}
项目:SmartTokens    文件:GUIUtils.java   
/**
 * 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);
}
项目:infobip-open-jdk-8    文件:IntImageReverseTest.java   
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.");
    }
}
项目:jdk8u-dev-jdk    文件:IntImageReverseTest.java   
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.");
    }
}
项目:OLD-OpenJDK8    文件:IntImageReverseTest.java   
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.");
    }
}
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
        }
    }
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
    }
}
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
    }
}
项目:Sistemas-Multimedia    文件:LookupTableProducer.java   
/**
 * 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;
    }
}
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
        }
    }
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
    }
}
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
    }
}
项目:Sistemas-Multimedia    文件:LookupTableProducer.java   
/**
 * 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;
    }
}
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
        }
    }
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
    }
}
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
    }
}
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
    }
}
项目:Sistemas-Multimedia    文件:LookupTableProducer.java   
/**
 * 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;
    }
}
项目:Sistemas-Multimedia    文件:LookupTableProducer.java   
/**
 * 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;
}
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
      }
  }
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
    }
}
项目:Sistemas-Multimedia    文件:VentanaPrincipal.java   
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");
    }
}
项目:Sistemas-Multimedia    文件:LookupTableProducer.java   
/**
 * 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;
    }
}
项目:geneaquilt    文件:GUIUtils.java   
/**
 * 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);
}
项目:jdk8u-jdk    文件:IntImageReverseTest.java   
/**
 * Reverse image color components, leave alpha unchanged.
 */
private static LookupTable createReverseTable() {
    byte[] data = new byte[256];

    for (int i = 0; i < 256; i++) {
        data[i] = (byte) (255 - i);
    }


    return new ByteLookupTable(0, data);
}
项目:openjdk-jdk10    文件:IntImageReverseTest.java   
/**
 * Reverse image color components, leave alpha unchanged.
 */
private static LookupTable createReverseTable() {
    byte[] data = new byte[256];

    for (int i = 0; i < 256; i++) {
        data[i] = (byte) (255 - i);
    }


    return new ByteLookupTable(0, data);
}
项目:openjdk9    文件:IntImageReverseTest.java   
/**
 * Reverse image color components, leave alpha unchanged.
 */
private static LookupTable createReverseTable() {
    byte[] data = new byte[256];

    for (int i = 0; i < 256; i++) {
        data[i] = (byte) (255 - i);
    }


    return new ByteLookupTable(0, data);
}
项目:PhET    文件:AbstractMediaButton.java   
public MyRescaleOp( final double scale, final double offset ) {
    super( new LookupTable( 0, 4 ) {
        public int[] lookupPixel( int[] src, int[] dest ) {
            for ( int i = 0; i < src.length; i++ ) {
                dest[i] = (int) MathUtil.clamp( 0, src[i] * scale + offset, 255 );
            }
            return dest;
        }
    }, null );
}
项目:jdk8u_jdk    文件:IntImageReverseTest.java   
/**
 * Reverse image color components, leave alpha unchanged.
 */
private static LookupTable createReverseTable() {
    byte[] data = new byte[256];

    for (int i = 0; i < 256; i++) {
        data[i] = (byte) (255 - i);
    }


    return new ByteLookupTable(0, data);
}
项目:lookaside_java-1.8.0-openjdk    文件:IntImageReverseTest.java   
/**
 * Reverse image color components, leave alpha unchanged.
 */
private static LookupTable createReverseTable() {
    byte[] data = new byte[256];

    for (int i = 0; i < 256; i++) {
        data[i] = (byte) (255 - i);
    }


    return new ByteLookupTable(0, data);
}
项目:iSeleda    文件:ExtractChannel.java   
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;
}
项目:iSeleda    文件:LookupFactory.java   
public static LookupTable createLookupForRemoveRed() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getNullMapping();
    lookupData[1] = getDefaultMapping();
    lookupData[2] = getDefaultMapping();
    return new ShortLookupTable(0, lookupData);
}
项目:iSeleda    文件:LookupFactory.java   
public static LookupTable createLookupForOnlyRed() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getDefaultMapping();
    lookupData[1] = getNullMapping();
    lookupData[2] = getNullMapping();
    return new ShortLookupTable(0, lookupData);
}
项目:iSeleda    文件:LookupFactory.java   
public static LookupTable createLookupForRemoveGreen() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getDefaultMapping();
    lookupData[1] = getNullMapping();
    lookupData[2] = getDefaultMapping();
    return new ShortLookupTable(0, lookupData);
}
项目:iSeleda    文件:LookupFactory.java   
public static LookupTable createLookupForOnlyGreen() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getNullMapping();
    lookupData[1] = getDefaultMapping();
    lookupData[2] = getNullMapping();
    return new ShortLookupTable(0, lookupData);
}
项目:iSeleda    文件:LookupFactory.java   
public static LookupTable createLookupForRemoveBlue() {
    short[][] lookupData = new short[3][256];
    lookupData[0] = getDefaultMapping();
    lookupData[1] = getDefaultMapping();
    lookupData[2] = getNullMapping();
    return new ShortLookupTable(0, lookupData);
}