DirectBufferedImage

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jagatoo.image
Class DirectBufferedImage

    java.lang.Object
      java.awt.Image
          java.awt.image.BufferedImage
              org.jagatoo.image.DirectBufferedImage

All Implemented Interfaces:
  java.awt.image.RenderedImage, java.awt.image.WritableRenderedImage, java.awt.Transparency

    public class DirectBufferedImage

extends java.awt.image.BufferedImage

This is a BufferedImage extension, that uses a DataBuffer, that stores its data directly in a ByteBuffer.
This allows for minimum memory usage, since no data is stored more than once.

Author:
  David Yazel, Marvin Froehlich (aka Qudus)

Nested Class Summary
`static class` | `DirectBufferedImage.Type`

Field Summary

Fields inherited from class java.awt.image.BufferedImage
`TYPE_3BYTE_BGR, TYPE_4BYTE_ABGR, TYPE_4BYTE_ABGR_PRE, TYPE_BYTE_BINARY, TYPE_BYTE_GRAY, TYPE_BYTE_INDEXED, TYPE_CUSTOM, TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_BGR, TYPE_INT_RGB, TYPE_USHORT_555_RGB, TYPE_USHORT_565_RGB, TYPE_USHORT_GRAY`

Fields inherited from class java.awt.Image
`accelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty`

Fields inherited from interface java.awt.Transparency
`BITMASK, OPAQUE, TRANSLUCENT`

Method Summary
`java.nio.ByteBuffer` | `getByteBuffer()`
`DirectBufferedImage.Type` | `getDirectType()`
`int` | `getNumBytes()`
`static DirectBufferedImage` | `loadDirectImage(java.io.File file)` reads in an image using image io.
`static DirectBufferedImage` | `loadDirectImage(java.io.File file, boolean allowAlpha)` reads in an image using image io.
`static DirectBufferedImage` | `loadDirectImage(java.io.InputStream in)` reads in an image using image io.
`static DirectBufferedImage` | `loadDirectImage(java.io.InputStream in, boolean allowAlpha)` reads in an image using image io.
`static DirectBufferedImage` | `loadDirectImage(java.lang.String name)`
`static DirectBufferedImage` | `loadDirectImage(java.lang.String name, boolean allowAlpha)` reads in an image using image io.
`static java.awt.image.BufferedImage` | `loadDirectImage(java.net.URL url)`
`static DirectBufferedImage` | `loadDirectImage(java.net.URL url, boolean allowAlpha)` reads in an image using image io.
`static DirectBufferedImage` | `make(java.awt.image.BufferedImage bi)`
`static DirectBufferedImage` | `make(java.awt.image.BufferedImage bi, boolean allowAlpha)`
`static DirectBufferedImage` | `make(DirectBufferedImage.Type type, int width, int height)`
`static DirectBufferedImage` | `makeDirectImageOneByte(int width, int height)`
`static DirectBufferedImage` | `makeDirectImageRGB(java.awt.image.BufferedImage source)` Takes the source buffered image and converts it to a buffered image which is backed by a direct byte buffer
`static DirectBufferedImage` | `makeDirectImageRGB(int width, int height)` Creates a buffered image which is backed by a NIO byte buffer
`static DirectBufferedImage` | `makeDirectImageRGB(int width, int height, int pixelSize)` Creates a buffered image which is backed by a NIO byte buffer
`static DirectBufferedImage` | `makeDirectImageRGB(int width, int height, int[] bandOffsets, java.nio.ByteBuffer bb)` Creates a buffered image which is backed by a NIO byte buffer
`static DirectBufferedImage` | `makeDirectImageRGBA(java.awt.image.BufferedImage source)` takes the source buffered image and converts it to a buffered image which is backed by a direct byte buffer
`static DirectBufferedImage` | `makeDirectImageRGBA(int width, int height)` Creates a buffered image which is backed by a NIO byte buffer
`static DirectBufferedImage` | `makeDirectImageRGBA(int width, int height, int pixelSize)` Creates a buffered image which is backed by a NIO byte buffer
`static DirectBufferedImage` | `makeDirectImageRGBA(int width, int height, int[] bandOffsets, java.nio.ByteBuffer bb)` Creates a buffered image which is backed by a NIO byte buffer
`static DirectBufferedImage` | `makeDirectImageTwoBytes(int width, int height)` Creates a buffered image which is backed by a NIO byte buffer
`static DirectBufferedImage` | `makeDirectImageTwoBytes(int width, int height, int pixelSize)`

