OpenImageInput (object)¶
The OpenImageInput is used to read images in OpenImageIO. You also get access to the image’s specification as a OpenImageSpec.
The main relevant method on the OpenImageInput is the `read_image`
method. Please see the example below.
注釈
Please refer to the official OpenImageIO documentation for more details (https://sites.google.com/site/openimageio/documentation).
/*
** Example: OpenImageInput
*/
require OpenImageIO;
require FileIO;
operator entry() {
FilePath path = FilePath('${FABRIC_SCENE_GRAPH_DIR}/Python/Apps/Resources/images/brick_d.png').expandEnvVars();
OpenImageInput img(path.string());
OpenImageSpec spec = img.spec();
report(spec.get_full_width());
report(spec.get_full_height());
OpenImageTypeDesc desc = OpenImageTypeDesc(OpenImage_BASETYPE_UINT8, OpenImage_AGGREGATE_SCALAR, OpenImage_VECSEMANTICS_NOXFORM);
Byte bytes[];
bytes.resize(spec.get_full_width() * spec.get_full_height() * spec.get_nchannels());
Data data = bytes.data();
img.read_image(desc, data, 0, 0, 0);
report(bytes[0]);
report(bytes[1]);
report(bytes[2]);
}
/*
** Output:
512
512
153
98
91
*/
Methods¶
OpenImageInput ( in OpenImageInput other ) | |
OpenImageInput ( in String fileName ) | |
OpenImageInput () | |
OpenImageInput | clone ? () |
Boolean | close ! () |
SInt32 | current_miplevel ? () |
SInt32 | current_subimage ? () |
String | geterror ? () |
open ! ( in String fileName ) | |
Boolean | read_image ! ( in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride, in SInt64 zstride ) |
Boolean | read_image ! ( out Float32 data[] ) |
Boolean | read_native_deep_image ! ( io OpenImageDeepData deepdata ) |
Boolean | read_native_deep_scanlines ! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, in SInt32 chbegin, in SInt32 chend, io OpenImageDeepData deepdata ) |
Boolean | read_native_deep_tiles ! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, in SInt32 chbegin, in SInt32 chend, io OpenImageDeepData deepdata ) |
Boolean | read_native_scanline ! ( in SInt32 y, in SInt32 z, io Data data ) |
Boolean | read_native_scanlines ! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, in SInt32 chbegin, in SInt32 chend, io Data data ) |
Boolean | read_native_scanlines ! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, io Data data ) |
Boolean | read_native_tile ! ( in SInt32 x, in SInt32 y, in SInt32 z, io Data data ) |
Boolean | read_native_tiles ! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, in SInt32 chbegin, in SInt32 chend, io Data data ) |
Boolean | read_native_tiles ! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, io Data data ) |
Boolean | read_scanline ! ( in SInt32 y, in SInt32 z, in OpenImageTypeDesc format, io Data data, in SInt64 xstride ) |
Boolean | read_scanline ! ( in SInt32 y, in SInt32 z, out Float32 data[] ) |
Boolean | read_scanlines ! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride ) |
Boolean | read_scanlines ! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, in SInt32 chbegin, in SInt32 chend, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride ) |
Boolean | read_tile ! ( in SInt32 x, in SInt32 y, in SInt32 z, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride, in SInt64 zstride ) |
Boolean | read_tile ! ( in SInt32 x, in SInt32 y, in SInt32 z, out Float32 data[] ) |
Boolean | read_tiles ! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride, in SInt64 zstride ) |
Boolean | read_tiles ! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, in SInt32 chbegin, in SInt32 chend, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride, in SInt64 zstride ) |
reset ! () | |
Boolean | seek_subimage ! ( in SInt32 subimage, in SInt32 miplevel, io OpenImageSpec newspec ) |
Boolean | seek_subimage ! ( in SInt32 subimage, io OpenImageSpec newspec ) |
OpenImageSpec | spec ? () |
Boolean | supports ? ( in String feature ) |
Boolean | valid ? () |
~OpenImageInput () |
Methods in detail¶
OpenImageInput ( in OpenImageInput other )
copy constructor
OpenImageInput ( in String fileName )
OpenImageInput OpenImageInput.clone? ()
clone method
Boolean OpenImageInput.close! ()
SInt32 OpenImageInput.current_miplevel? ()
SInt32 OpenImageInput.current_subimage? ()
String OpenImageInput.geterror? ()
OpenImageInput.open! ( in String fileName )
Boolean OpenImageInput.read_image! ( in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride, in SInt64 zstride )
Boolean OpenImageInput.read_image! ( out Float32 data[] )
Boolean OpenImageInput.read_native_deep_image! ( io OpenImageDeepData deepdata )
Boolean OpenImageInput.read_native_deep_scanlines! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, in SInt32 chbegin, in SInt32 chend, io OpenImageDeepData deepdata )
Boolean OpenImageInput.read_native_deep_tiles! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, in SInt32 chbegin, in SInt32 chend, io OpenImageDeepData deepdata )
Boolean OpenImageInput.read_native_scanline! ( in SInt32 y, in SInt32 z, io Data data )
Boolean OpenImageInput.read_native_scanlines! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, in SInt32 chbegin, in SInt32 chend, io Data data )
Boolean OpenImageInput.read_native_scanlines! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, io Data data )
Boolean OpenImageInput.read_native_tile! ( in SInt32 x, in SInt32 y, in SInt32 z, io Data data )
Boolean OpenImageInput.read_native_tiles! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, in SInt32 chbegin, in SInt32 chend, io Data data )
Boolean OpenImageInput.read_native_tiles! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, io Data data )
Boolean OpenImageInput.read_scanline! ( in SInt32 y, in SInt32 z, in OpenImageTypeDesc format, io Data data, in SInt64 xstride )
Boolean OpenImageInput.read_scanline! ( in SInt32 y, in SInt32 z, out Float32 data[] )
Boolean OpenImageInput.read_scanlines! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride )
Boolean OpenImageInput.read_scanlines! ( in SInt32 ybegin, in SInt32 yend, in SInt32 z, in SInt32 chbegin, in SInt32 chend, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride )
Boolean OpenImageInput.read_tile! ( in SInt32 x, in SInt32 y, in SInt32 z, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride, in SInt64 zstride )
Boolean OpenImageInput.read_tile! ( in SInt32 x, in SInt32 y, in SInt32 z, out Float32 data[] )
Boolean OpenImageInput.read_tiles! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride, in SInt64 zstride )
Boolean OpenImageInput.read_tiles! ( in SInt32 xbegin, in SInt32 xend, in SInt32 ybegin, in SInt32 yend, in SInt32 zbegin, in SInt32 zend, in SInt32 chbegin, in SInt32 chend, in OpenImageTypeDesc format, io Data data, in SInt64 xstride, in SInt64 ystride, in SInt64 zstride )
OpenImageInput.reset! ()
Boolean OpenImageInput.seek_subimage! ( in SInt32 subimage, in SInt32 miplevel, io OpenImageSpec newspec )
Boolean OpenImageInput.seek_subimage! ( in SInt32 subimage, io OpenImageSpec newspec )
OpenImageSpec OpenImageInput.spec? ()
Boolean OpenImageInput.supports? ( in String feature )
Boolean OpenImageInput.valid? ()
~ OpenImageInput ()