-
Notifications
You must be signed in to change notification settings - Fork 299
/
ImageCImg.h
45 lines (31 loc) · 873 Bytes
/
ImageCImg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef SOFA_HELPER_IO_IMAGECIMG_H
#define SOFA_HELPER_IO_IMAGECIMG_H
#include <memory>
#include <string>
#include <vector>
#include <sofa/helper/io/Image.h>
#include <CImgPlugin/CImgPlugin.h>
namespace sofa::helper::io
{
class SOFA_CIMGPLUGIN_API ImageCImgCreators
{
std::vector<std::shared_ptr<sofa::helper::io::Image::FactoryImage::Creator>> creators;
public:
static std::vector<std::string> cimgSupportedExtensions;
ImageCImgCreators();
};
class SOFA_CIMGPLUGIN_API ImageCImg : public Image
{
public:
ImageCImg (){}
ImageCImg (const std::string &filename)
{
if(!filename.empty())
load(filename);
}
static void setCimgCreators();
bool load(std::string filename);
bool save(std::string filename, int compression_level = -1);
};
} // namespace sofa::helper::io
#endif // SOFA_HELPER_IO_IMAGECIMG_H