MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / getslice

Method getslice

src/python/PyImath/PyImathFixedVArray.cpp:317–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315
316template <class T>
317FixedVArray<T>
318FixedVArray<T>::getslice (PyObject* index) const
319{
320 size_t start = 0;
321 size_t end = 0;
322 size_t sliceLength = 0;
323 Py_ssize_t step;
324 extract_slice_indices (index, start, end, step, sliceLength, _length);
325
326 FixedVArray<T> f(sliceLength);
327
328 if (_indices)
329 {
330 for (size_t i = 0; i < sliceLength; ++i)
331 {
332 f._ptr[i] = _ptr[raw_ptr_index(start + i*step)*_stride];
333 }
334 }
335 else
336 {
337 for (size_t i = 0; i < sliceLength; ++i)
338 {
339 f._ptr[i] = _ptr[(start + i*step)*_stride];
340 }
341 }
342
343 return f;
344}
345
346template <class T>
347FixedVArray<T>

Callers

nothing calls this directly

Calls 1

extract_slice_indicesFunction · 0.85

Tested by

no test coverage detected