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>

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 signed char 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)
 
MRC_API MR_RectIndexerMR_RectIndexer_OffsetMutablePtr (MR_RectIndexer *ptr, ptrdiff_t i)
 
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 int *expansion)
 
MRC_API void MR_shrinkPixelMask (MR_PixelBitSet *mask, const MR_RectIndexer *indexer, const int *shrinkage)
 

Typedef Documentation

◆ MR_DistanceMap

◆ MR_Matrix_float

◆ MR_OutEdge2

typedef signed char 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> Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).

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 int * 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 method MR::RectIndexer::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 method MR::RectIndexer::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 method MR::RectIndexer::operator=. Parameter _this can not be null. It is a single object. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in this object. The returned pointer will never be null. It is non-owning, do NOT destroy it. When this function is called, this object will drop any object references it had previously.

◆ MR_RectIndexer_Construct()

MRC_API MR_RectIndexer * MR_RectIndexer_Construct ( const MR_Vector2i * dims)

Generated from constructor MR::RectIndexer::RectIndexer. Parameter dims can not be null. It is a single object. The reference to the parameter dims might be preserved in the constructed 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 constructor MR::RectIndexer::RectIndexer. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed 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 method MR::RectIndexer::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 method MR::RectIndexer::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 method MR::RectIndexer::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. The reference to the parameter object might be preserved in the return value.

◆ 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. The reference to the parameter object might be preserved in the return value.

◆ 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. The reference to the parameter ptr might be preserved in the return value.

◆ 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. The reference to the parameter ptr might be preserved in the return value.

◆ MR_RectIndexer_resize()

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

Generated from method MR::RectIndexer::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 method MR::RectIndexer::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. The reference to the parameter object might be preserved in the return value.

◆ 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. The reference to the parameter object might be preserved in the return value.

◆ MR_RectIndexer_toIndex()

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

Generated from method MR::RectIndexer::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 method MR::RectIndexer::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 method MR::RectIndexer::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 method MR::RectIndexer::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 int * 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.