类java.awt.image.ByteLookupTable源码实例Demo

下面列出了怎么用java.awt.image.ByteLookupTable的API类实例代码及写法,或者点击链接到github查看源代码。

public static void main(String[] args) {

        byte[][] data = new byte[1][10];
        ByteLookupTable lut = new ByteLookupTable(0, data);
        RasterOp op = new LookupOp(lut, null);

        int[] bandOffsets = {0};
        Point location = new Point(0, 0);
        DataBuffer db = new DataBufferByte(10 * 10);
        SampleModel sm = new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
                                                         10, 10, 1, 10,
                                                         bandOffsets);

        Raster src = Raster.createRaster(sm, db, location);

        op.filter(src, null); // this used to result in NullPointerException
    }
 
源代码2 项目: java-swing-tips   文件: MainPanel.java
private static BufferedImage getFilteredImage(URL url) {
  BufferedImage image = Optional.ofNullable(url)
      .map(u -> {
        try {
          return ImageIO.read(u);
        } catch (IOException ex) {
          return makeMissingImage();
        }
      }).orElseGet(MainPanel::makeMissingImage);

  BufferedImage dest = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);
  byte[] b = new byte[256];
  for (int i = 0; i < b.length; i++) {
    b[i] = (byte) (i * .2f);
  }
  BufferedImageOp op = new LookupOp(new ByteLookupTable(0, b), null);
  op.filter(image, dest);
  return dest;
}
 
源代码3 项目: java-swing-tips   文件: MainPanel.java
private static BufferedImage getFilteredImage(URL url) {
  BufferedImage image = Optional.ofNullable(url).map(u -> {
    try {
      return ImageIO.read(u);
    } catch (IOException ex) {
      return makeMissingImage();
    }
  }).orElseGet(MainPanel::makeMissingImage);

  BufferedImage dest = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);
  byte[] b = new byte[256];
  for (int i = 0; i < b.length; i++) {
    b[i] = (byte) (i * .2f);
  }
  BufferedImageOp op = new LookupOp(new ByteLookupTable(0, b), null);
  op.filter(image, dest);
  return dest;
}
 
源代码4 项目: java-swing-tips   文件: MainPanel.java
private static BufferedImage getFilteredImage(URL url) {
  BufferedImage image = Optional.ofNullable(url)
      .map(u -> {
        try {
          return ImageIO.read(u);
        } catch (IOException ex) {
          return makeMissingImage();
        }
      }).orElseGet(MainPanel::makeMissingImage);

  BufferedImage dest = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);
  byte[] b = new byte[256];
  for (int i = 0; i < b.length; i++) {
    b[i] = (byte) (i * .5);
  }
  BufferedImageOp op = new LookupOp(new ByteLookupTable(0, b), null);
  op.filter(image, dest);
  return dest;
}
 
源代码5 项目: java-swing-tips   文件: MainPanel.java
public static BufferedImage getFilteredImage(URL url) {
  BufferedImage image = Optional.ofNullable(url)
      .map(u -> {
        try {
          return ImageIO.read(u);
        } catch (IOException ex) {
          return makeMissingImage();
        }
      }).orElseGet(ImageUtil::makeMissingImage);

  BufferedImage dest = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);
  byte[] b = new byte[256];
  IntStream.range(0, b.length).forEach(i -> b[i] = (byte) (i * .5));
  BufferedImageOp op = new LookupOp(new ByteLookupTable(0, b), null);
  op.filter(image, dest);
  return dest;
}
 
源代码6 项目: dragonwell8_jdk   文件: MlibOpsTest.java
private static BufferedImageOp getLookupOp() {
    byte[] inv = new byte[256];
    for (int i = 0; i < 256; i++) {
        inv[i] = (byte)(255 - i);
    }
    ByteLookupTable table = new ByteLookupTable(0, inv);
    return new LookupOp(table, null);
}
 
源代码7 项目: dragonwell8_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);
}
 
源代码8 项目: dragonwell8_jdk   文件: SingleArrayTest.java
public SingleArrayTest() {

        byte[] array = new byte[256];
        for (int i = 0; i < 256; i++) {
            array[i] = (byte)i;
        }
        ByteLookupTable table = new ByteLookupTable(0, array);

        op = new LookupOp(table, null);
    }
 
源代码9 项目: TencentKona-8   文件: MlibOpsTest.java
private static BufferedImageOp getLookupOp() {
    byte[] inv = new byte[256];
    for (int i = 0; i < 256; i++) {
        inv[i] = (byte)(255 - i);
    }
    ByteLookupTable table = new ByteLookupTable(0, inv);
    return new LookupOp(table, null);
}
 
源代码10 项目: TencentKona-8   文件: 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);
}
 
源代码11 项目: TencentKona-8   文件: SingleArrayTest.java
public SingleArrayTest() {

        byte[] array = new byte[256];
        for (int i = 0; i < 256; i++) {
            array[i] = (byte)i;
        }
        ByteLookupTable table = new ByteLookupTable(0, array);

        op = new LookupOp(table, null);
    }
 
