NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches

Namespaces

namespace  nnl::vertexde::fmt_code
 This namespace defines constants that represent fundamental format codes.
namespace  nnl::vertexde::fmt_shift
 This namespace contains constants representing shift values that are applied to format codes to create the vertex format constants.
namespace  nnl::vertexde::fmt_mask
 This namespace contains constants representing bit masks for parts of the vertex format.

Classes

struct  nnl::vertexde::VertexLayout
 Structure representing the layout of a vertex. More...

Functions

u32 nnl::vertexde::GetThrough (u32 vertex_format)
 Retrieves the Through Mode status from the vertex format.
u32 nnl::vertexde::GetWeightFormat (u32 vertex_format)
 Retrieves the weight format code from the vertex format.
u32 nnl::vertexde::GetWeightSize (u32 vertex_format)
 Retrieves the byte size of a weight component from the vertex format.
u32 nnl::vertexde::GetWeightNum (u32 vertex_format)
 Retrieves the number of weight components from the vertex format.
u32 nnl::vertexde::GetUVFormat (u32 vertex_format)
 Retrieves the UV format code from the vertex format.
u32 nnl::vertexde::GetUVSize (u32 vertex_format)
 Retrieves the byte size of a UV component from the vertex format.
u32 nnl::vertexde::GetUVNum (u32 vertex_format)
 Retrieves the number of UV components.
u32 nnl::vertexde::GetColorFormat (u32 vertex_format)
 Retrieves the color format code from the vertex format.
u32 nnl::vertexde::GetColorSize (u32 vertex_format)
 Retrieves the byte size of a vertex color from the vertex format.
u32 nnl::vertexde::GetColorNum (u32 vertex_format)
 Retrieves the number of colors.
u32 nnl::vertexde::GetNormalFormat (u32 vertex_format)
 Retrieves the normal format code from the vertex format.
u32 nnl::vertexde::GetNormalSize (u32 vertex_format)
 Retrieves the byte size of a normal component from the vertex format.
u32 nnl::vertexde::GetNormalNum (u32 vertex_format)
 Retrieves the number of normal components from the vertex format.
u32 nnl::vertexde::GetPositionFormat (u32 vertex_format)
 Retrieves the position format code from the vertex format.
u32 nnl::vertexde::GetPositionSize (u32 vertex_format)
 Retrieves the byte size of a position component from the vertex format.
u32 nnl::vertexde::GetPositionNum (u32 vertex_format)
 Retrieves the number of position components.
u32 nnl::vertexde::GetMorphNum (u32 vertex_format)
 Retrieves the number of morph targets from the vertex format.
u32 nnl::vertexde::GetIndexFormat (u32 vertex_format)
 Retrieves the index format code from the vertex format.
u32 nnl::vertexde::GetIndexSize (u32 vertex_format)
 Retrieves the byte size of a single index from the vertex format.
bool nnl::vertexde::HasWeights (u32 vertex_format)
 Checks if the vertex format includes weight information.
bool nnl::vertexde::HasUV (u32 vertex_format)
 Checks if the vertex format includes UV information.
bool nnl::vertexde::HasColor (u32 vertex_format)
 Checks if the vertex format includes color information.
bool nnl::vertexde::HasNormal (u32 vertex_format)
 Checks if the vertex format includes normal information.
bool nnl::vertexde::HasPosition (u32 vertex_format)
 Checks if the vertex format includes position information.
bool nnl::vertexde::IsIndexed (u32 vertex_format)
 Checks if the vertex format uses indexed drawing.
bool nnl::vertexde::IsThrough (u32 vertex_format)
 Checks if the vertex format uses Through Mode (2D drawing).
bool nnl::vertexde::Is8Indices (u32 vertex_format)
 Checks if the vertex format uses 8-bit indices.
bool nnl::vertexde::Is16Indices (u32 vertex_format)
 Checks if the vertex format uses 16-bit indices.
bool nnl::vertexde::Is8Weights (u32 vertex_format)
 Checks if the vertex format uses 8-bit weights.
bool nnl::vertexde::Is16Weights (u32 vertex_format)
 Checks if the vertex format uses 16-bit weights.
bool nnl::vertexde::Is32Weights (u32 vertex_format)
 Checks if the vertex format uses float weights.
bool nnl::vertexde::IsFixedWeights (u32 vertex_format)
 Checks if the vertex format uses fixed-point weights.
bool nnl::vertexde::Is8UV (u32 vertex_format)
 Checks if the vertex format uses 8-bit UVs.
bool nnl::vertexde::Is16UV (u32 vertex_format)
 Checks if the vertex format uses 16-bit UVs.
bool nnl::vertexde::Is32UV (u32 vertex_format)
 Checks if the vertex format uses float UVs.
bool nnl::vertexde::IsFixedUV (u32 vertex_format)
 Checks if the vertex format uses fixed-point UV components.
bool nnl::vertexde::Is565Color (u32 vertex_format)
 Checks if the vertex format uses 565 vertex colors.
bool nnl::vertexde::Is5551Color (u32 vertex_format)
 Checks if the vertex format uses 5551 vertex colors.
bool nnl::vertexde::Is4444Color (u32 vertex_format)
 Checks if the vertex format uses 4444 vertex colors.
bool nnl::vertexde::Is8888Color (u32 vertex_format)
 Checks if the vertex format uses 8888 vertex colors.
bool nnl::vertexde::Is8Normal (u32 vertex_format)
 Checks if the vertex format uses 8-bit normals.
bool nnl::vertexde::Is16Normal (u32 vertex_format)
 Checks if the vertex format uses 16-bit normal components.
bool nnl::vertexde::Is32Normal (u32 vertex_format)
 Checks if the vertex format uses float normals.
bool nnl::vertexde::IsFixedNormal (u32 vertex_format)
 Checks if the vertex format uses fixed-point normals.
bool nnl::vertexde::Is8Position (u32 vertex_format)
 Checks if the vertex format uses 8-bit positions.
bool nnl::vertexde::Is16Position (u32 vertex_format)
 Checks if the vertex format uses 16-bit positions.
bool nnl::vertexde::Is32Position (u32 vertex_format)
 Checks if the vertex format uses float positions.
bool nnl::vertexde::IsFixedPosition (u32 vertex_format)
 Checks if the vertex format uses fixed-point positions.
std::string nnl::vertexde::GetDescription (u32 vertex_format)
 Generates a textual description of the vertex format.
VertexLayout nnl::vertexde::GetLayout (u32 vertex_format)
 Retrieves the layout of a vertex based on its format.

Variables

constexpr std::array< u32, 8 > nnl::vertexde::format_sizes {0, 1, 2, 4, 2, 2, 2, 4}
 Maps format codes to attribute sizes.

Detailed Description


Class Documentation

◆ nnl::vertexde::VertexLayout

struct nnl::vertexde::VertexLayout

Structure representing the layout of a vertex.

This structure holds the offsets for various components of a vertex and its total byte size. It describes a single morph target.

See also
nnl::vertexde::GetLayout
nnl::vertexde::fmt::kMorphNum

Function Documentation

◆ GetColorFormat()

u32 nnl::vertexde::GetColorFormat ( u32 vertex_format)
inline

Retrieves the color format code from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the color format.
Returns
A value representing the color format code.

◆ GetColorNum()

u32 nnl::vertexde::GetColorNum ( u32 vertex_format)
inline

Retrieves the number of colors.

Returns
The number of colors, which is always 0 or 1.

◆ GetColorSize()

u32 nnl::vertexde::GetColorSize ( u32 vertex_format)
inline

Retrieves the byte size of a vertex color from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the info.
Returns
The size of a color in bytes (0, 2, or 4).

◆ GetDescription()

std::string nnl::vertexde::GetDescription ( u32 vertex_format)

Generates a textual description of the vertex format.

This function constructs a detailed description of the given vertex format that includes information about used drawing modes and vertex attributes.

