31 #ifndef PYOPENIMAGEIO_PY_OIIO_H
32 #define PYOPENIMAGEIO_PY_OIIO_H
36 #include <boost/python.hpp>
44 #if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5)
45 #define Py_ssize_t int
48 namespace PyOpenImageIO
51 using namespace boost::python;
55 void declare_imagespec();
56 void declare_imageinput();
57 void declare_imageoutput();
58 void declare_typedesc();
59 void declare_imagecache();
60 void declare_imagebuf();
61 void declare_paramvalue();
63 bool PyProgressCallback(
void*,
float);
70 void* make_write_buffer (
object&, Py_ssize_t);
73 static boost::python::object create(
const std::string&,
const std::string&);
74 static boost::python::object open_static_regular(
const std::string&);
75 static boost::python::object open_static_with_config(
const std::string&,
const ImageSpec&);
76 const char *format_name ()
const;
77 bool open_regular (
const std::string&, ImageSpec&);
78 bool open_with_config(
const std::string&, ImageSpec&,
const ImageSpec&);
79 const ImageSpec &spec()
const;
81 int current_subimage()
const;
82 bool seek_subimage (
int,
int, ImageSpec&);
83 bool read_image(TypeDesc,
object&, stride_t, stride_t, stride_t,
object);
84 bool read_image_simple(
object&);
85 bool read_scanline(
int,
int, TypeDesc,
object&, stride_t);
86 bool read_scanline_simple(
int,
int,
object&);
87 bool read_tile(
int,
int,
int, TypeDesc,
object&,
88 stride_t, stride_t, stride_t);
89 bool read_tile_simple(
int,
int,
int,
object&);
90 bool read_native_scanline(
int,
int,
object&);
91 bool read_native_tile(
int,
int,
int,
object&);
92 std::string geterror()
const;
99 ImageOutput *m_output;
100 const void *make_read_buffer(
object&);
103 static boost::python::object create(
const std::string&,
const std::string&);
104 const ImageSpec &spec()
const;
105 bool open (
const std::string&,
const ImageSpec&, ImageOutput::OpenMode);
107 bool write_scanline(
int,
int, TypeDesc, boost::python::object&, stride_t);
108 bool write_tile(
int,
int,
int, TypeDesc, boost::python::object&,
109 stride_t, stride_t, stride_t);
110 bool write_rectangle(
int,
int,
int,
int,
int,
int, TypeDesc,
111 boost::python::object&, stride_t, stride_t, stride_t);
112 bool write_image (TypeDesc,
object&, stride_t, stride_t, stride_t,
object);
113 void print_pointer();
115 const char *format_name ()
const;
116 bool supports (
const std::string&)
const;
117 std::string geterror()
const;
129 bool attribute (
const std::string&, TypeDesc,
const void*);
130 bool attribute_int (
const std::string&,
int );
131 bool attribute_float (
const std::string&,
float);
132 bool attribute_double (
const std::string&,
double);
133 bool attribute_char (
const std::string&,
const char*);
134 bool attribute_string (
const std::string&,
const std::string&);
135 bool getattribute(
const std::string&, TypeDesc,
void*);
136 bool getattribute_int (
const std::string&,
int&);
137 bool getattribute_float(
const std::string&,
float&);
138 bool getattribute_double(
const std::string&,
double&);
139 bool getattribute_char(
const std::string&,
char**);
140 bool getattribute_string(
const std::string&, std::string&);
141 std::string resolve_filename (
const std::string&);
143 bool get_imagespec(
ustring, ImageSpec&,
int);
144 bool get_pixels (
ustring,
int,
int,
int,
int,
int,
int,
145 int,
int, TypeDesc,
void*);
161 std::string geterror ()
const;
162 std::string getstats (
int)
const;
164 void invalidate_all (
bool);
177 void reset_to_new_image (
const std::string&, ImageCache*);
178 void reset_to_blank_image (
const std::string&,
const ImageSpec&);
179 void alloc (
const ImageSpec&);
197 bool init_spec (
const std::string&,
int,
int);
198 const ImageSpec &spec()
const;
199 const std::string &name()
const;
200 const std::string &file_format_name()
const;
201 int subimage()
const;
202 int nsubimages()
const;
203 int nchannels()
const;
204 float getchannel (
int,
int,
int,
int)
const;
205 void getpixel (
int,
int,
float*,
int)
const;
206 void interppixel (
float,
float,
float*)
const;
207 void interppixel_NDC (
float,
float,
float*)
const;
208 void setpixel_xy (
int,
int,
const float*,
int);
209 void setpixel_i (
int,
const float*,
int);
218 bool get_pixels (
int,
int,
int,
int,
int,
int, TypeDesc,
void*)
const;
229 int orientation()
const;
230 int oriented_width()
const;
231 int oriented_height()
const;
232 int oriented_x()
const;
233 int oriented_y()
const;
234 int oriented_full_width()
const;
235 int oriented_full_height()
const;
236 int oriented_full_x()
const;
237 int oriented_full_y()
const;
247 bool pixels_valid ()
const;
248 bool localpixels ()
const;
251 std::string geterror()
const;
257 #endif // PYOPENIMAGEIO_PY_OIIO_H