MeshLib C Docs
Loading...
Searching...
No Matches
MRRectIndexer.h File Reference
#include <MRCMesh/MRId.h>
#include <MRCMesh/MRVector2.h>
#include <MRCMisc/common.h>
#include <MRCMisc/exports.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Typedefs

typedef struct MR_DistanceMap MR_DistanceMap
 
typedef struct MR_Matrix_float MR_Matrix_float
 
typedef struct MR_PixelBitSet MR_PixelBitSet
 
typedef int8_t MR_OutEdge2
 
typedef struct MR_RectIndexer MR_RectIndexer
 

Enumerations

enum  {
  MR_OutEdge2_Invalid = -1 , MR_OutEdge2_PlusY = 0 , MR_OutEdge2_MinusY = 1 , MR_OutEdge2_PlusX = 2 ,
  MR_OutEdge2_MinusX = 3 , MR_OutEdge2_Count = 4
}
 

Functions

MRC_API MR_OutEdge2 MR_opposite_MR_OutEdge2 (MR_OutEdge2 e)
 Generated from function MR::opposite.
 
MRC_API MR_RectIndexerMR_RectIndexer_DefaultConstruct (void)
 
MRC_API MR_RectIndexerMR_RectIndexer_DefaultConstructArray (size_t num_elems)
 