Parameters
vertex_formatThe vertex format to describe.
Returns
A string containing the description of the vertex format.

◆ GetIndexFormat()

u32 nnl::vertexde::GetIndexFormat ( u32 vertex_format)
inline

Retrieves the index format code from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the index format.
Returns
A value representing the index format code.

◆ GetIndexSize()

u32 nnl::vertexde::GetIndexSize ( u32 vertex_format)
inline

Retrieves the byte size of a single index from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the index info.
Returns
The size of an index in bytes.

◆ GetLayout()

VertexLayout nnl::vertexde::GetLayout ( u32 vertex_format)

Retrieves the layout of a vertex based on its format.

This function calculates the offsets for various components of a vertex and its total byte size. It returns a description of a single morph target.

Parameters
vertex_formatThe format of the vertex to retrieve the layout for.
Returns
A VertexLayout structure containing the offsets and total size.
Note
If a vertex attribute is missing, its corresponding offset stores the position where it would be located. To check for the presence of various attributes, the family of Has* functions can be used.

◆ GetMorphNum()

u32 nnl::vertexde::GetMorphNum ( u32 vertex_format)
inline

Retrieves the number of morph targets from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the number of morph targets.
Returns
The number of morph targets, which is a value between 1 and 8.

◆ GetNormalFormat()

u32 nnl::vertexde::GetNormalFormat ( u32 vertex_format)
inline

Retrieves the normal format code from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the normal format.
Returns
A value representing the normal format code.

◆ GetNormalNum()

u32 nnl::vertexde::GetNormalNum ( u32 vertex_format)
inline

Retrieves the number of normal components from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the number of normals.
Returns
The number of normal components, which is either 3 or 0.

◆ GetNormalSize()

u32 nnl::vertexde::GetNormalSize ( u32 vertex_format)
inline

Retrieves the byte size of a normal component from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the normal info.
Returns
The size of a single component in bytes.

◆ GetPositionFormat()

u32 nnl::vertexde::GetPositionFormat ( u32 vertex_format)
inline

Retrieves the position format code from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the position format.
Returns
A value representing the position format code.

◆ GetPositionNum()

u32 nnl::vertexde::GetPositionNum ( u32 vertex_format)
inline

Retrieves the number of position components.

Parameters
vertex_formatThe vertex format from which to extract the position info.
Returns
The number of position components, which is always 3 for valid formats.

◆ GetPositionSize()

u32 nnl::vertexde::GetPositionSize ( u32 vertex_format)
inline

Retrieves the byte size of a position component from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the position info.
Returns
The size of a single component in bytes, which is at least 1 for valid formats.

◆ GetThrough()

u32 nnl::vertexde::GetThrough ( u32 vertex_format)
inline

Retrieves the Through Mode status from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the Through Mode status.
Returns
A value indicating the status of the Through Mode (0 or 1).

◆ GetUVFormat()

u32 nnl::vertexde::GetUVFormat ( u32 vertex_format)
inline

Retrieves the UV format code from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the UV format.
Returns
A value representing the UV format code.

◆ GetUVNum()

u32 nnl::vertexde::GetUVNum ( u32 vertex_format)
inline

Retrieves the number of UV components.

Returns
The number of UV components, which is either 0 or 2.

◆ GetUVSize()

u32 nnl::vertexde::GetUVSize ( u32 vertex_format)
inline

Retrieves the byte size of a UV component from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the UV info.
Returns
The size of a single component in bytes.

◆ GetWeightFormat()

u32 nnl::vertexde::GetWeightFormat ( u32 vertex_format)
inline

Retrieves the weight format code from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the weight format.
Returns
A value representing the weight format code.

◆ GetWeightNum()

u32 nnl::vertexde::GetWeightNum ( u32 vertex_format)
inline

Retrieves the number of weight components from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the number of weights.
Returns
The number of weights, which is a value between 0 and 8.

◆ GetWeightSize()

u32 nnl::vertexde::GetWeightSize ( u32 vertex_format)
inline

Retrieves the byte size of a weight component from the vertex format.

