| 888 | //----------------------------------------------------------------------------- |
| 889 | |
| 890 | template <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 | |
| 901 | template <typename T> struct IndexerIdx { |
| 902 | IndexerIdx(const T* data, int count, int offset = 0, int stride = sizeof(T)) |