Top Description Inners Fields Constructors Methods
org.lwjgl.assimp

public Class AITexture

extends Struct<AITexture>
Class Inheritance
Annotations
@NativeType:struct aiTexture
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

Helper structure to describe an embedded texture.

Normally textures are contained in external files but some file formats embed them directly in the model file. There are two types of embedded textures:

The raw file bytes are given so the application must utilize an image decoder (e.g. DevIL) to get access to the actual color data.

Embedded textures are referenced from materials using strings like "*0", "*1", etc. as the texture paths (a single asterisk character followed by the zero-based index of the texture in the AIScene::mTextures array).

Layout


struct aiTexture {
    unsigned int mWidth;
    unsigned int mHeight;
    char achFormatHint[9];
    struct aiTexel * pcData;
    struct aiString mFilename;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AITexture.Buffer

An array of AITexture structs.

Field Summary

Modifier and TypeField and Description
public static final int
ACHFORMATHINT

The struct member offsets.

public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
MFILENAME

The struct member offsets.

public static final int
MHEIGHT

The struct member offsets.

public static final int
MWIDTH

The struct member offsets.

public static final int
PCDATA

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
AITexture(long address, ByteBuffer container)

public
AITexture(ByteBuffer container)

Creates a AITexture instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer
achFormatHint()

A hint from the loader to make it easier for applications to determine the type of embedded textures.

public String
achFormatHintString()

A hint from the loader to make it easier for applications to determine the type of embedded textures.

protected AITexture
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static AITexture
create(long address)

Returns a new AITexture instance for the specified memory address.

public static AITexture.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a AITexture.Buffer instance at the specified memory.

public static AITexture
createSafe(long address)

Like create, but returns null if address is NULL.

public static AITexture.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public AIString
mFilename()

texture original filename.

public int
mHeight()

Height of the texture, in pixels.

public int
mWidth()

Width of the texture, in pixels.

public static ByteBuffer
nachFormatHint(long struct)

Unsafe version of achFormatHint.

public static String
nachFormatHintString(long struct)

Unsafe version of achFormatHintString.

public static AIString
nmFilename(long struct)

Unsafe version of mFilename.

public static int
nmHeight(long struct)

Unsafe version of mHeight.

public static int
nmWidth(long struct)

Unsafe version of mWidth.

public static AITexel.Buffer
npcData(long struct)

Unsafe version of pcData.

public static ByteBuffer
npcDataCompressed(long struct)

Unsafe version of pcDataCompressed.

public AITexel.Buffer
pcData()

Data of the texture.

public ByteBuffer
pcDataCompressed()

Returns a char * view of the array pointed to by the pcData field.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ACHFORMATHINTback to summary
public static final int ACHFORMATHINT

The struct member offsets.

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

MFILENAMEback to summary
public static final int MFILENAME

The struct member offsets.

MHEIGHTback to summary
public static final int MHEIGHT

The struct member offsets.

MWIDTHback to summary
public static final int MWIDTH

The struct member offsets.

PCDATAback to summary
public static final int PCDATA

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

Constructor Detail

AITextureback to summary
protected AITexture(long address, ByteBuffer container)
AITextureback to summary
public AITexture(ByteBuffer container)

Creates a AITexture instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

The created instance holds a strong reference to the container object.

Method Detail

achFormatHintback to summary
public ByteBuffer achFormatHint()

A hint from the loader to make it easier for applications to determine the type of embedded textures.

If mHeight != 0 this member is show how data is packed. Hint will consist of two parts: channel order and channel bitness (count of the bits for every color channel). For simple parsing by the viewer it's better to not omit absent color channel and just use 0 for bitness. For example:

  1. Image contain RGBA and 8 bit per channel, achFormatHint == "rgba8888";
  2. Image contain ARGB and 8 bit per channel, achFormatHint == "argb8888";
  3. Image contain RGB and 5 bit for R and B channels and 6 bit for G channel, achFormatHint == "rgba5650";
  4. One color image with B channel and 1 bit for it, achFormatHint == "rgba0010";

If mHeight == 0 then achFormatHint is set set to '\0\0\0\0' if the loader has no additional information about the texture file format used OR the file extension of the format without a trailing dot. If there are multiple file extensions for a format, the shortest extension is chosen (JPEG maps to 'jpg', not to 'jpeg'). E.g. 'dds\0', 'pcx\0', 'jpg\0'. All characters are lower-case. The fourth character will always be '\0'.

Annotations
@NativeType:char[9]
achFormatHintStringback to summary
public String achFormatHintString()

A hint from the loader to make it easier for applications to determine the type of embedded textures.

If mHeight != 0 this member is show how data is packed. Hint will consist of two parts: channel order and channel bitness (count of the bits for every color channel). For simple parsing by the viewer it's better to not omit absent color channel and just use 0 for bitness. For example:

