java.awt.image.DataBufferShort Java Examples
The following examples show how to use
java.awt.image.DataBufferShort.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IncorrectAlphaConversionBicubic.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(GraphicsConfiguration gc, int type) { BufferedImage img = gc.createCompatibleImage(SIZE, SIZE, type); Graphics2D g2d = img.createGraphics(); g2d.setColor(RGB); g2d.fillRect(0, 0, SIZE, SIZE); g2d.dispose(); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }
Example #2
Source File: IncorrectUnmanagedImageRotatedClip.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI() { final BufferedImage bi = new BufferedImage(500, 200, TYPE_INT_ARGB); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #3
Source File: UnmanagedDrawImagePerformance.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(final int type) { final BufferedImage img = new BufferedImage(SIZE, SIZE, type); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }
Example #4
Source File: IncorrectAlphaConversionBicubic.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(GraphicsConfiguration gc, int type) { BufferedImage img = gc.createCompatibleImage(SIZE, SIZE, type); Graphics2D g2d = img.createGraphics(); g2d.setColor(RGB); g2d.fillRect(0, 0, SIZE, SIZE); g2d.dispose(); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }
Example #5
Source File: ImageTests.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public Image makeImage(TestEnvironment env, int w, int h) { BufferedImage img = new BufferedImage(w, h, type); if (unmanaged) { DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt)db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort)db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte)db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (Throwable e) {} } } return img; }
Example #6
Source File: IncorrectAlphaConversionBicubic.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(GraphicsConfiguration gc, int type) { BufferedImage img = gc.createCompatibleImage(SIZE, SIZE, type); Graphics2D g2d = img.createGraphics(); g2d.setColor(RGB); g2d.fillRect(0, 0, SIZE, SIZE); g2d.dispose(); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }
Example #7
Source File: UnmanagedDrawImagePerformance.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(final int type) { final BufferedImage img = new BufferedImage(SIZE, SIZE, type); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }
Example #8
Source File: IncorrectClipXorModeSW2Surface.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage getBufferedImage(int sw) { final BufferedImage bi = new BufferedImage(sw, sw, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bi.createGraphics(); g2d.setColor(Color.RED); g2d.fillRect(0, 0, sw, sw); g2d.dispose(); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #9
Source File: IncorrectUnmanagedImageRotatedClip.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI() { final BufferedImage bi = new BufferedImage(500, 200, TYPE_INT_ARGB); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #10
Source File: IncorrectUnmanagedImageSourceOffset.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(final int type) { final BufferedImage bi = new BufferedImage(511, 255, type); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #11
Source File: GraphicsUtils.java From RipplePower with Apache License 2.0 | 6 votes |
public static Object getData(final DataBuffer db) { if (db instanceof DataBufferByte) { return ((DataBufferByte) db).getData(); } else if (db instanceof DataBufferUShort) { return ((DataBufferUShort) db).getData(); } else if (db instanceof DataBufferShort) { return ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferInt) { return ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferFloat) { return ((DataBufferFloat) db).getData(); } else if (db instanceof DataBufferDouble) { return ((DataBufferDouble) db).getData(); } else { throw new RuntimeException("Not found DataBuffer class !"); } }
Example #12
Source File: SignedColorModel.java From scifio with BSD 2-Clause "Simplified" License | 6 votes |
@Override public WritableRaster createCompatibleWritableRaster(final int w, final int h) { if (pixelBits == 16) { final int[] bandOffsets = new int[nChannels]; for (int i = 0; i < nChannels; i++) bandOffsets[i] = i; final SampleModel m = new ComponentSampleModel(DataBuffer.TYPE_SHORT, w, h, nChannels, w * nChannels, bandOffsets); final DataBuffer db = new DataBufferShort(w * h, nChannels); return Raster.createWritableRaster(m, db, null); } return helper.createCompatibleWritableRaster(w, h); }
Example #13
Source File: ObjectUtils.java From WorldPainter with GNU General Public License v3.0 | 6 votes |
public static DataBuffer clone(DataBuffer dataBuffer) { if (dataBuffer instanceof DataBufferByte) { return clone((DataBufferByte) dataBuffer); } else if (dataBuffer instanceof DataBufferDouble) { return clone((DataBufferDouble) dataBuffer); } else if (dataBuffer instanceof DataBufferFloat) { return clone((DataBufferFloat) dataBuffer); } else if (dataBuffer instanceof DataBufferInt) { return clone((DataBufferInt) dataBuffer); } else if (dataBuffer instanceof DataBufferShort) { return clone((DataBufferShort) dataBuffer); } else if (dataBuffer instanceof DataBufferUShort) { return clone((DataBufferUShort) dataBuffer); } else { throw new UnsupportedOperationException("Don't know how to clone " + dataBuffer.getClass().getName()); } }
Example #14
Source File: ImageTests.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
public Image makeImage(TestEnvironment env, int w, int h) { BufferedImage img = new BufferedImage(w, h, type); if (unmanaged) { DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt)db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort)db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte)db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (Throwable e) {} } } return img; }
Example #15
Source File: UnmanagedDrawImagePerformance.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(final int type) { final BufferedImage img = new BufferedImage(SIZE, SIZE, type); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }
Example #16
Source File: IncorrectClipXorModeSW2Surface.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage getBufferedImage(int sw) { final BufferedImage bi = new BufferedImage(sw, sw, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bi.createGraphics(); g2d.setColor(Color.RED); g2d.fillRect(0, 0, sw, sw); g2d.dispose(); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #17
Source File: ImageTests.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public Image makeImage(TestEnvironment env, int w, int h) { BufferedImage img = new BufferedImage(w, h, type); if (unmanaged) { DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt)db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort)db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte)db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (Throwable e) {} } } return img; }
Example #18
Source File: ImageTests.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public Image makeImage(TestEnvironment env, int w, int h) { BufferedImage img = new BufferedImage(w, h, type); if (unmanaged) { DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt)db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort)db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte)db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (Throwable e) {} } } return img; }
Example #19
Source File: ImageTests.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public Image makeImage(TestEnvironment env, int w, int h) { BufferedImage img = new BufferedImage(w, h, type); if (unmanaged) { DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt)db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort)db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte)db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (Throwable e) {} } } return img; }
Example #20
Source File: IncorrectUnmanagedImageSourceOffset.java From hottub with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(final int type) { final BufferedImage bi = new BufferedImage(511, 255, type); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #21
Source File: IncorrectUnmanagedImageRotatedClip.java From hottub with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI() { final BufferedImage bi = new BufferedImage(500, 200, TYPE_INT_ARGB); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #22
Source File: IncorrectClipXorModeSW2Surface.java From hottub with GNU General Public License v2.0 | 6 votes |
private static BufferedImage getBufferedImage(int sw) { final BufferedImage bi = new BufferedImage(sw, sw, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bi.createGraphics(); g2d.setColor(Color.RED); g2d.fillRect(0, 0, sw, sw); g2d.dispose(); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #23
Source File: UnmanagedDrawImagePerformance.java From hottub with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(final int type) { final BufferedImage img = new BufferedImage(SIZE, SIZE, type); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }
Example #24
Source File: IncorrectAlphaConversionBicubic.java From hottub with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(GraphicsConfiguration gc, int type) { BufferedImage img = gc.createCompatibleImage(SIZE, SIZE, type); Graphics2D g2d = img.createGraphics(); g2d.setColor(RGB); g2d.fillRect(0, 0, SIZE, SIZE); g2d.dispose(); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }
Example #25
Source File: ImageTests.java From hottub with GNU General Public License v2.0 | 6 votes |
public Image makeImage(TestEnvironment env, int w, int h) { BufferedImage img = new BufferedImage(w, h, type); if (unmanaged) { DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt)db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort)db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte)db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (Throwable e) {} } } return img; }
Example #26
Source File: IncorrectUnmanagedImageSourceOffset.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(final int type) { final BufferedImage bi = new BufferedImage(511, 255, type); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #27
Source File: IncorrectUnmanagedImageRotatedClip.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI() { final BufferedImage bi = new BufferedImage(500, 200, TYPE_INT_ARGB); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #28
Source File: IncorrectClipXorModeSW2Surface.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage getBufferedImage(int sw) { final BufferedImage bi = new BufferedImage(sw, sw, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bi.createGraphics(); g2d.setColor(Color.RED); g2d.fillRect(0, 0, sw, sw); g2d.dispose(); final DataBuffer db = bi.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { bi.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return bi; }
Example #29
Source File: UnmanagedDrawImagePerformance.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(final int type) { final BufferedImage img = new BufferedImage(SIZE, SIZE, type); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }
Example #30
Source File: IncorrectAlphaConversionBicubic.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private static BufferedImage makeUnmanagedBI(GraphicsConfiguration gc, int type) { BufferedImage img = gc.createCompatibleImage(SIZE, SIZE, type); Graphics2D g2d = img.createGraphics(); g2d.setColor(RGB); g2d.fillRect(0, 0, SIZE, SIZE); g2d.dispose(); final DataBuffer db = img.getRaster().getDataBuffer(); if (db instanceof DataBufferInt) { ((DataBufferInt) db).getData(); } else if (db instanceof DataBufferShort) { ((DataBufferShort) db).getData(); } else if (db instanceof DataBufferByte) { ((DataBufferByte) db).getData(); } else { try { img.setAccelerationPriority(0.0f); } catch (final Throwable ignored) { } } return img; }