源代码12 项目: jdk8u60   文件: MlibOpsTest.java
private static BufferedImageOp getLookupOp() {
    byte[] inv = new byte[256];
    for (int i = 0; i < 256; i++) {
        inv[i] = (byte)(255 - i);
    }
    ByteLookupTable table = new ByteLookupTable(0, inv);
    return new LookupOp(table, null);
}
 
源代码13 项目: jdk8u60   文件: 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);
}
 
源代码14 项目: jdk8u60   文件: SingleArrayTest.java
public SingleArrayTest() {

        byte[] array = new byte[256];
        for (int i = 0; i < 256; i++) {
            array[i] = (byte)i;
        }
        ByteLookupTable table = new ByteLookupTable(0, array);

        op = new LookupOp(table, null);
    }
 
源代码15 项目: openjdk-jdk8u   文件: MlibOpsTest.java
private static BufferedImageOp getLookupOp() {
    byte[] inv = new byte[256];
    for (int i = 0; i < 256; i++) {
        inv[i] = (byte)(255 - i);
    }
    ByteLookupTable table = new ByteLookupTable(0, inv);
    return new LookupOp(table, null);
}
 
源代码16 项目: openjdk-jdk8u   文件: 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);
}
 
源代码17 项目: openjdk-jdk8u   文件: SingleArrayTest.java
public SingleArrayTest() {

        byte[] array = new byte[256];
        for (int i = 0; i < 256; i++) {
            array[i] = (byte)i;
        }
        ByteLookupTable table = new ByteLookupTable(0, array);

        op = new LookupOp(table, null);
    }
 
源代码18 项目: openjdk-jdk8u-backup   文件: MlibOpsTest.java
private static BufferedImageOp getLookupOp() {
    byte[] inv = new byte[256];
    for (int i = 0; i < 256; i++) {
        inv[i] = (byte)(255 - i);
    }
    ByteLookupTable table = new ByteLookupTable(0, inv);
    return new LookupOp(table, null);
}
 
源代码19 项目: openjdk-jdk8u-backup   文件: 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);
}
 
源代码20 项目: openjdk-jdk8u-backup   文件: SingleArrayTest.java
public SingleArrayTest() {

        byte[] array = new byte[256];
        for (int i = 0; i < 256; i++) {
            array[i] = (byte)i;
        }
        ByteLookupTable table = new ByteLookupTable(0, array);

        op = new LookupOp(table, null);
    }
 
源代码21 项目: openjdk-jdk9   文件: MlibOpsTest.java
private static BufferedImageOp getLookupOp() {
    byte[] inv = new byte[256];
    for (int i = 0; i < 256; i++) {
        inv[i] = (byte)(255 - i);
    }
    ByteLookupTable table = new ByteLookupTable(0, inv);
    return new LookupOp(table, null);
}
 
源代码22 项目: openjdk-jdk9   文件: 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);
}
 
源代码23 项目: openjdk-jdk9   文件: SingleArrayTest.java
public SingleArrayTest() {

        byte[] array = new byte[256];
        for (int i = 0; i < 256; i++) {
            array[i] = (byte)i;
        }
        ByteLookupTable table = new ByteLookupTable(0, array);

        op = new LookupOp(table, null);
    }
 
源代码24 项目: jdk8u-jdk   文件: MlibOpsTest.java
private static BufferedImageOp getLookupOp() {
    byte[] inv = new byte[256];
    for (int i = 0; i < 256; i++) {
        inv[i] = (byte)(255 - i);
    }
    ByteLookupTable table = new ByteLookupTable(0, inv);
    return new LookupOp(table, null);
}
 
源代码25 项目: 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);
}
 
源代码26 项目: jdk8u-jdk   文件: SingleArrayTest.java
public SingleArrayTest() {

        byte[] array = new byte[256];
        for (int i = 0; i < 256; i++) {
            array[i] = (byte)i;
        }
        ByteLookupTable table = new ByteLookupTable(0, array);

        op = new LookupOp(table, null);
    }
 
源代码27 项目: hottub   文件: MlibOpsTest.java
private static BufferedImageOp getLookupOp() {
    byte[] inv = new byte[256];
    for (int i = 0; i < 256; i++) {
        inv[i] = (byte)(255 - i);
    }
    ByteLookupTable table = new ByteLookupTable(0, inv);
    return new LookupOp(table, null);
}
 
源代码28 项目: hottub   文件: 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);
}
 
源代码29 项目: hottub   文件: SingleArrayTest.java
public SingleArrayTest() {

        byte[] array = new byte[256];
        for (int i = 0; i < 256; i++) {
            array[i] = (byte)i;
        }
        ByteLookupTable table = new ByteLookupTable(0, array);

        op = new LookupOp(table, null);
    }
 
源代码30 项目: openjdk-8-source   文件: MlibOpsTest.java
private static BufferedImageOp getLookupOp() {
    byte[] inv = new byte[256];
    for (int i = 0; i < 256; i++) {
        inv[i] = (byte)(255 - i);
    }
    ByteLookupTable table = new ByteLookupTable(0, inv);
    return new LookupOp(table, null);
}
 
 类所在包
 同包方法