Parameters
vertex_formatThe vertex format from which to extract the weight info.
Returns
The size of a single component in bytes.

◆ HasColor()

bool nnl::vertexde::HasColor ( u32 vertex_format)
inline

Checks if the vertex format includes color information.

Parameters
vertex_formatThe vertex format to check for color information.
Returns
True if the vertex format includes color.

◆ HasNormal()

bool nnl::vertexde::HasNormal ( u32 vertex_format)
inline

Checks if the vertex format includes normal information.

Parameters
vertex_formatThe vertex format to check for normal information.
Returns
True if the vertex format includes normals.

◆ HasPosition()

bool nnl::vertexde::HasPosition ( u32 vertex_format)
inline

Checks if the vertex format includes position information.

Parameters
vertex_formatThe vertex format to check for position information.
Returns
True if the vertex format is valid and includes positions
Note
A valid vertex format always must include positions.

◆ HasUV()

bool nnl::vertexde::HasUV ( u32 vertex_format)
inline

Checks if the vertex format includes UV information.

Parameters
vertex_formatThe vertex format to check for UV information.
Returns
True if the vertex format includes UV.

◆ HasWeights()

bool nnl::vertexde::HasWeights ( u32 vertex_format)
inline

Checks if the vertex format includes weight information.

Parameters
vertex_formatThe vertex format to check for weight information.
Returns
True if the vertex format includes weights.

◆ Is16Indices()

bool nnl::vertexde::Is16Indices ( u32 vertex_format)
inline

Checks if the vertex format uses 16-bit indices.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 16-bit indices.

◆ Is16Normal()

bool nnl::vertexde::Is16Normal ( u32 vertex_format)
inline

Checks if the vertex format uses 16-bit normal components.

This function determines whether the provided vertex format is configured to use signed 16-bit fixed-point numbers for normal components.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses signed 16-bit normal components.

◆ Is16Position()

bool nnl::vertexde::Is16Position ( u32 vertex_format)
inline

Checks if the vertex format uses 16-bit positions.

This function determines whether the provided vertex format is configured to use signed 16-bit fixed-point numbers for position components.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 16-bit positions.

◆ Is16UV()

bool nnl::vertexde::Is16UV ( u32 vertex_format)
inline

Checks if the vertex format uses 16-bit UVs.

This function determines whether the provided vertex format is configured to use unsigned 16-bit fixed-point numbers for UV components.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 16-bit UV components.

◆ Is16Weights()

bool nnl::vertexde::Is16Weights ( u32 vertex_format)
inline

Checks if the vertex format uses 16-bit weights.

This function determines whether the provided vertex format is configured to use unsigned 16-bit fixed-point numbers for weights.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 16-bit weights.

◆ Is32Normal()

bool nnl::vertexde::Is32Normal ( u32 vertex_format)
inline

Checks if the vertex format uses float normals.

This function determines whether the provided vertex format is configured to use float numbers for normal components.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses float normals.

◆ Is32Position()

bool nnl::vertexde::Is32Position ( u32 vertex_format)
inline

Checks if the vertex format uses float positions.

This function determines whether the provided vertex format is configured to use float numbers for position components.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses float positions.

◆ Is32UV()

bool nnl::vertexde::Is32UV ( u32 vertex_format)
inline

Checks if the vertex format uses float UVs.

This function determines whether the provided vertex format is configured to use float numbers for UVs.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses float UV components.

◆ Is32Weights()

bool nnl::vertexde::Is32Weights ( u32 vertex_format)
inline

Checks if the vertex format uses float weights.

This function determines whether the provided vertex format is configured to use float numbers for weights.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses float weights.

◆ Is4444Color()

bool nnl::vertexde::Is4444Color ( u32 vertex_format)
inline

Checks if the vertex format uses 4444 vertex colors.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 4444 vertex colors.

◆ Is5551Color()

bool nnl::vertexde::Is5551Color ( u32 vertex_format)
inline

Checks if the vertex format uses 5551 vertex colors.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 5551 vertex colors.

