Quaqua 7.4.2 2011-07-05

ch.randelshofer.quaqua.osx
Class OSXImageIO

java.lang.Object
  extended by ch.randelshofer.quaqua.osx.OSXImageIO

public class OSXImageIO
extends java.lang.Object

OSXImageIO can read images using the Mac OS X Cocoa NSImage API.

Images are read using the Cocoa class NSImage.

Version:
$Id: OSXImageIO.java 371 2011-01-28 09:57:45Z wrandelshofer $
Author:
Werner Randelshofer

Method Summary
static boolean isNativeCodeAvailable()
          Returns true if native code is available.
static java.awt.image.BufferedImage read(byte[] data)
          Reads a BufferedImage from the supplied array using the Cocoa NSImage API.
static java.awt.image.BufferedImage read(java.io.File file)
          Reads a BufferedImage from the supplied File using the Cocoa NSImage API.
static java.awt.image.BufferedImage read(java.io.File file, int width, int height)
          Reads a BufferedImage scaled to the specified size from the supplied File using the Cocoa NSImage API.
static java.awt.image.BufferedImage readSystemClipboard()
          Returns a BufferedImage as the result of decoding the data in the Mac OS X system clipboard using the Cocoa NSImage API.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public static java.awt.image.BufferedImage read(java.io.File file)
                                         throws java.io.IOException
Reads a BufferedImage from the supplied File using the Cocoa NSImage API.

Throws:
java.io.IOException

read

public static java.awt.image.BufferedImage read(java.io.File file,
                                                int width,
                                                int height)
                                         throws java.io.IOException
Reads a BufferedImage scaled to the specified size from the supplied File using the Cocoa NSImage API.

Parameters:
file - The file containing the image.
width - The preferred width.
height - The preferred height.
Throws:
java.io.IOException

read

public static java.awt.image.BufferedImage read(byte[] data)
                                         throws java.io.IOException
Reads a BufferedImage from the supplied array using the Cocoa NSImage API.

Throws:
java.io.IOException

readSystemClipboard

public static java.awt.image.BufferedImage readSystemClipboard()
                                                        throws java.io.IOException
Returns a BufferedImage as the result of decoding the data in the Mac OS X system clipboard using the Cocoa NSImage API.

Throws:
java.io.IOException

isNativeCodeAvailable

public static boolean isNativeCodeAvailable()
Returns true if native code is available. This method also loads the native code.


Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.