Methods inherited from class java.awt.image.BufferedImage
`addTileObserver, coerceData, copyData, createGraphics, getAlphaRaster, getColorModel, getData, getData, getGraphics, getHeight, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getProperty, getPropertyNames, getRaster, getRGB, getRGB, getSampleModel, getSource, getSources, getSubimage, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getTransparency, getType, getWidth, getWidth, getWritableTile, getWritableTileIndices, hasTileWriters, isAlphaPremultiplied, isTileWritable, releaseWritableTile, removeTileObserver, setData, setRGB, setRGB, toString`

Methods inherited from class java.awt.Image
`flush, getAccelerationPriority, getCapabilities, getScaledInstance, setAccelerationPriority`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### getDirectType

    public final DirectBufferedImage.Type getDirectType()

### getNumBytes

    public final int getNumBytes()

### getByteBuffer

    public final java.nio.ByteBuffer getByteBuffer()

### makeDirectImageRGBA

    public static DirectBufferedImage makeDirectImageRGBA(int width,
                                                          int height,
                                                          int[] bandOffsets,
                                                          java.nio.ByteBuffer bb)

  Creates a buffered image which is backed by a NIO byte buffer

  Parameters:
    `width` -
    `height` -
    `bandOffsets` -
    `bb` -
  Returns:

### makeDirectImageRGBA

    public static DirectBufferedImage makeDirectImageRGBA(int width,
                                                          int height,
                                                          int pixelSize)

  Creates a buffered image which is backed by a NIO byte buffer

  Parameters:
    `width` -
    `height` -
    `pixelSize` -
  Returns:

### makeDirectImageRGBA

    public static DirectBufferedImage makeDirectImageRGBA(int width,
                                                          int height)

  Creates a buffered image which is backed by a NIO byte buffer

  Parameters:
    `width` -
    `height` -
  Returns:

### makeDirectImageRGB

    public static DirectBufferedImage makeDirectImageRGB(int width,
                                                         int height,
                                                         int[] bandOffsets,
                                                         java.nio.ByteBuffer bb)

  Creates a buffered image which is backed by a NIO byte buffer

  Parameters:
    `width` -
    `height` -
    `bandOffsets` -
    `bb` -
  Returns:

### makeDirectImageRGB

    public static DirectBufferedImage makeDirectImageRGB(int width,
                                                         int height,
                                                         int pixelSize)

  Creates a buffered image which is backed by a NIO byte buffer

  Parameters:
    `width` -
    `height` -
    `pixelSize` -
  Returns:

### makeDirectImageRGB

    public static DirectBufferedImage makeDirectImageRGB(int width,
                                                         int height)

  Creates a buffered image which is backed by a NIO byte buffer

  Parameters:
    `width` -
    `height` -
  Returns:

### makeDirectImageRGB

    public static DirectBufferedImage makeDirectImageRGB(java.awt.image.BufferedImage source)

  Takes the source buffered image and converts it to a buffered image which is backed by a direct byte buffer

  Parameters:
    `source` -
  Returns:
    the DirectBufferedImage

### makeDirectImageTwoBytes

    public static DirectBufferedImage makeDirectImageTwoBytes(int width,
                                                              int height,
                                                              int pixelSize)

