MeshLib C Docs
Loading...
Searching...
No Matches
MRTextureColors.h File Reference
#include <MRCMesh/MRColor.h>
#include <MRCMesh/MRId.h>
#include <MRCMisc/exports.h>

Go to the source code of this file.

Typedefs

typedef struct MR_Mesh MR_Mesh
 
typedef struct MR_MeshTexture MR_MeshTexture
 
typedef struct MR_MeshTopology MR_MeshTopology
 
typedef struct MR_TriCornerUVCoords MR_TriCornerUVCoords
 
typedef struct MR_VertColors MR_VertColors
 
typedef struct MR_std_optional_MR_Vector2f MR_std_optional_MR_Vector2f
 
typedef struct MR_std_optional_MR_VertCoords2 MR_std_optional_MR_VertCoords2
 

Functions

MRC_API MR_std_optional_MR_Vector2fMR_findVertexUV (const MR_MeshTopology *topology, MR_VertId v, const MR_TriCornerUVCoords *triCornerUvCoords)
 
MRC_API MR_std_optional_MR_VertCoords2MR_findVertexUVs (const MR_MeshTopology *topology, const MR_TriCornerUVCoords *triCornerUvCoords)
 
MRC_API MR_Color MR_sampleVertexColor (const MR_Mesh *mesh, MR_VertId v, const MR_MeshTexture *tex, const MR_TriCornerUVCoords *triCornerUvCoords)
 
MRC_API MR_VertColorsMR_sampleVertexColors (const MR_Mesh *mesh, const MR_MeshTexture *tex, const MR_TriCornerUVCoords *triCornerUvCoords)
 

Typedef Documentation

◆ MR_Mesh

typedef struct MR_Mesh MR_Mesh

◆ MR_MeshTexture

◆ MR_MeshTopology

◆ MR_std_optional_MR_Vector2f

◆ MR_std_optional_MR_VertCoords2

◆ MR_TriCornerUVCoords

◆ MR_VertColors

typedef struct MR_VertColors MR_VertColors

Function Documentation

◆ MR_findVertexUV()

MRC_API MR_std_optional_MR_Vector2f * MR_findVertexUV ( const MR_MeshTopology * topology,
MR_VertId v,
const MR_TriCornerUVCoords * triCornerUvCoords )

returns UV-coordinates at the given vertex if they are the same in all surrounding triangles; otherwise returns std::nullopt Generated from function MR::findVertexUV. Parameter topology can not be null. It is a single object. Parameter triCornerUvCoords can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_optional_MR_Vector2f_Destroy() to free it when you're done using it.

◆ MR_findVertexUVs()

MRC_API MR_std_optional_MR_VertCoords2 * MR_findVertexUVs ( const MR_MeshTopology * topology,
const MR_TriCornerUVCoords * triCornerUvCoords )

if all mesh vertices have unique UV-coordinates in all triangles, then returns them; otherwise returns std::nullopt Generated from function MR::findVertexUVs. Parameter topology can not be null. It is a single object. Parameter triCornerUvCoords can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_optional_MR_VertCoords2_Destroy() to free it when you're done using it.

◆ MR_sampleVertexColor()

MRC_API MR_Color MR_sampleVertexColor ( const MR_Mesh * mesh,
MR_VertId v,
const MR_MeshTexture * tex,
const MR_TriCornerUVCoords * triCornerUvCoords )

computes the color in the given vertex of mesh textured per-triangle's-corner; if the vertex has different colors in different triangles, then angle-weight average is computed Generated from function MR::sampleVertexColor. Parameter mesh can not be null. It is a single object. Parameter tex can not be null. It is a single object. Parameter triCornerUvCoords can not be null. It is a single object.

◆ MR_sampleVertexColors()

MRC_API MR_VertColors * MR_sampleVertexColors ( const MR_Mesh * mesh,
const MR_MeshTexture * tex,
const MR_TriCornerUVCoords * triCornerUvCoords )

computes the colors in the vertices of mesh textured per-triangle's-corner; if one vertex has different colors in different triangles, then angle-weight average is computed Generated from function MR::sampleVertexColors. Parameter mesh can not be null. It is a single object. Parameter tex can not be null. It is a single object. Parameter triCornerUvCoords can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_VertColors_Destroy() to free it when you're done using it.