  1. Image contain RGBA and 8 bit per channel, achFormatHint == "rgba8888";
  2. Image contain ARGB and 8 bit per channel, achFormatHint == "argb8888";
  3. Image contain RGB and 5 bit for R and B channels and 6 bit for G channel, achFormatHint == "rgba5650";
  4. One color image with B channel and 1 bit for it, achFormatHint == "rgba0010";

If mHeight == 0 then achFormatHint is set set to '\0\0\0\0' if the loader has no additional information about the texture file format used OR the file extension of the format without a trailing dot. If there are multiple file extensions for a format, the shortest extension is chosen (JPEG maps to 'jpg', not to 'jpeg'). E.g. 'dds\0', 'pcx\0', 'jpg\0'. All characters are lower-case. The fourth character will always be '\0'.

Annotations
@NativeType:char[9]
createback to summary
protected AITexture create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static AITexture create(long address)

Returns a new AITexture instance for the specified memory address.

createback to summary
public static AITexture.Buffer create(long address, int capacity)

Create a AITexture.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static AITexture createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
createSafeback to summary
public static AITexture.Buffer createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

Annotations
@Nullable
mFilenameback to summary
public AIString mFilename()

texture original filename. Used to get the texture reference.

Annotations
@NativeType:struct aiString
mHeightback to summary
public int mHeight()

Height of the texture, in pixels. If this value is zero, pcData points to an compressed texture in any format (e.g. JPEG).

Annotations
@NativeType:unsigned int
mWidthback to summary
public int mWidth()

Width of the texture, in pixels. If mHeight is zero the texture is compressed in a format like JPEG. In this case mWidth specifies the size of the memory area pcData is pointing to, in bytes.

Annotations
@NativeType:unsigned int
nachFormatHintback to summary
public static ByteBuffer nachFormatHint(long struct)

Unsafe version of achFormatHint.

nachFormatHintStringback to summary
public static String nachFormatHintString(long struct)

Unsafe version of achFormatHintString.

nmFilenameback to summary
public static AIString nmFilename(long struct)

Unsafe version of mFilename.

nmHeightback to summary
public static int nmHeight(long struct)

Unsafe version of mHeight.

nmWidthback to summary
public static int nmWidth(long struct)

Unsafe version of mWidth.

npcDataback to summary
public static AITexel.Buffer npcData(long struct)

Unsafe version of pcData.

npcDataCompressedback to summary
public static ByteBuffer npcDataCompressed(long struct)

Unsafe version of pcDataCompressed.

pcDataback to summary
public AITexel.Buffer pcData()

Data of the texture.

Points to an array of mWidth * mHeight AITexel's. The format of the texture data is always ARGB8888 to make the implementation for user of the library as easy as possible. If mHeight = 0 this is a pointer to a memory buffer of size mWidth containing the compressed texture data. Good luck, have fun!

Annotations
@NativeType:struct aiTexel *
pcDataCompressedback to summary
public ByteBuffer pcDataCompressed()

Returns a char * view of the array pointed to by the pcData field.

Annotations
@NativeType:char *
sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
org.lwjgl.assimp back to summary

public Class AITexture.Buffer

extends StructBuffer<AITexture, AITexture.Buffer>
Class Inheritance

An array of AITexture structs.

Field Summary

Modifier and TypeField and Description
private static final AITexture

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new AITexture.Buffer instance backed by the specified container.

public
Buffer(long address, int cap)

pack-priv
Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer

Returns:

a ByteBuffer view of the AITexture#achFormatHint field.
achFormatHint
()

public String

Returns:

the null-terminated string stored in the AITexture#achFormatHint field.
achFormatHintString
()

protected AITexture
public AIString

Returns:

a AIString view of the AITexture#mFilename field.
mFilename
()

public int

Returns:

the value of the AITexture#mHeight field.
mHeight
()

public int

Returns:

the value of the AITexture#mWidth field.
mWidth
()

public AITexel.Buffer

Returns:

a AITexel.Buffer view of the struct array pointed to by the AITexture#pcData field.
pcData
()

public ByteBuffer
pcDataCompressed()

Returns a char * view of the array pointed to by the pcData field.

protected AITexture.Buffer
Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final AITexture ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new AITexture.Buffer instance backed by the specified container.

Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by AITexture#SIZEOF, and its mark will be undefined.

The created buffer instance holds a strong reference to the container object.

Bufferback to summary
public Buffer(long address, int cap)
Bufferback to summary
pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Detail

achFormatHintback to summary
public ByteBuffer achFormatHint()
Returns:ByteBuffer

a ByteBuffer view of the AITexture#achFormatHint field.

Annotations
@NativeType:char[9]
achFormatHintStringback to summary
public String achFormatHintString()
Returns:String

the null-terminated string stored in the AITexture#achFormatHint field.

Annotations
@NativeType:char[9]
getElementFactoryback to summary
protected AITexture getElementFactory()

Implements abstract org.lwjgl.system.StructBuffer.getElementFactory.

Annotations
@Override
mFilenameback to summary
public AIString mFilename()
Returns:AIString

a AIString view of the AITexture#mFilename field.

Annotations
@NativeType:struct aiString
mHeightback to summary
public int mHeight()
Returns:int

the value of the AITexture#mHeight field.

Annotations
@NativeType:unsigned int
mWidthback to summary
public int mWidth()
Returns:int

the value of the AITexture#mWidth field.

Annotations
@NativeType:unsigned int
pcDataback to summary
public AITexel.Buffer pcData()
Returns:AITexel.Buffer

a AITexel.Buffer view of the struct array pointed to by the AITexture#pcData field.

Annotations
@NativeType:struct aiTexel *
pcDataCompressedback to summary
public ByteBuffer pcDataCompressed()

Returns a char * view of the array pointed to by the pcData field.

Annotations
@NativeType:char *
selfback to summary
protected AITexture.Buffer self()

Implements abstract org.lwjgl.system.CustomBuffer.self.

Annotations
@Override