PageRenderTime 62ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/Bindings/Python/OSGSystem/module/generated/Image.pypp.cpp

https://github.com/vossg/OSGAddOnsGV
C++ | 677 lines | 506 code | 154 blank | 17 comment | 16 complexity | 7e8e3660e01acc880abee09af2d5b788 MD5 | raw file
  1. // This file has been generated by Py++.
  2. // PyOpenSG is (C) Copyright 2005-2009 by Allen Bierbaum
  3. //
  4. // This file is part of PyOpenSG.
  5. //
  6. // PyOpenSG is free software; you can redistribute it and/or modify it under
  7. // the terms of the GNU Lesser General Public License as published by the Free
  8. // Software Foundation; either version 2 of the License, or (at your option)
  9. // any later version.
  10. //
  11. // PyOpenSG is distributed in the hope that it will be useful, but WITHOUT ANY
  12. // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
  14. // more details.
  15. //
  16. // You should have received a copy of the GNU Lesser General Public License
  17. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #if __GNUC__ >= 4 || __GNUC_MINOR__ >=3
  19. #pragma GCC diagnostic warning "-Wold-style-cast"
  20. #pragma GCC diagnostic warning "-Wunused-local-typedefs"
  21. #pragma GCC diagnostic warning "-Wnon-virtual-dtor"
  22. #pragma GCC diagnostic warning "-Wshadow"
  23. #endif
  24. #if WIN32
  25. #pragma warning(disable : 4267)
  26. #pragma warning(disable : 4344)
  27. #endif
  28. #include "boost/python.hpp"
  29. #include "__call_policies.pypp.hpp"
  30. #include "OSGSystem_mainheader.h"
  31. #include "OsgPtrHelpers.h"
  32. #include "boost/python/suite/indexing/map_indexing_suite.hpp"
  33. #include "boost/python/suite/indexing/vector_indexing_suite.hpp"
  34. #include "Image.pypp.hpp"
  35. using namespace std;
  36. namespace bp = boost::python;
  37. static boost::python::object write_5b99e6d786e89389727b1b2d409008f3( ::OSG::Image & inst, ::OSG::Char8 const * fileName ){
  38. PyThreadState* _save = PyEval_SaveThread();
  39. bool result = inst.write(fileName);
  40. PyEval_RestoreThread(_save);
  41. return bp::object( result );
  42. }
  43. namespace
  44. {
  45. class ImageData : boost::noncopyable
  46. {
  47. public:
  48. ImageData(const OSG::UInt8* data, const size_t size)
  49. : mData(NULL)
  50. , mSize(size)
  51. {
  52. if ( NULL != data && size > 0 )
  53. {
  54. mData = reinterpret_cast<OSG::UInt8*>(std::malloc(size));
  55. std::memcpy(mData, data, size);
  56. }
  57. }
  58. explicit ImageData(const size_t size)
  59. : mData(NULL)
  60. , mSize(size)
  61. {
  62. if ( size > 0 )
  63. {
  64. mData = reinterpret_cast<OSG::UInt8*>(std::malloc(size));
  65. }
  66. }
  67. ~ImageData()
  68. {
  69. if ( NULL != mData )
  70. {
  71. std::free(mData);
  72. mData = NULL;
  73. }
  74. }
  75. const OSG::UInt8* getData() const
  76. {
  77. return mData;
  78. }
  79. OSG::UInt8* edit()
  80. {
  81. return mData;
  82. }
  83. size_t size() const
  84. {
  85. return mSize;
  86. }
  87. const std::string toString() const
  88. {
  89. return std::string(reinterpret_cast<const char*>(mData), mSize);
  90. }
  91. operator std::string() const
  92. {
  93. return toString();
  94. }
  95. operator const OSG::UInt8*() const
  96. {
  97. return getData();
  98. }
  99. bool operator==(const ImageData& other) const
  100. {
  101. return mData == other.mData;
  102. }
  103. private:
  104. OSG::UInt8* mData;
  105. const size_t mSize;
  106. ImageData(const ImageData &other);
  107. void operator =(const ImageData &other);
  108. };
  109. typedef boost::shared_ptr<ImageData> ImageDataPtr;
  110. ImageDataPtr wrapGetData(const OSG::Image* image, const OSG::UInt32 mipmapNum,
  111. const OSG::UInt32 frameNum, const OSG::UInt32 sideNum)
  112. {
  113. const bool with_mipmap(mipmapNum == 0);
  114. const bool with_frame_num(mipmapNum == 0);
  115. const bool with_side_count(mipmapNum == 0);
  116. const unsigned long size(image->getSize(with_mipmap, with_frame_num,
  117. with_side_count));
  118. return ImageDataPtr(
  119. new ImageData(image->getData(mipmapNum, frameNum, sideNum), size)
  120. );
  121. }
  122. bool wrapSet(OSG::Image& image, const OSG::UInt32 pixelFormat,
  123. const OSG::Int32 width, const OSG::Int32 height,
  124. const OSG::Int32 depth, const OSG::Int32 mipmapCount,
  125. const OSG::Int32 frameCount, const OSG::Time frameDelay,
  126. ImageDataPtr data, const OSG::Int32 type, const bool allocMem,
  127. const OSG::Int32 sideCount)
  128. {
  129. const OSG::UInt8* data_ptr(NULL);
  130. if ( data.get() != NULL )
  131. {
  132. data_ptr = data->getData();
  133. }
  134. return image.set(pixelFormat, width, height, depth, mipmapCount,
  135. frameCount, frameDelay, data_ptr, type, allocMem,
  136. sideCount);
  137. }
  138. bool wrapSetData(OSG::Image& image, ImageDataPtr data)
  139. {
  140. if ( data.get() == NULL )
  141. {
  142. return image.setData();
  143. }
  144. else
  145. {
  146. return image.setData(*data);
  147. }
  148. }
  149. bool wrapSetSubData(OSG::Image& image, const OSG::Int32 offX,
  150. const OSG::Int32 offY, const OSG::Int32 offZ,
  151. const OSG::Int32 srcW, const OSG::Int32 srcH,
  152. const OSG::Int32 srcD, ImageDataPtr data)
  153. {
  154. return image.setSubData(offX, offY, offZ, srcW, srcH, srcD, *data);
  155. }
  156. ImageDataPtr wrapStore(OSG::Image& image, const OSG::Char8* mimeType,
  157. const OSG::Int32 memSize)
  158. {
  159. const unsigned long size(image.getSize());
  160. ImageDataPtr data(new ImageData(size));
  161. image.store(mimeType, data->edit(), memSize);
  162. return data;
  163. }
  164. }
  165. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( Image_createMipmap_overloads, OSG::Image::createMipmap, 0, 2 )
  166. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( Image_mirror_overloads, OSG::Image::mirror, 2, 4 )
  167. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( Image_scale_overloads, OSG::Image::scale, 1, 4 )
  168. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( Image_reformat_overloads, OSG::Image::reformat, 1, 3 )
  169. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( Image_subImage_overloads, OSG::Image::subImage, 6, 7 )
  170. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( Image_slice_overloads, OSG::Image::slice, 0, 4 )
  171. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( Image_scaleNextPower2_overloads, OSG::Image::scaleNextPower2, 0, 1 )
  172. void register_Image_class(){
  173. { //::OSG::Image
  174. typedef bp::class_< OSG::Image, bp::bases< OSG::ImageBase >, OSG::Image::ObjRecPtr, boost::noncopyable > Image_exposer_t;
  175. Image_exposer_t Image_exposer = Image_exposer_t( "Image", bp::no_init );
  176. bp::scope Image_scope( Image_exposer );
  177. { //::OSG::Image::createMipmap
  178. typedef bool ( ::OSG::Image::*createMipmap_function_type )( ::OSG::Int32,::OSG::Image * ) ;
  179. Image_exposer.def(
  180. "createMipmap"
  181. , createMipmap_function_type( &::OSG::Image::createMipmap )
  182. , Image_createMipmap_overloads(
  183. bp::args( "level", "destination" ) ) );
  184. }
  185. { //::OSG::Image::mirror
  186. typedef bool ( ::OSG::Image::*mirror_function_type )( bool,bool,bool,::OSG::Image * ) ;
  187. Image_exposer.def(
  188. "mirror"
  189. , mirror_function_type( &::OSG::Image::mirror )
  190. , Image_mirror_overloads(
  191. bp::args( "horizontal", "vertical", "flipDepth", "destination" ) ) );
  192. }
  193. { //::OSG::Image::scale
  194. typedef bool ( ::OSG::Image::*scale_function_type )( ::OSG::Int32,::OSG::Int32,::OSG::Int32,::OSG::Image * ) ;
  195. Image_exposer.def(
  196. "scale"
  197. , scale_function_type( &::OSG::Image::scale )
  198. , Image_scale_overloads(
  199. bp::args( "width", "height", "depth", "destination" ) ) );
  200. }
  201. { //::OSG::Image::reformat
  202. typedef bool ( ::OSG::Image::*reformat_function_type )( ::OSG::Image::PixelFormat const,::OSG::Image *,::OSG::Int32 ) ;
  203. Image_exposer.def(
  204. "reformat"
  205. , reformat_function_type( &::OSG::Image::reformat )
  206. , Image_reformat_overloads(
  207. bp::args( "pixelFormat", "destination", "iCompressionFlags" ) ) );
  208. }
  209. { //::OSG::Image::subImage
  210. typedef bool ( ::OSG::Image::*subImage_function_type )( ::OSG::Int32,::OSG::Int32,::OSG::Int32,::OSG::Int32,::OSG::Int32,::OSG::Int32,::OSG::Image * ) ;
  211. Image_exposer.def(
  212. "subImage"
  213. , subImage_function_type( &::OSG::Image::subImage )
  214. , Image_subImage_overloads(
  215. bp::args( "offX", "offY", "offZ", "destW", "destH", "destD", "destination" ) ) );
  216. }
  217. { //::OSG::Image::slice
  218. typedef bool ( ::OSG::Image::*slice_function_type )( ::OSG::Int32,::OSG::Int32,::OSG::Int32,::OSG::Image * ) ;
  219. Image_exposer.def(
  220. "slice"
  221. , slice_function_type( &::OSG::Image::slice )
  222. , Image_slice_overloads(
  223. bp::args( "offX", "offY", "offZ", "destination" ) ) );
  224. }
  225. { //::OSG::Image::scaleNextPower2
  226. typedef bool ( ::OSG::Image::*scaleNextPower2_function_type )( ::OSG::Image * ) ;
  227. Image_exposer.def(
  228. "scaleNextPower2"
  229. , scaleNextPower2_function_type( &::OSG::Image::scaleNextPower2 )
  230. , Image_scaleNextPower2_overloads(
  231. bp::args( "destination" ) ) );
  232. }
  233. bp::enum_< OSG::Image::PixelFormat>("PixelFormat")
  234. .value("OSG_INVALID_PF", OSG::Image::OSG_INVALID_PF)
  235. .value("OSG_A_PF", OSG::Image::OSG_A_PF)
  236. .value("OSG_I_PF", OSG::Image::OSG_I_PF)
  237. .value("OSG_L_PF", OSG::Image::OSG_L_PF)
  238. .value("OSG_LA_PF", OSG::Image::OSG_LA_PF)
  239. .value("OSG_RGB_PF", OSG::Image::OSG_RGB_PF)
  240. .value("OSG_RGBA_PF", OSG::Image::OSG_RGBA_PF)
  241. .value("OSG_BGR_PF", OSG::Image::OSG_BGR_PF)
  242. .value("OSG_BGRA_PF", OSG::Image::OSG_BGRA_PF)
  243. .value("OSG_RGB_DXT1", OSG::Image::OSG_RGB_DXT1)
  244. .value("OSG_RGBA_DXT1", OSG::Image::OSG_RGBA_DXT1)
  245. .value("OSG_RGBA_DXT3", OSG::Image::OSG_RGBA_DXT3)
  246. .value("OSG_RGBA_DXT5", OSG::Image::OSG_RGBA_DXT5)
  247. .value("OSG_DEPTH_PF", OSG::Image::OSG_DEPTH_PF)
  248. .value("OSG_DEPTH_STENCIL_PF", OSG::Image::OSG_DEPTH_STENCIL_PF)
  249. .value("OSG_ALPHA_INTEGER_PF", OSG::Image::OSG_ALPHA_INTEGER_PF)
  250. .value("OSG_RGB_INTEGER_PF", OSG::Image::OSG_RGB_INTEGER_PF)
  251. .value("OSG_RGBA_INTEGER_PF", OSG::Image::OSG_RGBA_INTEGER_PF)
  252. .value("OSG_BGR_INTEGER_PF", OSG::Image::OSG_BGR_INTEGER_PF)
  253. .value("OSG_BGRA_INTEGER_PF", OSG::Image::OSG_BGRA_INTEGER_PF)
  254. .value("OSG_LUMINANCE_INTEGER_PF", OSG::Image::OSG_LUMINANCE_INTEGER_PF)
  255. .value("OSG_LUMINANCE_ALPHA_INTEGER_PF", OSG::Image::OSG_LUMINANCE_ALPHA_INTEGER_PF)
  256. .export_values()
  257. ;
  258. bp::enum_< OSG::Image::ResUnit>("ResUnit")
  259. .value("OSG_RESUNIT_INVALID", OSG::Image::OSG_RESUNIT_INVALID)
  260. .value("OSG_RESUNIT_NONE", OSG::Image::OSG_RESUNIT_NONE)
  261. .value("OSG_RESUNIT_INCH", OSG::Image::OSG_RESUNIT_INCH)
  262. .export_values()
  263. ;
  264. bp::enum_< OSG::Image::Type>("Type")
  265. .value("OSG_INVALID_IMAGEDATATYPE", OSG::Image::OSG_INVALID_IMAGEDATATYPE)
  266. .value("OSG_UINT8_IMAGEDATA", OSG::Image::OSG_UINT8_IMAGEDATA)
  267. .value("OSG_UINT16_IMAGEDATA", OSG::Image::OSG_UINT16_IMAGEDATA)
  268. .value("OSG_UINT32_IMAGEDATA", OSG::Image::OSG_UINT32_IMAGEDATA)
  269. .value("OSG_FLOAT16_IMAGEDATA", OSG::Image::OSG_FLOAT16_IMAGEDATA)
  270. .value("OSG_FLOAT32_IMAGEDATA", OSG::Image::OSG_FLOAT32_IMAGEDATA)
  271. .value("OSG_INT16_IMAGEDATA", OSG::Image::OSG_INT16_IMAGEDATA)
  272. .value("OSG_INT32_IMAGEDATA", OSG::Image::OSG_INT32_IMAGEDATA)
  273. .value("OSG_UINT24_8_IMAGEDATA", OSG::Image::OSG_UINT24_8_IMAGEDATA)
  274. .export_values()
  275. ;
  276. { //::OSG::Image::addValue
  277. typedef bool ( ::OSG::Image::*addValue_function_type )( ::OSG::Char8 const * ) ;
  278. Image_exposer.def(
  279. "addValue"
  280. , addValue_function_type( &::OSG::Image::addValue )
  281. , ( bp::arg("value") ) );
  282. }
  283. { //::OSG::Image::attachmentCount
  284. typedef ::OSG::UInt32 ( ::OSG::Image::*attachmentCount_function_type )( ) const;
  285. Image_exposer.def(
  286. "attachmentCount"
  287. , attachmentCount_function_type( &::OSG::Image::attachmentCount ) );
  288. }
  289. { //::OSG::Image::calcFrameNum
  290. typedef ::OSG::UInt32 ( ::OSG::Image::*calcFrameNum_function_type )( ::OSG::Time,bool ) const;
  291. Image_exposer.def(
  292. "calcFrameNum"
  293. , calcFrameNum_function_type( &::OSG::Image::calcFrameNum )
  294. , ( bp::arg("time"), bp::arg("loop")=(bool)(true) ) );
  295. }
  296. { //::OSG::Image::calcIsAlphaBinary
  297. typedef bool ( ::OSG::Image::*calcIsAlphaBinary_function_type )( ) ;
  298. Image_exposer.def(
  299. "calcIsAlphaBinary"
  300. , calcIsAlphaBinary_function_type( &::OSG::Image::calcIsAlphaBinary ) );
  301. }
  302. { //::OSG::Image::calcMipmapLevelCount
  303. typedef ::OSG::UInt32 ( ::OSG::Image::*calcMipmapLevelCount_function_type )( ) const;
  304. Image_exposer.def(
  305. "calcMipmapLevelCount"
  306. , calcMipmapLevelCount_function_type( &::OSG::Image::calcMipmapLevelCount ) );
  307. }
  308. { //::OSG::Image::calcMipmapLevelSize
  309. typedef ::OSG::UInt32 ( ::OSG::Image::*calcMipmapLevelSize_function_type )( ::OSG::UInt32,::OSG::UInt32,::OSG::UInt32,::OSG::UInt32 ) const;
  310. Image_exposer.def(
  311. "calcMipmapLevelSize"
  312. , calcMipmapLevelSize_function_type( &::OSG::Image::calcMipmapLevelSize )
  313. , ( bp::arg("mipmapNum"), bp::arg("w"), bp::arg("h"), bp::arg("d") ) );
  314. }
  315. { //::OSG::Image::calcMipmapLevelSize
  316. typedef ::OSG::UInt32 ( ::OSG::Image::*calcMipmapLevelSize_function_type )( ::OSG::UInt32 ) const;
  317. Image_exposer.def(
  318. "calcMipmapLevelSize"
  319. , calcMipmapLevelSize_function_type( &::OSG::Image::calcMipmapLevelSize )
  320. , ( bp::arg("mipmapNum") ) );
  321. }
  322. { //::OSG::Image::calcMipmapSumSize
  323. typedef ::OSG::UInt32 ( ::OSG::Image::*calcMipmapSumSize_function_type )( ::OSG::UInt32,::OSG::UInt32,::OSG::UInt32,::OSG::UInt32 ) const;
  324. Image_exposer.def(
  325. "calcMipmapSumSize"
  326. , calcMipmapSumSize_function_type( &::OSG::Image::calcMipmapSumSize )
  327. , ( bp::arg("mipmapNum"), bp::arg("w"), bp::arg("h"), bp::arg("d") ) );
  328. }
  329. { //::OSG::Image::calcMipmapSumSize
  330. typedef ::OSG::UInt32 ( ::OSG::Image::*calcMipmapSumSize_function_type )( ::OSG::UInt32 ) const;
  331. Image_exposer.def(
  332. "calcMipmapSumSize"
  333. , calcMipmapSumSize_function_type( &::OSG::Image::calcMipmapSumSize )
  334. , ( bp::arg("mipmapNum") ) );
  335. }
  336. { //::OSG::Image::changed
  337. typedef void ( ::OSG::Image::*changed_function_type )( ::OSG::ConstFieldMaskArg,::OSG::UInt32,::OSG::BitVector ) ;
  338. Image_exposer.def(
  339. "changed"
  340. , changed_function_type( &::OSG::Image::changed )
  341. , ( bp::arg("whichField"), bp::arg("origin"), bp::arg("details") ) );
  342. }
  343. { //::OSG::Image::clear
  344. typedef void ( ::OSG::Image::*clear_function_type )( ::OSG::UChar8 ) ;
  345. Image_exposer.def(
  346. "clear"
  347. , clear_function_type( &::OSG::Image::clear )
  348. , ( bp::arg("pixelValue")=(::OSG::UChar8)(0) ) );
  349. }
  350. { //::OSG::Image::clearData
  351. typedef void ( ::OSG::Image::*clearData_function_type )( ) ;
  352. Image_exposer.def(
  353. "clearData"
  354. , clearData_function_type( &::OSG::Image::clearData ) );
  355. }
  356. { //::OSG::Image::clearFloat
  357. typedef void ( ::OSG::Image::*clearFloat_function_type )( ::OSG::Real32 ) ;
  358. Image_exposer.def(
  359. "clearFloat"
  360. , clearFloat_function_type( &::OSG::Image::clearFloat )
  361. , ( bp::arg("pixelValue")=0.0 ) );
  362. }
  363. { //::OSG::Image::convertDataTypeTo
  364. typedef bool ( ::OSG::Image::*convertDataTypeTo_function_type )( ::OSG::Int32 ) ;
  365. Image_exposer.def(
  366. "convertDataTypeTo"
  367. , convertDataTypeTo_function_type( &::OSG::Image::convertDataTypeTo )
  368. , ( bp::arg("destDataType")=(::OSG::Int32)(::OSG::Int32(::OSG::Image::OSG_UINT8_IMAGEDATA)) ) );
  369. }
  370. { //::OSG::Image::dump
  371. typedef void ( ::OSG::Image::*dump_function_type )( ::OSG::UInt32,long unsigned int const ) const;
  372. Image_exposer.def(
  373. "dump"
  374. , dump_function_type( &::OSG::Image::dump )
  375. , ( bp::arg("uiIndent")=(::OSG::UInt32)(0), bp::arg("bvFlags")=(long unsigned int const)(0) ) );
  376. }
  377. { //::OSG::Image::findAttachmentField
  378. typedef ::std::string const * ( ::OSG::Image::*findAttachmentField_function_type )( ::std::string const & ) const;
  379. Image_exposer.def(
  380. "findAttachmentField"
  381. , findAttachmentField_function_type( &::OSG::Image::findAttachmentField )
  382. , ( bp::arg("key") )
  383. , bp::return_internal_reference< >() );
  384. }
  385. { //::OSG::Image::flipDepthFrameData
  386. typedef bool ( ::OSG::Image::*flipDepthFrameData_function_type )( ) ;
  387. Image_exposer.def(
  388. "flipDepthFrameData"
  389. , flipDepthFrameData_function_type( &::OSG::Image::flipDepthFrameData ) );
  390. }
  391. { //::OSG::Image::getComponents
  392. typedef ::OSG::UInt8 ( ::OSG::Image::*getComponents_function_type )( ) const;
  393. Image_exposer.def(
  394. "getComponents"
  395. , getComponents_function_type( &::OSG::Image::getComponents ) );
  396. }
  397. { //::OSG::Image::getHash
  398. typedef ::OSG::SizeT ( ::OSG::Image::*getHash_function_type )( bool ) const;
  399. Image_exposer.def(
  400. "getHash"
  401. , getHash_function_type( &::OSG::Image::getHash )
  402. , ( bp::arg("force")=(bool)(false) ) );
  403. }
  404. { //::OSG::Image::getSize
  405. typedef long unsigned int ( ::OSG::Image::*getSize_function_type )( bool,bool,bool ) const;
  406. Image_exposer.def(
  407. "getSize"
  408. , getSize_function_type( &::OSG::Image::getSize )
  409. , ( bp::arg("withMipmap")=(bool)(true), bp::arg("withFrames")=(bool)(true), bp::arg("withSides")=(bool)(true) ) );
  410. }
  411. { //::OSG::Image::hasAlphaChannel
  412. typedef bool ( ::OSG::Image::*hasAlphaChannel_function_type )( ) ;
  413. Image_exposer.def(
  414. "hasAlphaChannel"
  415. , hasAlphaChannel_function_type( &::OSG::Image::hasAlphaChannel ) );
  416. }
  417. { //::OSG::Image::hasAttachment
  418. typedef bool ( ::OSG::Image::*hasAttachment_function_type )( ) const;
  419. Image_exposer.def(
  420. "hasAttachment"
  421. , hasAttachment_function_type( &::OSG::Image::hasAttachment ) );
  422. }
  423. { //::OSG::Image::hasColorChannel
  424. typedef bool ( ::OSG::Image::*hasColorChannel_function_type )( ) ;
  425. Image_exposer.def(
  426. "hasColorChannel"
  427. , hasColorChannel_function_type( &::OSG::Image::hasColorChannel ) );
  428. }
  429. { //::OSG::Image::hasCompressedData
  430. typedef bool ( ::OSG::Image::*hasCompressedData_function_type )( ) ;
  431. Image_exposer.def(
  432. "hasCompressedData"
  433. , hasCompressedData_function_type( &::OSG::Image::hasCompressedData ) );
  434. }
  435. { //::OSG::Image::isAlphaBinary
  436. typedef bool ( ::OSG::Image::*isAlphaBinary_function_type )( ) ;
  437. Image_exposer.def(
  438. "isAlphaBinary"
  439. , isAlphaBinary_function_type( &::OSG::Image::isAlphaBinary ) );
  440. }
  441. { //::OSG::Image::isValid
  442. typedef bool ( ::OSG::Image::*isValid_function_type )( ) const;
  443. Image_exposer.def(
  444. "isValid"
  445. , isValid_function_type( &::OSG::Image::isValid ) );
  446. }
  447. { //::OSG::Image::read
  448. typedef bool ( ::OSG::Image::*read_function_type )( ::OSG::Char8 const * ) ;
  449. Image_exposer.def(
  450. "read"
  451. , read_function_type( &::OSG::Image::read )
  452. , ( bp::arg("fileName") ) );
  453. }
  454. { //::OSG::Image::removeMipmap
  455. typedef bool ( ::OSG::Image::*removeMipmap_function_type )( ) ;
  456. Image_exposer.def(
  457. "removeMipmap"
  458. , removeMipmap_function_type( &::OSG::Image::removeMipmap ) );
  459. }
  460. { //::OSG::Image::set
  461. typedef bool ( ::OSG::Image::*set_function_type )( ::OSG::Image * ) ;
  462. Image_exposer.def(
  463. "set"
  464. , set_function_type( &::OSG::Image::set )
  465. , ( bp::arg("image") ) );
  466. }
  467. { //::OSG::Image::setAttachmentField
  468. typedef void ( ::OSG::Image::*setAttachmentField_function_type )( ::std::string const &,::std::string const & ) ;
  469. Image_exposer.def(
  470. "setAttachmentField"
  471. , setAttachmentField_function_type( &::OSG::Image::setAttachmentField )
  472. , ( bp::arg("key"), bp::arg("data") ) );
  473. }
  474. { //::OSG::Image::swapDataEndian
  475. typedef void ( ::OSG::Image::*swapDataEndian_function_type )( ) ;
  476. Image_exposer.def(
  477. "swapDataEndian"
  478. , swapDataEndian_function_type( &::OSG::Image::swapDataEndian ) );
  479. }
  480. { //::OSG::Image::write
  481. typedef boost::python::object ( *write_function_type )( ::OSG::Image &,::OSG::Char8 const * );
  482. Image_exposer.def(
  483. "write"
  484. , write_function_type( &write_5b99e6d786e89389727b1b2d409008f3 )
  485. , ( bp::arg("inst"), bp::arg("fileName") ) );
  486. }
  487. pyopensg::register_transit< OSG::Image >::execute();
  488. bp::implicitly_convertible< OSG::Image::ObjRecPtr, OSG::Image* >();
  489. bp::implicitly_convertible< OSG::Image::ObjRecPtr, OSG::Image::ObjCPtr >();
  490. bp::implicitly_convertible< OSG::Image::ObjRecPtr, OSG::AttachmentContainer* >();
  491. bp::implicitly_convertible< OSG::Image::ObjRecPtr, OSG::AttachmentContainer::ObjRecPtr >();
  492. bp::implicitly_convertible<OSG::Image::ObjRecPtr, OSG::AttachmentContainer::ObjCPtr>();
  493. Image_exposer.def("getData", wrapGetData,
  494. (bp::arg("inst"), bp::arg("mipmapNum") = 0,
  495. bp::arg("frameNum") = 0, bp::arg("sideNum") = 0));
  496. Image_exposer.def("set", wrapSet,
  497. (bp::arg("inst"), bp::arg("pixelFormat"),
  498. bp::arg("width"), bp::arg("height") = (OSG::Int32) 1,
  499. bp::arg("depth") = (OSG::Int32) 1,
  500. bp::arg("mipmapCount") = (OSG::Int32) 1,
  501. bp::arg("frameCount") = (OSG::Int32) 1,
  502. bp::arg("frameDelay") = (OSG::Time) 0.0,
  503. bp::arg("data") = ImageDataPtr(),
  504. bp::arg("type") = (OSG::Int32) OSG::Image::OSG_UINT8_IMAGEDATA,
  505. bp::arg("allocMem") = (bool) true,
  506. bp::arg("sidecount") = (OSG::Int32) 1));
  507. Image_exposer.def("setData", wrapSetData,
  508. (bp::arg("inst"), bp::arg("data") = ImageDataPtr()));
  509. Image_exposer.def("setSubData", wrapSetSubData,
  510. (bp::arg("inst"), bp::arg("offX"), bp::arg("offY"),
  511. bp::arg("offZ"), bp::arg("srcW"), bp::arg("srcH"),
  512. bp::arg("srcD"), bp::arg("data")));
  513. Image_exposer.def("store", wrapStore,
  514. (bp::arg("inst"), bp::arg("mimeType"), bp::arg("memSize") = -1));
  515. bp::class_<ImageData, ImageDataPtr, boost::noncopyable>("ImageData", bp::no_init)
  516. .def("size", &ImageData::size)
  517. .def("toString", &ImageData::toString)
  518. .def(bp::self == bp::self)
  519. .def(bp::self_ns::str(bp::self))
  520. ;
  521. bp::implicitly_convertible<ImageData, const OSG::UInt8*>();
  522. }
  523. }