MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenImageIO / read_scanline

Method read_scanline

src/python/py_imageinput.cpp:216–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214
215
216object
217ImageInputWrap::read_scanline (int y, int z, TypeDesc format)
218{
219 // Allocate our own temp buffer and try to read the scanline into it.
220 // If the read fails, return None.
221 const ImageSpec &spec = m_input->spec();
222 size_t size = (size_t) spec.width * spec.nchannels * format.size();
223 char *data = new char[size];
224 if (!m_input->read_scanline (y, z, format, data)) {
225 delete [] data; // never mind
226 return object(handle<>(Py_None));
227 }
228
229 object array = C_array_to_Python_array (data, format, size);
230
231 // clean up and return the array handle
232 delete [] data;
233 return array;
234}
235
236
237object

Callers 7

stitch_rowFunction · 0.45
stitch_halvesFunction · 0.45
BOOST_FOREACHFunction · 0.45
test_readscanlineFunction · 0.45
copy_subimageFunction · 0.45

Calls 3

C_array_to_Python_arrayFunction · 0.85
specMethod · 0.45
sizeMethod · 0.45

Tested by 3

BOOST_FOREACHFunction · 0.36
test_readscanlineFunction · 0.36
copy_subimageFunction · 0.36