MCPcopy Create free account
hub / github.com/brenocq/implot3d / IndexData

Function IndexData

implot3d_items.cpp:890–899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

888//-----------------------------------------------------------------------------
889
890template <typename T> IMPLOT3D_INLINE T IndexData(const T* data, int idx, int count, int offset, int stride) {
891 const int s = ((offset == 0) << 0) | ((stride == sizeof(T)) << 1);
892 switch (s) {
893 case 3: return data[idx];
894 case 2: return data[(offset + idx) % count];
895 case 1: return *(const T*)(const void*)((const unsigned char*)data + (size_t)((idx)) * stride);
896 case 0: return *(const T*)(const void*)((const unsigned char*)data + (size_t)((offset + idx) % count) * stride);
897 default: return T(0);
898 }
899}
900
901template <typename T> struct IndexerIdx {
902 IndexerIdx(const T* data, int count, int offset = 0, int stride = sizeof(T))

Callers 1

operator()Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected