summaryrefslogtreecommitdiff
path: root/image/image.hpp
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2013-09-11 18:14:22 +0100
committerJosé Fonseca <jfonseca@vmware.com>2013-09-11 18:14:22 +0100
commit08473e50e90059e75d6e7bce7e12be8bf6dd028b (patch)
tree35f703a7dfc6debf02e57f9f5e91a443a670ef2f /image/image.hpp
parent6bcb31e30169a7ff115f43bee096b19acbfcd43a (diff)
image: Move helpers to respective modules.
Diffstat (limited to 'image/image.hpp')
-rw-r--r--image/image.hpp39
1 files changed, 11 insertions, 28 deletions
diff --git a/image/image.hpp b/image/image.hpp
index 7e13dd6f..6b32f27d 100644
--- a/image/image.hpp
+++ b/image/image.hpp
@@ -31,7 +31,7 @@
#define _IMAGE_HPP_
-#include <fstream>
+#include <iostream>
namespace image {
@@ -81,43 +81,26 @@ public:
return flipped ? -(signed)(width*channels) : width*channels;
}
- bool writeBMP(const char *filename) const;
+ bool
+ writeBMP(const char *filename) const;
- void writePNM(std::ostream &os, const char *comment = NULL) const;
+ void
+ writePNM(std::ostream &os, const char *comment = NULL) const;
- inline bool writePNM(const char *filename, const char *comment = NULL) const {
- std::ofstream os(filename, std::ofstream::binary);
- if (!os) {
- return false;
- }
- writePNM(os, comment);
- return true;
- }
+ bool
+ writePNM(const char *filename, const char *comment = NULL) const;
bool
writePNG(std::ostream &os) const;
- inline bool
- writePNG(const char *filename) const {
- std::ofstream os(filename, std::ofstream::binary);
- if (!os) {
- return false;
- }
- return writePNG(os);
- }
+ bool
+ writePNG(const char *filename) const;
void
writeRAW(std::ostream &os) const;
- inline bool
- writeRAW(const char *filename) const {
- std::ofstream os(filename, std::ofstream::binary);
- if (!os) {
- return false;
- }
- writeRAW(os);
- return true;
- }
+ bool
+ writeRAW(const char *filename) const;
};