- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/quicktime/QTImportExport.h
r12292 r13041 19 19 /** ctor */ 20 20 QuicktimeImportExport(); 21 22 /** readFromString tries to read a chunk of bytes and interpret it as an image. 21 22 /** readFromString tries to read a chunk of bytes and interpret it as an image. 23 23 * @param istream the input stream 24 24 * @param fileTypeHint you can speed up the conversion by providing a filename with extension, so quicktime has not to guess the image's type … … 26 26 */ 27 27 osg::Image* readFromStream(std::istream & inStream, const std::string& fileTypeHint, long sizeHint = 0); 28 28 29 29 /** writes an osg::Image to a stream, using fileTypeHint as a hint whar format you want to write. */ 30 30 void writeToStream(std::ostream& outStream, osg::Image* image, const std::string& fileTypeHint) ; 31 31 32 32 /** get the last error-message */ 33 33 const std::string getLastErrorString() { return _lastError; } 34 34 35 35 /** return true if no error occured */ 36 36 bool success() { return (_error == false); } 37 37 38 38 protected: 39 39 40 40 /** flips an image */ 41 41 void flipImage(unsigned char* buffer, int bytesPerPixel, unsigned int width, unsigned height); 42 42 43 43 /** do some swizzling, so osg can use the image */ 44 44 unsigned char* pepareBufferForOSG(unsigned char * buffer, int bytesPerPixel, unsigned int width, unsigned height); 45 45 46 46 /** do some swizzling, so quicktime can use the image */ 47 47 unsigned char* prepareBufferForQuicktime(unsigned char* buffer, GLenum pixelFormat, int bytesPerPixel, unsigned int width, unsigned int height) ; 48 48 49 49 /** sets an error-msg */ 50 50 void setError(const std::string& msg) { _lastError = msg; _error = true; } 51 51 52 52 /** do the import */ 53 53 osg::Image* doImport(unsigned char* buffer, unsigned int dataSize, const std::string& fileTypeHint); 54 55 54 55 56 56 private: 57 57 bool _error;