### makeDirectImageTwoBytes

    public static DirectBufferedImage makeDirectImageTwoBytes(int width,
                                                              int height)

  Creates a buffered image which is backed by a NIO byte buffer

  Parameters:
    `width` -
    `height` -
  Returns:

### makeDirectImageOneByte

    public static DirectBufferedImage makeDirectImageOneByte(int width,
                                                             int height)

### makeDirectImageRGBA

    public static DirectBufferedImage makeDirectImageRGBA(java.awt.image.BufferedImage source)

  takes the source buffered image and converts it to a buffered image which is backed by a direct byte buffer

  Parameters:
    `source` -
  Returns:

### make

    public static DirectBufferedImage make(DirectBufferedImage.Type type,
                                           int width,
                                           int height)

### make

    public static DirectBufferedImage make(java.awt.image.BufferedImage bi,
                                           boolean allowAlpha)

### make

    public static DirectBufferedImage make(java.awt.image.BufferedImage bi)

### loadDirectImage

    public static DirectBufferedImage loadDirectImage(java.io.InputStream in,
                                                      boolean allowAlpha)
                                               throws java.io.IOException

  reads in an image using image io. It then detects if this is a RGBA or RGB image and converts it to the appropriate direct image. Unfortunly this does mean we are loading a buffered image which is thrown away, but there is no help for that currently.

  Parameters:
    `in` -
    `allowAlpha` -
  Returns:
  Throws:
    `java.io.IOException`

### loadDirectImage

    public static DirectBufferedImage loadDirectImage(java.io.InputStream in)
                                               throws java.io.IOException

  reads in an image using image io. It then detects if this is a RGBA or RGB image and converts it to the appropriate direct image. Unfortunly this does mean we are loading a buffered image which is thrown away, but there is no help for that currently.

  Parameters:
    `in` -
  Returns:
  Throws:
    `java.io.IOException`

### loadDirectImage

    public static DirectBufferedImage loadDirectImage(java.net.URL url,
                                                      boolean allowAlpha)
                                               throws java.io.IOException

  reads in an image using image io. It then detects if this is a RGBA or RGB image and converts it to the appropriate direct image. Unfortunly this does mean we are loading a buffered image which is thrown away, but there is no help for that currently.

  Parameters:
    `url` -
    `allowAlpha` -
  Returns:
  Throws:
    `java.io.IOException`

### loadDirectImage

    public static java.awt.image.BufferedImage loadDirectImage(java.net.URL url)
                                                        throws java.io.IOException

  Throws:
    `java.io.IOException`

### loadDirectImage

    public static DirectBufferedImage loadDirectImage(java.io.File file,
                                                      boolean allowAlpha)
                                               throws java.io.IOException

  reads in an image using image io. It then detects if this is a RGBA or RGB image and converts it to the appropriate direct image. Unfortunly this does mean we are loading a buffered image which is thrown away, but there is no help for that currently.

  Parameters:
    `file` -
    `allowAlpha` -
  Returns:
  Throws:
    `java.io.IOException`

### loadDirectImage

    public static DirectBufferedImage loadDirectImage(java.io.File file)
                                               throws java.io.IOException

  reads in an image using image io. It then detects if this is a RGBA or RGB image and converts it to the appropriate direct image. Unfortunly this does mean we are loading a buffered image which is thrown away, but there is no help for that currently.

  Parameters:
    `file` -
  Returns:
  Throws:
    `java.io.IOException`

### loadDirectImage

    public static DirectBufferedImage loadDirectImage(java.lang.String name,
                                                      boolean allowAlpha)
                                               throws java.io.IOException

  reads in an image using image io. It then detects if this is a RGBA or RGB image and converts it to the appropriate direct image. Unfortunly this does mean we are loading a buffered image which is thrown away, but there is no help for that currently.

  Parameters:
    `name` -
    `allowAlpha` -
  Returns:
  Throws:
    `java.io.IOException`

### loadDirectImage

    public static DirectBufferedImage loadDirectImage(java.lang.String name)
                                               throws java.io.IOException

  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD