Ignore:
Timestamp:
01/13/10 16:11:16 (2 years ago)
Author:
rkuck
Message:

Added utility method to osg::Image python binding for saving image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/avango-osg/python/avango/osg/OSGImage.cpp

    r37 r334  
    2727#include <avango/python/register_field.h> 
    2828#include <avango/osg/Image.h> 
     29#include <osgDB/WriteFile> 
    2930#include "OSGImage.h" 
    3031 
     
    3334 
    3435namespace boost 
    35  { 
     36{ 
    3637  namespace python 
    37    { 
     38  { 
    3839    template <class T> struct pointee<av::Link<T> > 
    39      { 
     40    { 
    4041      typedef T type; 
    41      }; 
    42    } 
    43  } 
     42    }; 
     43  } 
     44} 
     45 
     46void write_image_file(av::osg::Image* image, const std::string& name) 
     47{ 
     48  osgDB::writeImageFile(*(image->getOsgImage()), name); 
     49} 
    4450 
    4551void init_OSGImage(void) 
    46  { 
     52{ 
    4753  // wrapping osg::Image functionality 
    4854  register_field<av::osg::SFImage>("SFImage"); 
    4955  register_multifield<av::osg::MFImage>("MFImage"); 
    50   class_<av::osg::Image, av::Link<av::osg::Image>, bases<av::osg::Object>, boost::noncopyable >("Image", "docstring", no_init); 
    51  } 
     56  class_<av::osg::Image, av::Link<av::osg::Image>, bases<av::osg::Object>, boost::noncopyable >("Image", "docstring", no_init) 
     57    .def("write_file", write_image_file) 
     58    ; 
     59} 
Note: See TracChangeset for help on using the changeset viewer.