APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.glass.ui

public abstract Class Pixels

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.glass.ui.gtk.GtkPixels, com.sun.glass.ui.headless.HeadlessPixels, com.sun.glass.ui.ios.IosPixels, com.sun.glass.ui.mac.MacPixels, com.sun.glass.ui.monocle.MonoclePixels, com.sun.glass.ui.win.WinPixels
Imports
java.lang.annotation.Native, java.nio.Buffer, .ByteBuffer, .IntBuffer, .ByteOrder

The object wraps the given raw pixels data. Pixels class is NOT thread safe.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Pixels.Format

The Format specifies the native byte order of the underlying chunk of image data.

Field Summary

Modifier and TypeField and Description
protected final ByteBuffer
protected final int
protected final int
protected final IntBuffer
private final float
private final float
protected final int

Constructor Summary

AccessConstructor and Description
protected
Pixels(final int width, final int height, final ByteBuffer pixels)

protected
Pixels(final int width, final int height, final ByteBuffer pixels, float scalex, float scaley)

protected
Pixels(final int width, final int height, IntBuffer pixels)

protected
Pixels(final int width, final int height, IntBuffer pixels, float scalex, float scaley)

Method Summary

Modifier and TypeMethod and Description
protected abstract void
_attachByte(long ptr, int w, int h, ByteBuffer bytes, byte[] array, int offset)

protected abstract void
_attachInt(long ptr, int w, int h, IntBuffer ints, int[] array, int offset)

protected abstract void
public final ByteBuffer
public final void
private void
attachData(long ptr)

public final boolean
equals(Object object)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public final Buffer

Returns:

the original pixels buffer, unmodified
getBuffer
()

Returns the buffer used to create this Pixels object.

public final int
public final int
public final int
public static int
public final Buffer

Returns:

the original pixels buffer with its position set to zero and its mark discarded
getPixels
()

Rewinds and returns the buffer used to create this Pixels object.

public final float
public final float
public final float
public final float
public final int
public final int
public final int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

bytesback to summary
protected final ByteBuffer bytes
bytesPerComponentback to summary
protected final int bytesPerComponent
heightback to summary
protected final int height
intsback to summary
protected final IntBuffer ints
scalexback to summary
private final float scalex
scaleyback to summary
private final float scaley
widthback to summary
protected final int width

Constructor Detail

Pixelsback to summary
protected Pixels(final int width, final int height, final ByteBuffer pixels)
Pixelsback to summary
protected Pixels(final int width, final int height, final ByteBuffer pixels, float scalex, float scaley)
Pixelsback to summary
protected Pixels(final int width, final int height, IntBuffer pixels)
Pixelsback to summary
protected Pixels(final int width, final int height, IntBuffer pixels, float scalex, float scaley)

Method Detail

_attachByteback to summary
protected abstract void _attachByte(long ptr, int w, int h, ByteBuffer bytes, byte[] array, int offset)
_attachIntback to summary
protected abstract void _attachInt(long ptr, int w, int h, IntBuffer ints, int[] array, int offset)
_fillDirectByteBufferback to summary
protected abstract void _fillDirectByteBuffer(ByteBuffer bb)
asByteBufferback to summary
public final ByteBuffer asByteBuffer()
asByteBufferback to summary
public final void asByteBuffer(ByteBuffer bb)
attachDataback to summary
private void attachData(long ptr)
equalsback to summary
public final boolean equals(Object object)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getBufferback to summary
public final Buffer getBuffer()

Returns the buffer used to create this Pixels object.

Returns:Buffer

the original pixels buffer, unmodified

getBytesPerComponentback to summary
public final int getBytesPerComponent()
getHeightback to summary
public final int getHeight()
getHeightUnsafeback to summary
public final int getHeightUnsafe()
getNativeFormatback to summary
public static int getNativeFormat()
getPixelsback to summary
public final Buffer getPixels()

Rewinds and returns the buffer used to create this Pixels object.

Returns:Buffer

the original pixels buffer with its position set to zero and its mark discarded

getScaleXback to summary
public final float getScaleX()
getScaleXUnsafeback to summary
public final float getScaleXUnsafe()
getScaleYback to summary
public final float getScaleY()
getScaleYUnsafeback to summary
public final float getScaleYUnsafe()
getWidthback to summary
public final int getWidth()
getWidthUnsafeback to summary
public final int getWidthUnsafe()
hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
com.sun.glass.ui back to summary

public Class Pixels.Format

extends Object
Class Inheritance

The Format specifies the native byte order of the underlying chunk of image data. The data may be either INTs or BYTEs depending on the constructor used. The format ABCD implies the following byte order: BYTE[0] = A BYTE[1] = B BYTE[2] = C BYTE[3] = D BYTE[4] = A ... Calling code should take care of endianness of the platform when passing image data as ints.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BYTE_ARGBback to summary
public static final int BYTE_ARGB
Annotations
@Native
BYTE_BGRA_PREback to summary
public static final int BYTE_BGRA_PRE
Annotations
@Native

Constructor Detail

Formatback to summary
public Format()