com.docomostar.ui.ogl
クラス DirectBufferFactory

Object
  上位を拡張 com.docomostar.ui.ogl.DirectBufferFactory

public final class DirectBufferFactory
extends Object
 [iアプリオプションAPI]

ダイレクトメモリバッファのファクトリクラスです。
GraphicsOGL で使用するバッファを確保するためのクラスです。

導入されたバージョン:
Star-1.0

メソッドの概要
 ByteBuffer allocateByteBuffer(byte[] initialData)
           byte単位のダイレクトメモリバッファを確保します。
 ByteBuffer allocateByteBuffer(ByteBuffer buff)
           byte単位のダイレクトメモリバッファを確保します。
 ByteBuffer allocateByteBuffer(int size)
           byte単位のダイレクトメモリバッファを確保します。
 ByteBuffer allocateByteBuffer(short[] initialData)
           byte単位のダイレクトメモリバッファを確保します。
 FloatBuffer allocateFloatBuffer(byte[] initialData)
           float単位のダイレクトメモリバッファを確保します。
 FloatBuffer allocateFloatBuffer(float[] initialData)
           float単位のダイレクトメモリバッファを確保します。
 FloatBuffer allocateFloatBuffer(FloatBuffer buff)
           float単位のダイレクトメモリバッファを確保します。
 FloatBuffer allocateFloatBuffer(int size)
           float単位のダイレクトメモリバッファを確保します。
 IntBuffer allocateIntBuffer(byte[] initialData)
           int単位のダイレクトメモリバッファを確保します。
 IntBuffer allocateIntBuffer(int size)
           int単位のダイレクトメモリバッファを確保します。
 IntBuffer allocateIntBuffer(int[] initialData)
           int単位のダイレクトメモリバッファを確保します。
 IntBuffer allocateIntBuffer(IntBuffer buff)
           int単位のダイレクトメモリバッファを確保します。
 ShortBuffer allocateShortBuffer(byte[] initialData)
           short単位のダイレクトメモリバッファを確保します。
 ShortBuffer allocateShortBuffer(int size)
           short単位のダイレクトメモリバッファを確保します。
 ShortBuffer allocateShortBuffer(short[] initialData)
           short単位のダイレクトメモリバッファを確保します。
 ShortBuffer allocateShortBuffer(ShortBuffer buff)
           short単位のダイレクトメモリバッファを確保します。
static DirectBufferFactory getFactory()
           ダイレクトバッファを生成するファクトリを取得します。
 
クラス Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

getFactory

public static DirectBufferFactory getFactory()

ダイレクトバッファを生成するファクトリを取得します。

戻り値:
ファクトリのオブジェクト
例外:
UnsupportedOperationException -
OpenGL® ES に相当する機能をサポートしていない場合に発生します。

allocateByteBuffer

public ByteBuffer allocateByteBuffer(int size)

byte単位のダイレクトメモリバッファを確保します。

確保されたエリアのメモリはゼロで初期化されます。

パラメータ:
size - 確保する要素数
例外:
IllegalArgumentException -
sizeが0以下の値の場合に発生します。

allocateByteBuffer

public ByteBuffer allocateByteBuffer(byte[] initialData)

byte単位のダイレクトメモリバッファを確保します。

initialDataの配列長分のメモリバッファを確保後、初期データをinitialDataに設定します。

パラメータ:
initialData - 初期データ
例外:
NullPointerException -
initialDataがnullの場合に発生します。
IllegalArgumentException -
initialDataの配列長が0の場合に発生します。

allocateByteBuffer

public ByteBuffer allocateByteBuffer(short[] initialData)

byte単位のダイレクトメモリバッファを確保します。

initialDataの配列長分のメモリバッファを確保後、初期データをinitialDataに設定します。

引数initialDataの各要素は、下位8ビットのみが有効になります。

パラメータ:
initialData - 初期データ
例外:
NullPointerException -
initialDataがnullの場合に発生します。
IllegalArgumentException -
initialDataの配列長が0の場合に発生します。

allocateByteBuffer

public ByteBuffer allocateByteBuffer(ByteBuffer buff)

byte単位のダイレクトメモリバッファを確保します。

引数buffのセグメントの開始インデックスをoffset、データ長をlengthとすると、 このメソッドではlength分のメモリバッファを確保後、 初期データをbuff[offset]からlength分だけコピーします。

パラメータ:
buff - コピーするバッファ
例外:
NullPointerException -
buffがnullの場合に発生します。
IllegalArgumentException -
引数buffにシステムが提供しているByteBufferオブジェクト以外のオブジェクトが指定された場合に発生します。

allocateShortBuffer

public ShortBuffer allocateShortBuffer(int size)

short単位のダイレクトメモリバッファを確保します。

確保されたエリアのメモリはゼロで初期化されます。

パラメータ:
size - 確保する要素数
例外:
IllegalArgumentException -
sizeが0以下の値の場合に発生します。

allocateShortBuffer

