diff options
author | scuri <scuri> | 2009-09-10 17:33:34 +0000 |
---|---|---|
committer | scuri <scuri> | 2009-09-10 17:33:34 +0000 |
commit | 5335c91f4a10081ef8b04a6d47403c0efc064647 (patch) | |
tree | 742e83f8cfbf52e0d82c1e07f733ca4a5212b535 /src/im_format_raw.cpp | |
parent | 67475cb6aa3af3a0c65351562c22f25814a45fcb (diff) |
# Fixed: RAW format initialization.
Diffstat (limited to 'src/im_format_raw.cpp')
-rw-r--r-- | src/im_format_raw.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/im_format_raw.cpp b/src/im_format_raw.cpp index 5f8d2e5..6a6a7fd 100644 --- a/src/im_format_raw.cpp +++ b/src/im_format_raw.cpp @@ -2,7 +2,7 @@ * \brief RAW File Format * * See Copyright Notice in im_lib.h - * $Id: im_format_raw.cpp,v 1.3 2009/07/10 18:39:37 scuri Exp $ + * $Id: im_format_raw.cpp,v 1.4 2009/09/10 17:33:35 scuri Exp $ */ #include "im_format.h" @@ -58,11 +58,23 @@ public: int CanWrite(const char* compression, int color_mode, int data_type) const; }; +static imFormat* raw_format = NULL; -imFileFormatBase* imFormatInitRAW(void) +void imFormatFinishRAW(void) { - imFormatRAW iformat; - return iformat.Create(); + if (raw_format) + { + delete raw_format; + raw_format = NULL; + } +} + +imFormat* imFormatInitRAW(void) +{ + if (!raw_format) + raw_format = new imFormatRAW(); + + return raw_format; } int imFileFormatRAW::Open(const char* file_name) |