COPASI API  4.16.103
CLSimpleImageTexturizer.h
Go to the documentation of this file.
1 // Copyright (C) 2015 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 #ifndef CLSIMPLEIMAGETEXTURIZER_H__
7 #define CLSIMPLEIMAGETEXTURIZER_H__
8 
9 // libpng
10 // we have to include png.h before all other includes since it includes
11 // setjmp.h and if any other module that is imported before it includes setjmp.h as
12 // well, we get a compiler error.
13 #include <png.h>
14 
15 #include <string>
16 
18 
19 class CLTextureSpec;
20 
22 {
23 public:
24  virtual CLTextureSpec* operator()(const std::string& filename, const std::string& basedir);
25 
26 protected:
27  CLTextureSpec* create_texture_for_image(const std::string& filename, const std::string& basedir);
28 
29  /**
30  * This method creates a texture from a given JPEG image file.
31  * It is up to the caller to free the texture space once it is no longer needed.
32  * If no texture could be created, NULL is returned.
33  */
34  CLTextureSpec* create_texture_for_jpeg_image(const std::string& filename);
35 
36  /**
37  * This method creates a texture from a given PNG image file.
38  * It is up to the caller to free the texture space once it is no longer needed.
39  * If no texture could be created, NULL is returned.
40  */
41  CLTextureSpec* create_texture_for_png_image(const std::string& filename);
42 };
43 
44 #endif // CLSIMPLEIMAGETEXTURIZER_H__
CLTextureSpec * create_texture_for_jpeg_image(const std::string &filename)
CLTextureSpec * create_texture_for_image(const std::string &filename, const std::string &basedir)
CLTextureSpec * create_texture_for_png_image(const std::string &filename)
virtual CLTextureSpec * operator()(const std::string &filename, const std::string &basedir)