21 #ifndef FASTUIDRAW_C_ARRAY_HPP 22 #define FASTUIDRAW_C_ARRAY_HPP 138 template<
typename U,
size_type N>
151 template<
typename U,
size_type N>
179 m_size(R.m_end - R.m_begin),
180 m_ptr((m_size > 0) ? &*R.m_begin : nullptr)
205 size_type num_bytes(
size() *
sizeof(T));
207 ptr =
reinterpret_cast<S*
>(
c_ptr());
208 return c_array<S>(ptr, num_bytes /
sizeof(S));
222 ptr =
const_cast<S*
>(
c_ptr());
254 return m_ptr + m_size;
328 return (*
this)[
size() - 1 - I];
337 return (*
this)[
size() - 1];
363 return c_array(m_ptr + pos, length);
380 return c_array(m_ptr + pos, m_size - pos);
437 return m_ptr == rhs.m_ptr
438 && m_size *
sizeof(T) == rhs.m_size *
sizeof(U);
476 uint32_t return_value;
477 uint16_t *ptr(reinterpret_cast<uint16_t*>(&return_value));
T & const_reference
STL compliant typedef; notice that const_pointer is type T& and not const T&. This is because a c_arr...
reference front(void) const
T * const_pointer
STL compliant typedef; notice that const_pointer is type T* and not const T*. This is because a c_arr...
T * pointer
STL compliant typedef.
all classes and functions of FastUIDraw are in the namespace fastuidraw.
uint32_t pack_as_fp16(vec2 src)
vecN is a simple static array class with no virtual functions and no memory overhead. Supports runtim array index checking and STL style iterators via pointer iterators.
T value_type
STL compliant typedef.
bool same_data(const c_array< U > &rhs) const
c_array< S > const_cast_pointer(void) const
size_type size(void) const
c_array sub_array(range_type< I > R) const
reference back(void) const
c_array(const vecN< U, N > &pptr)
T * end_c_ptr(void) const
iterator begin(void) const
c_array(range_type< iterator > R)
#define FASTUIDRAWstatic_assert(X)
c_array sub_array(size_type pos, size_type length) const
c_array< typename unvecN< T >::type > flatten_array(void) const
T & reference
STL compliant typedef.
size_t size_type
STL compliant typedef.
void convert_to_fp16(c_array< const float > src, c_array< uint16_t > dst)
c_array< S > reinterpret_pointer(void) const
c_array(vecN< U, N > &pptr)
const_pointer const_iterator
iterator typedef to const_pointer
range_type< iterator > range(void) const
reference back(size_type I) const
A c_array is a wrapper over a C pointer with a size parameter to facilitate bounds checking and provi...
ptrdiff_t difference_type
STL compliant typedef.
pointer iterator
iterator typedef to pointer
A class reprenting the STL range [m_begin, m_end).
void convert_to_fp32(c_array< const uint16_t > src, c_array< float > dst)
c_array(U *pptr, size_type sz)
c_array(const c_array< U > &obj)
reference operator[](size_type j) const
#define FASTUIDRAWassert(X)
c_array sub_array(size_type pos) const