MRC_API const MR_RectIndexerMR_RectIndexer_OffsetPtr (const MR_RectIndexer *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API MR_RectIndexerMR_RectIndexer_OffsetMutablePtr (MR_RectIndexer *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API const MR_DistanceMapMR_RectIndexer_StaticDowncastTo_MR_DistanceMap (const MR_RectIndexer *object)
 
MRC_API MR_DistanceMapMR_RectIndexer_MutableStaticDowncastTo_MR_DistanceMap (MR_RectIndexer *object)
 
MRC_API const MR_Matrix_floatMR_RectIndexer_StaticDowncastTo_MR_Matrix_float (const MR_RectIndexer *object)
 
MRC_API MR_Matrix_floatMR_RectIndexer_MutableStaticDowncastTo_MR_Matrix_float (MR_RectIndexer *object)
 
MRC_API MR_RectIndexerMR_RectIndexer_ConstructFromAnother (const MR_RectIndexer *_other)
 
MRC_API MR_RectIndexerMR_RectIndexer_Construct (const MR_Vector2i *dims)
 
MRC_API void MR_RectIndexer_Destroy (const MR_RectIndexer *_this)
 Destroys a heap-allocated instance of MR_RectIndexer. Does nothing if the pointer is null.
 
MRC_API void MR_RectIndexer_DestroyArray (const MR_RectIndexer *_this)
 Destroys a heap-allocated array of MR_RectIndexer. Does nothing if the pointer is null.
 
MRC_API MR_RectIndexerMR_RectIndexer_AssignFromAnother (MR_RectIndexer *_this, const MR_RectIndexer *_other)
 
MRC_API void MR_RectIndexer_resize (MR_RectIndexer *_this, const MR_Vector2i *dims)
 
MRC_API const MR_Vector2iMR_RectIndexer_dims (const MR_RectIndexer *_this)
 
MRC_API MR_uint64_t MR_RectIndexer_size (const MR_RectIndexer *_this)
 
MRC_API MR_Vector2i MR_RectIndexer_toPos_MR_PixelId (const MR_RectIndexer *_this, MR_PixelId id)
 
MRC_API MR_Vector2i MR_RectIndexer_toPos_uint64_t (const MR_RectIndexer *_this, MR_uint64_t id)
 
MRC_API MR_PixelId MR_RectIndexer_toPixelId (const MR_RectIndexer *_this, const MR_Vector2i *pos)
 
MRC_API MR_uint64_t MR_RectIndexer_toIndex (const MR_RectIndexer *_this, const MR_Vector2i *pos)
 
MRC_API bool MR_RectIndexer_areNeigbors_MR_PixelId (const MR_RectIndexer *_this, MR_PixelId v0, MR_PixelId v1)
 
MRC_API bool MR_RectIndexer_areNeigbors_MR_Vector2i (const MR_RectIndexer *_this, const MR_Vector2i *pos0, const MR_Vector2i *pos1)
 
MRC_API MR_PixelId MR_RectIndexer_getNeighbor_2 (const MR_RectIndexer *_this, MR_PixelId v, MR_OutEdge2 toNei)
 
MRC_API MR_PixelId MR_RectIndexer_getNeighbor_3 (const MR_RectIndexer *_this, MR_PixelId v, const MR_Vector2i *pos, MR_OutEdge2 toNei)
 
MRC_API void MR_expandPixelMask (MR_PixelBitSet *mask, const MR_RectIndexer *indexer, const int32_t *expansion)
 
MRC_API void MR_shrinkPixelMask (MR_PixelBitSet *mask, const MR_RectIndexer *indexer, const int32_t *shrinkage)
 

Typedef Documentation

◆ MR_DistanceMap

◆ MR_Matrix_float

◆ MR_OutEdge2

typedef int8_t MR_OutEdge2

◆ MR_PixelBitSet

◆ MR_RectIndexer

a class for converting 2D integer coordinates into 1D linear coordinates and backward Generated from class MR::RectIndexer. Derived classes: Direct: (non-virtual) MR::DistanceMap MR::Matrix<float>

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MR_OutEdge2_Invalid 
MR_OutEdge2_PlusY 
MR_OutEdge2_MinusY 
MR_OutEdge2_PlusX 
MR_OutEdge2_MinusX 
MR_OutEdge2_Count 

Function Documentation

◆ MR_expandPixelMask()

MRC_API void MR_expandPixelMask ( MR_PixelBitSet * mask,
const MR_RectIndexer * indexer,
const int32_t * expansion )

expands PixelBitSet with given number of steps Generated from function MR::expandPixelMask. Parameter mask can not be null. It is a single object. Parameter indexer can not be null. It is a single object. Parameter expansion has a default argument: 1, pass a null pointer to use it.

◆ MR_opposite_MR_OutEdge2()

MRC_API MR_OutEdge2 MR_opposite_MR_OutEdge2 ( MR_OutEdge2 e)

Generated from function MR::opposite.

◆ MR_RectIndexer_areNeigbors_MR_PixelId()

MRC_API bool MR_RectIndexer_areNeigbors_MR_PixelId ( const MR_RectIndexer * _this,
MR_PixelId v0,
MR_PixelId v1 )

returns true if v1 is within at most 4 neighbors of v0 Generated from a method of class MR::RectIndexer named areNeigbors. Parameter _this can not be null. It is a single object.

◆ MR_RectIndexer_areNeigbors_MR_Vector2i()

MRC_API bool MR_RectIndexer_areNeigbors_MR_Vector2i ( const MR_RectIndexer * _this,
const MR_Vector2i * pos0,
const MR_Vector2i * pos1 )

Generated from a method of class MR::RectIndexer named areNeigbors. Parameter _this can not be null. It is a single object. Parameter pos0 can not be null. It is a single object. Parameter pos1 can not be null. It is a single object.

◆ MR_RectIndexer_AssignFromAnother()

MRC_API MR_RectIndexer * MR_RectIndexer_AssignFromAnother ( MR_RectIndexer * _this,
const MR_RectIndexer * _other )

Generated from a method of class MR::RectIndexer named operator=. Parameter _this can not be null. It is a single object. Parameter _other can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_RectIndexer_Construct()

MRC_API MR_RectIndexer * MR_RectIndexer_Construct ( const MR_Vector2i * dims)

Generated from a constructor of class MR::RectIndexer. Parameter dims can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_RectIndexer_Destroy() to free it when you're done using it.

◆ MR_RectIndexer_ConstructFromAnother()

MRC_API MR_RectIndexer * MR_RectIndexer_ConstructFromAnother ( const MR_RectIndexer * _other)

Generated from a constructor of class MR::RectIndexer. Parameter _other can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_RectIndexer_Destroy() to free it when you're done using it.

◆ MR_RectIndexer_DefaultConstruct()

MRC_API MR_RectIndexer * MR_RectIndexer_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_RectIndexer_Destroy() to free it when you're done using it.

◆ MR_RectIndexer_DefaultConstructArray()

MRC_API MR_RectIndexer * MR_RectIndexer_DefaultConstructArray ( size_t num_elems)

Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_RectIndexer_DestroyArray(). Use MR_RectIndexer_OffsetMutablePtr() and MR_RectIndexer_OffsetPtr() to access the array elements.

◆ MR_RectIndexer_Destroy()

MRC_API void MR_RectIndexer_Destroy ( const MR_RectIndexer * _this)

Destroys a heap-allocated instance of MR_RectIndexer. Does nothing if the pointer is null.

◆ MR_RectIndexer_DestroyArray()

MRC_API void MR_RectIndexer_DestroyArray ( const MR_RectIndexer * _this)

Destroys a heap-allocated array of MR_RectIndexer. Does nothing if the pointer is null.

◆ MR_RectIndexer_dims()

MRC_API const MR_Vector2i * MR_RectIndexer_dims ( const MR_RectIndexer * _this)

Generated from a method of class MR::RectIndexer named dims. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_RectIndexer_getNeighbor_2()

MRC_API MR_PixelId MR_RectIndexer_getNeighbor_2 ( const MR_RectIndexer * _this,
MR_PixelId v,
MR_OutEdge2 toNei )

returns id of v's neighbor specified by the edge Generated from a method of class MR::RectIndexer named getNeighbor. Parameter _this can not be null. It is a single object.

◆ MR_RectIndexer_getNeighbor_3()

MRC_API MR_PixelId MR_RectIndexer_getNeighbor_3 ( const MR_RectIndexer * _this,
MR_PixelId v,
const MR_Vector2i * pos,
MR_OutEdge2 toNei )

Generated from a method of class MR::RectIndexer named getNeighbor. Parameter _this can not be null. It is a single object. Parameter pos can not be null. It is a single object.

◆ MR_RectIndexer_MutableStaticDowncastTo_MR_DistanceMap()

MRC_API MR_DistanceMap * MR_RectIndexer_MutableStaticDowncastTo_MR_DistanceMap ( MR_RectIndexer * object)

Downcasts an instance of MR::RectIndexer to a derived class MR::DistanceMap. This is a static downcast, it trusts the programmer that the target type is correct. Results in UB and returns an invalid pointer otherwise.

◆ MR_RectIndexer_MutableStaticDowncastTo_MR_Matrix_float()

MRC_API MR_Matrix_float * MR_RectIndexer_MutableStaticDowncastTo_MR_Matrix_float ( MR_RectIndexer * object)

Downcasts an instance of MR::RectIndexer to a derived class MR::Matrix<float>. This is a static downcast, it trusts the programmer that the target type is correct. Results in UB and returns an invalid pointer otherwise.

◆ MR_RectIndexer_OffsetMutablePtr()

MRC_API MR_RectIndexer * MR_RectIndexer_OffsetMutablePtr ( MR_RectIndexer * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.

◆ MR_RectIndexer_OffsetPtr()

MRC_API const MR_RectIndexer * MR_RectIndexer_OffsetPtr ( const MR_RectIndexer * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.

◆ MR_RectIndexer_resize()

MRC_API void MR_RectIndexer_resize ( MR_RectIndexer * _this,
const MR_Vector2i * dims )

Generated from a method of class MR::RectIndexer named resize. Parameter _this can not be null. It is a single object. Parameter dims can not be null. It is a single object.

◆ MR_RectIndexer_size()

MRC_API MR_uint64_t MR_RectIndexer_size ( const MR_RectIndexer * _this)

Generated from a method of class MR::RectIndexer named size. Parameter _this can not be null. It is a single object.

◆ MR_RectIndexer_StaticDowncastTo_MR_DistanceMap()

MRC_API const MR_DistanceMap * MR_RectIndexer_StaticDowncastTo_MR_DistanceMap ( const MR_RectIndexer * object)

Downcasts an instance of MR::RectIndexer to a derived class MR::DistanceMap. This is a static downcast, it trusts the programmer that the target type is correct. Results in UB and returns an invalid pointer otherwise. This version is acting on mutable pointers.

◆ MR_RectIndexer_StaticDowncastTo_MR_Matrix_float()

MRC_API const MR_Matrix_float * MR_RectIndexer_StaticDowncastTo_MR_Matrix_float ( const MR_RectIndexer * object)

Downcasts an instance of MR::RectIndexer to a derived class MR::Matrix<float>. This is a static downcast, it trusts the programmer that the target type is correct. Results in UB and returns an invalid pointer otherwise. This version is acting on mutable pointers.

◆ MR_RectIndexer_toIndex()

MRC_API MR_uint64_t MR_RectIndexer_toIndex ( const MR_RectIndexer * _this,
const MR_Vector2i * pos )

Generated from a method of class MR::RectIndexer named toIndex. Parameter _this can not be null. It is a single object. Parameter pos can not be null. It is a single object.

◆ MR_RectIndexer_toPixelId()

MRC_API MR_PixelId MR_RectIndexer_toPixelId ( const MR_RectIndexer * _this,
const MR_Vector2i * pos )

Generated from a method of class MR::RectIndexer named toPixelId. Parameter _this can not be null. It is a single object. Parameter pos can not be null. It is a single object.

◆ MR_RectIndexer_toPos_MR_PixelId()

MRC_API MR_Vector2i MR_RectIndexer_toPos_MR_PixelId ( const MR_RectIndexer * _this,
MR_PixelId id )

Generated from a method of class MR::RectIndexer named toPos. Parameter _this can not be null. It is a single object.

◆ MR_RectIndexer_toPos_uint64_t()

MRC_API MR_Vector2i MR_RectIndexer_toPos_uint64_t ( const MR_RectIndexer * _this,
MR_uint64_t id )

Generated from a method of class MR::RectIndexer named toPos. Parameter _this can not be null. It is a single object.

◆ MR_shrinkPixelMask()

MRC_API void MR_shrinkPixelMask ( MR_PixelBitSet * mask,
const MR_RectIndexer * indexer,
const int32_t * shrinkage )

shrinks PixelBitSet with given number of steps Generated from function MR::shrinkPixelMask. Parameter mask can not be null. It is a single object. Parameter indexer can not be null. It is a single object. Parameter shrinkage has a default argument: 1, pass a null pointer to use it.