◆ Is565Color()

bool nnl::vertexde::Is565Color ( u32 vertex_format)
inline

Checks if the vertex format uses 565 vertex colors.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 565 vertex colors.

◆ Is8888Color()

bool nnl::vertexde::Is8888Color ( u32 vertex_format)
inline

Checks if the vertex format uses 8888 vertex colors.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 8888 vertex colors.

◆ Is8Indices()

bool nnl::vertexde::Is8Indices ( u32 vertex_format)
inline

Checks if the vertex format uses 8-bit indices.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 8-bit indices.

◆ Is8Normal()

bool nnl::vertexde::Is8Normal ( u32 vertex_format)
inline

Checks if the vertex format uses 8-bit normals.

This function determines whether the provided vertex format is configured to use signed 8-bit fixed-point numbers for normal components.

Parameters
vertex_formatThe vertex format to check for 8-bit normal information.
Returns
True if the vertex format uses 8-bit normals.

◆ Is8Position()

bool nnl::vertexde::Is8Position ( u32 vertex_format)
inline

Checks if the vertex format uses 8-bit positions.

This function determines whether the provided vertex format is configured to use signed 8-bit fixed-point numbers for position components.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 8-bit positions.

◆ Is8UV()

bool nnl::vertexde::Is8UV ( u32 vertex_format)
inline

Checks if the vertex format uses 8-bit UVs.

This function determines whether the provided vertex format is configured to use unsigned 8-bit fixed-point numbers for UV components.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 8-bit UV components.

◆ Is8Weights()

bool nnl::vertexde::Is8Weights ( u32 vertex_format)
inline

Checks if the vertex format uses 8-bit weights.

This function determines whether the provided vertex format is configured to use unsigned 8-bit fixed-point numbers for weights.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 8-bit weights.

◆ IsFixedNormal()

bool nnl::vertexde::IsFixedNormal ( u32 vertex_format)
inline

Checks if the vertex format uses fixed-point normals.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 8 or 16 bit fixed-point normal components.

◆ IsFixedPosition()

bool nnl::vertexde::IsFixedPosition ( u32 vertex_format)
inline

Checks if the vertex format uses fixed-point positions.

This function checks if the vertex format is configured to use signed 8 or 16 bit fixed-point position components.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 8 or 16 bit fixed-point positions.

◆ IsFixedUV()

bool nnl::vertexde::IsFixedUV ( u32 vertex_format)
inline

Checks if the vertex format uses fixed-point UV components.

This function checks if the vertex format is configured to use unsigned 8 or 16 bit fixed-point UV components.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses 8 or 16 bit fixed-point UVs.

◆ IsFixedWeights()

bool nnl::vertexde::IsFixedWeights ( u32 vertex_format)
inline

Checks if the vertex format uses fixed-point weights.

This function determines whether the provided vertex format is configured to use unsigned 8 or 16 bit fixed-point numbers for weights.

Parameters
vertex_formatThe vertex format to check.
Returns
True if the vertex format uses fixed-point weights (8 or 16 bits).

◆ IsIndexed()

bool nnl::vertexde::IsIndexed ( u32 vertex_format)
inline

Checks if the vertex format uses indexed drawing.

Parameters
vertex_formatThe vertex format to check for index information.
Returns
True if the vertex format uses indexed drawing; otherwise, false.
See also
nnl::vertexde::fmt::kIndex16

◆ IsThrough()

bool nnl::vertexde::IsThrough ( u32 vertex_format)
inline

Checks if the vertex format uses Through Mode (2D drawing).

Parameters
vertex_formatThe vertex format to check for index information.
Returns
True if the vertex format uses indexed drawing; otherwise, false.
See also
nnl::vertexde::fmt::kThrough

Variable Documentation

◆ format_sizes

std::array<u32, 8> nnl::vertexde::format_sizes {0, 1, 2, 4, 2, 2, 2, 4}
constexpr

Maps format codes to attribute sizes.

See also
nnl::vertexde::fmt_code