public ShortBuffer allocateShortBuffer(byte[] initialData)

short単位のダイレクトメモリバッファを確保します。

initialDataの配列長分のメモリバッファを確保後、初期データをinitialDataに設定します。 initialDataのサイズが奇数の場合、最後のデータは捨てられます。

本メソッドで設定した initialData は 2 バイトごとに区切られ、 それぞれが short 型の整数として解釈されます。 解釈された結果は、 ShortBuffer.get(int, short[], int, int) 時に short 型の配列として取得することができます。 なお、解釈時のバイトオーダは端末により異なります。

現在の実装では、端末のバイトオーダは全てリトルエンディアンです。

パラメータ:
initialData - 初期データ
例外:
NullPointerException -
initialDataがnullの場合に発生します。
IllegalArgumentException -
initialDataの配列長が1以下の場合に発生します。

allocateShortBuffer

public ShortBuffer allocateShortBuffer(ShortBuffer buff)

short単位のダイレクトメモリバッファを確保します。

処理内容はallocateByteBuffer(ByteBuffer)と同様です。

パラメータ:
buff - コピーするバッファ
例外:
NullPointerException -
buffがnullの場合に発生します。
IllegalArgumentException -
引数buffにシステムが提供しているShortBufferオブジェクト以外のオブジェクトが指定された場合に発生します。

allocateShortBuffer

public ShortBuffer allocateShortBuffer(short[] initialData)

short単位のダイレクトメモリバッファを確保します。

initialDataの配列長分のメモリバッファを確保後、初期データをinitialDataに設定します。

パラメータ:
initialData - 初期データ
例外:
NullPointerException -
initialDataがnullの場合に発生します。
IllegalArgumentException -
initialDataの配列長が0以下の場合に発生します。

allocateIntBuffer

public IntBuffer allocateIntBuffer(int size)

int単位のダイレクトメモリバッファを確保します。

確保されたエリアのメモリはゼロで初期化されます。

パラメータ:
size - 確保する要素数
例外:
IllegalArgumentException -
sizeが0以下の値の場合に発生します。

allocateIntBuffer

public IntBuffer allocateIntBuffer(byte[] initialData)

int単位のダイレクトメモリバッファを確保します。

initialDataの配列長分のメモリバッファを確保後、初期データをinitialDataに設定します。 initialDataのサイズが4で割り切れない場合、最後のデータ(最大3バイト)は捨てられます。

本メソッドで設定した initialData は 4 バイトごとに区切られ、 それぞれが int 型の整数として解釈されます。 解釈された結果は、 IntBuffer.get(int, int[], int, int) によって int 型の配列として取得することができます。 なお、解釈時のバイトオーダは端末により異なります。

現在の実装では、端末のバイトオーダは全てリトルエンディアンです。

パラメータ:
initialData - 初期データ
例外:
NullPointerException -
initialDataがnullの場合に発生します。
IllegalArgumentException -
initialDataの配列長が3以下の場合に発生します。

allocateIntBuffer

public IntBuffer allocateIntBuffer(IntBuffer buff)

int単位のダイレクトメモリバッファを確保します。

処理内容はallocateByteBuffer(ByteBuffer)と同様です。

パラメータ:
buff - コピーするバッファ
例外:
NullPointerException -
buffがnullの場合に発生します。
IllegalArgumentException -
引数buffにシステムが提供しているIntBufferオブジェクト以外のオブジェクトが指定された場合に発生します。

allocateIntBuffer

public IntBuffer allocateIntBuffer(int[] initialData)

int単位のダイレクトメモリバッファを確保します。

initialDataの配列長分のメモリバッファを確保後、初期データをinitialDataに設定します。

パラメータ:
initialData - 初期データ
例外:
NullPointerException -
initialDataがnullの場合に発生します。
IllegalArgumentException -
initialDataの配列長が0以下の場合に発生します。

allocateFloatBuffer

public FloatBuffer allocateFloatBuffer(int size)

float単位のダイレクトメモリバッファを確保します。

確保されたエリアのメモリはゼロで初期化されます。

パラメータ:
size - 確保する要素数
例外:
IllegalArgumentException -
sizeが0以下の値の場合に発生します。

allocateFloatBuffer

public FloatBuffer allocateFloatBuffer(byte[] initialData)

float単位のダイレクトメモリバッファを確保します。

initialDataの配列長分のメモリバッファを確保後、初期データをinitialDataに設定します。 initialDataのサイズが4で割り切れない場合、最後のデータ(最大3バイト)は捨てられます。

本メソッドで設定した initialData は 4 バイトごとに区切られ、 それぞれが IEEE754 準拠の単精度浮動小数点数として解釈されます。 解釈された結果は、 FloatBuffer.get(int, float[], int, int) によって float 型の配列として取得することができます。 なお、解釈時のバイトオーダは端末により異なります。

現在の実装では、端末のバイトオーダは全てリトルエンディアンです。

パラメータ: public