Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-01-12 14:59:13 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-01-12 14:59:13 +0400
commit7a90af7b5a50bac5bb9fa6bf8ec785dac145a90c (patch)
tree661f808af738e2d06ee5a436fe4e59b3daa67797 /intern/cycles/blender/blender_session.h
parent5e6917a18e288b06cc8130aa8311453c9893dd0b (diff)
Packed and generated images support for Cycles
This commit adds support of packed and generated images for Cycles when using SVM backend. Movies are still not supported. This changes also doesn't touch OSL which is much less trivial to adopt for any images which are not saved to disk. Implementation details: - When adding images to Image Manager is now possible to mark image as builtin. Builtin images will bypass OIIO loader and will use special loading callbacks. - Callbacks are set by Blender Session and they're using C++ RNA interface to obtain needed data (pixels, dimensions, is_float flag). - Image Manager assumes file path is used as reference to a builtin images, but in fact currently image datablock name is used for reference. This makes it easy to find an image in BlendData database. - Added some extra properties to Image RNA: * channels, which denotes actual number of channels in ImBuf. This is needed to treat image's pixels correct (before it wasn't possible because API used internal number of channels for pixels which is in fact doesn't correlate with image depth) * is_float, which is truth if image is stored in float buffer of ImBuf. - Implemented string lookup for C++ RNA collections for cases there's no manual lookup function. OSL is not supported because it used own image loading and filtering routines and there's seems to be no API to feed pre-loaded pixels directly to the library. Think we'll either need to add some API to support such kind of feeding or consider OSL does not have support of packed images at all. Movies are not supported at this moment because of lack of RNA API to load specified frame. It's not difficult to solve, just need to consider what to best here: * Either write some general python interface for ImBuf and use it via C++ API, or * Write a PY API function which will return pixels for given frame, or * Use bad-level BKE_* call Anyway, small steps, further improvements later. Reviewed by Brecht, thanks!
Diffstat (limited to 'intern/cycles/blender/blender_session.h')
-rw-r--r--intern/cycles/blender/blender_session.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_session.h b/intern/cycles/blender/blender_session.h
index 7f3973ae873..dfa487bd244 100644
--- a/intern/cycles/blender/blender_session.h
+++ b/intern/cycles/blender/blender_session.h
@@ -93,6 +93,10 @@ public:
protected:
void do_write_update_render_result(BL::RenderResult b_rr, BL::RenderLayer b_rlay, RenderTile& rtile, bool do_update_only);
void do_write_update_render_tile(RenderTile& rtile, bool do_update_only);
+
+ void builtin_image_info(const string &name, bool &is_float, int &width, int &height, int &channels);
+ bool builtin_image_pixels(const string &name, unsigned char *pixels);
+ bool builtin_image_float_pixels(const string &name, float *pixels);
};
CCL_NAMESPACE_END