diff options
| author | manuel <manuel@clan-server.at> | 2009-04-28 16:29:24 +0200 |
|---|---|---|
| committer | manuel <manuel@clan-server.at> | 2009-04-28 16:29:24 +0200 |
| commit | f3c5bc280737573cf8597f18c011a1a1092e32d3 (patch) | |
| tree | a0a9d01787bbcbda381fde6fb91ee288b171d410 | |
| parent | aa139a7d2b3f26af7590edbf413df67195c5d900 (diff) | |
| download | ooprog-f3c5bc280737573cf8597f18c011a1a1092e32d3.tar.gz ooprog-f3c5bc280737573cf8597f18c011a1a1092e32d3.tar.bz2 ooprog-f3c5bc280737573cf8597f18c011a1a1092e32d3.zip | |
making cbitmap abstract
| -rw-r--r-- | ue2/imgsynth2/cpixelformat.h | 4 | ||||
| -rw-r--r-- | ue2/imgsynth2/cwindowsbitmap.cpp (renamed from ue2/imgsynth2/cbitmap.cpp) | 30 | ||||
| -rw-r--r-- | ue2/imgsynth2/cwindowsbitmap.h (renamed from ue2/imgsynth2/cbitmap.h) | 24 | ||||
| -rw-r--r-- | ue2/imgsynth2/x1 | 26 | ||||
| -rw-r--r-- | ue2/imgsynth2/x2 | 26 |
5 files changed, 29 insertions, 81 deletions
diff --git a/ue2/imgsynth2/cpixelformat.h b/ue2/imgsynth2/cpixelformat.h index 49145df..0568dd4 100644 --- a/ue2/imgsynth2/cpixelformat.h +++ b/ue2/imgsynth2/cpixelformat.h | |||
| @@ -47,7 +47,7 @@ class CPixelFormat | |||
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| 50 | * @method CBitmap | 50 | * @method CPixelFormat |
| 51 | * @brief Default ctor | 51 | * @brief Default ctor |
| 52 | * @param bitmap pointer to CBitmap instance | 52 | * @param bitmap pointer to CBitmap instance |
| 53 | * @return - | 53 | * @return - |
| @@ -95,7 +95,7 @@ class CPixelFormat | |||
| 95 | * @exception PixelFormatError | 95 | * @exception PixelFormatError |
| 96 | * @conditions none | 96 | * @conditions none |
| 97 | */ | 97 | */ |
| 98 | //TODO virtual void getPixel(const uint32_t *pixel, const uint32_t x, const uint32_t y) = 0; | 98 | virtual void getPixel(const uint32_t *pixel, const uint32_t x, const uint32_t y) = 0; |
| 99 | 99 | ||
| 100 | /** | 100 | /** |
| 101 | * @method getBitCount | 101 | * @method getBitCount |
diff --git a/ue2/imgsynth2/cbitmap.cpp b/ue2/imgsynth2/cwindowsbitmap.cpp index fc1a7c0..5466dc2 100644 --- a/ue2/imgsynth2/cbitmap.cpp +++ b/ue2/imgsynth2/cwindowsbitmap.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /** | 1 | /** |
| 2 | * @module cbitmap | 2 | * @module cwindowsbitmap |
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) |
| 4 | * @brief Implementation of CFile handling Windows Bitmaps. | 4 | * @brief Implementation of CBitmap handling Windows Bitmaps. |
| 5 | * @date 17.04.2009 | 5 | * @date 17.04.2009 |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| @@ -10,13 +10,13 @@ | |||
| 10 | #ifdef DEBUG | 10 | #ifdef DEBUG |
| 11 | # include <iostream> | 11 | # include <iostream> |
| 12 | #endif | 12 | #endif |
| 13 | #include "cbitmap.h" | 13 | #include "cwindowsbitmap.h" |
| 14 | #include "cpixelformat_bgr24.h" | 14 | #include "cpixelformat_bgr24.h" |
| 15 | #include "cpixelformat_bgr555.h" | 15 | #include "cpixelformat_bgr555.h" |
| 16 | 16 | ||
| 17 | using namespace std; | 17 | using namespace std; |
| 18 | 18 | ||
| 19 | CBitmap::CBitmap() | 19 | CWindowsBitmap::CWindowsBitmap() |
| 20 | : m_pixeldata(NULL), m_pixelformat(NULL) | 20 | : m_pixeldata(NULL), m_pixelformat(NULL) |
| 21 | { | 21 | { |
| 22 | m_types.insert("BMP"); | 22 | m_types.insert("BMP"); |
| @@ -28,7 +28,7 @@ CBitmap::CBitmap() | |||
| 28 | 28 | ||
| 29 | /*----------------------------------------------------------------------------*/ | 29 | /*----------------------------------------------------------------------------*/ |
| 30 | 30 | ||
| 31 | CBitmap::~CBitmap() | 31 | CWindowsBitmap::~CWindowsBitmap() |
| 32 | { | 32 | { |
| 33 | /* delete pixeldata */ | 33 | /* delete pixeldata */ |
| 34 | if (m_pixeldata != NULL) | 34 | if (m_pixeldata != NULL) |
| @@ -44,7 +44,7 @@ CBitmap::~CBitmap() | |||
| 44 | 44 | ||
| 45 | /*----------------------------------------------------------------------------*/ | 45 | /*----------------------------------------------------------------------------*/ |
| 46 | 46 | ||
| 47 | void CBitmap::read(std::ifstream& in) | 47 | void CWindowsBitmap::read(std::ifstream& in) |
| 48 | { | 48 | { |
| 49 | /* read and check file header */ | 49 | /* read and check file header */ |
| 50 | in.read(reinterpret_cast<char *>(&m_fileheader), sizeof(m_fileheader)); | 50 | in.read(reinterpret_cast<char *>(&m_fileheader), sizeof(m_fileheader)); |
| @@ -95,7 +95,7 @@ void CBitmap::read(std::ifstream& in) | |||
| 95 | 95 | ||
| 96 | /*----------------------------------------------------------------------------*/ | 96 | /*----------------------------------------------------------------------------*/ |
| 97 | 97 | ||
| 98 | void CBitmap::write(std::ofstream& out) | 98 | void CWindowsBitmap::write(std::ofstream& out) |
| 99 | { | 99 | { |
| 100 | /* set header values */ | 100 | /* set header values */ |
| 101 | m_fileheader.bfSize = m_infoheader.biSizeImage + sizeof(m_infoheader) + sizeof(m_fileheader); | 101 | m_fileheader.bfSize = m_infoheader.biSizeImage + sizeof(m_infoheader) + sizeof(m_fileheader); |
| @@ -113,7 +113,7 @@ void CBitmap::write(std::ofstream& out) | |||
| 113 | 113 | ||
| 114 | /*----------------------------------------------------------------------------*/ | 114 | /*----------------------------------------------------------------------------*/ |
| 115 | 115 | ||
| 116 | void CBitmap::callFunc(const std::string& func, const std::list<std::string>& params) | 116 | void CWindowsBitmap::callFunc(const std::string& func, const std::list<std::string>& params) |
| 117 | { | 117 | { |
| 118 | if (func.empty()) | 118 | if (func.empty()) |
| 119 | throw FileError("Function name is empty."); | 119 | throw FileError("Function name is empty."); |
| @@ -132,7 +132,7 @@ void CBitmap::callFunc(const std::string& func, const std::list<std::string>& pa | |||
| 132 | 132 | ||
| 133 | /*----------------------------------------------------------------------------*/ | 133 | /*----------------------------------------------------------------------------*/ |
| 134 | 134 | ||
| 135 | void CBitmap::fillrect(std::list<std::string> params) | 135 | void CWindowsBitmap::fillrect(std::list<std::string> params) |
| 136 | { | 136 | { |
| 137 | /* check prerequirements */ | 137 | /* check prerequirements */ |
| 138 | if (params.size() != 7) | 138 | if (params.size() != 7) |
| @@ -203,7 +203,7 @@ void CBitmap::fillrect(std::list<std::string> params) | |||
| 203 | /*----------------------------------------------------------------------------*/ | 203 | /*----------------------------------------------------------------------------*/ |
| 204 | 204 | ||
| 205 | #include <iostream> | 205 | #include <iostream> |
| 206 | void CBitmap::invert(std::list<std::string> params) | 206 | void CWindowsBitmap::invert(std::list<std::string> params) |
| 207 | { | 207 | { |
| 208 | /* check prerequirements */ | 208 | /* check prerequirements */ |
| 209 | if (params.size() != 0) | 209 | if (params.size() != 0) |
| @@ -254,13 +254,13 @@ void CBitmap::invert(std::list<std::string> params) | |||
| 254 | 254 | ||
| 255 | /*----------------------------------------------------------------------------*/ | 255 | /*----------------------------------------------------------------------------*/ |
| 256 | 256 | ||
| 257 | void CBitmap::brightness(std::list<std::string> params) | 257 | void CWindowsBitmap::brightness(std::list<std::string> params) |
| 258 | { | 258 | { |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | /*----------------------------------------------------------------------------*/ | 261 | /*----------------------------------------------------------------------------*/ |
| 262 | 262 | ||
| 263 | void CBitmap::mirror_y(std::list<std::string> params) | 263 | void CWindowsBitmap::mirror_y(std::list<std::string> params) |
| 264 | { | 264 | { |
| 265 | /* check prerequirements */ | 265 | /* check prerequirements */ |
| 266 | if (params.size() != 0) | 266 | if (params.size() != 0) |
| @@ -269,7 +269,7 @@ void CBitmap::mirror_y(std::list<std::string> params) | |||
| 269 | /* do nothing if no pixel exists */ | 269 | /* do nothing if no pixel exists */ |
| 270 | if (m_pixeldata == NULL || m_pixelformat == NULL) | 270 | if (m_pixeldata == NULL || m_pixelformat == NULL) |
| 271 | return; | 271 | return; |
| 272 | 272 | W | |
| 273 | /* height can be negativ */ | 273 | /* height can be negativ */ |
| 274 | uint32_t height = static_cast<uint32_t>(abs(m_infoheader.biHeight)); | 274 | uint32_t height = static_cast<uint32_t>(abs(m_infoheader.biHeight)); |
| 275 | 275 | ||
| @@ -300,7 +300,7 @@ void CBitmap::mirror_y(std::list<std::string> params) | |||
| 300 | 300 | ||
| 301 | /*----------------------------------------------------------------------------*/ | 301 | /*----------------------------------------------------------------------------*/ |
| 302 | 302 | ||
| 303 | void CBitmap::mirror_x(std::list<std::string> params) | 303 | void CWindowsBitmap::mirror_x(std::list<std::string> params) |
| 304 | { | 304 | { |
| 305 | /* check prerequirements */ | 305 | /* check prerequirements */ |
| 306 | if (params.size() != 0) | 306 | if (params.size() != 0) |
| @@ -348,7 +348,7 @@ void CBitmap::mirror_x(std::list<std::string> params) | |||
| 348 | /*----------------------------------------------------------------------------*/ | 348 | /*----------------------------------------------------------------------------*/ |
| 349 | 349 | ||
| 350 | #ifdef DEBUG | 350 | #ifdef DEBUG |
| 351 | void CBitmap::dump(std::ostream& out) | 351 | void CWindowsBitmap::dump(std::ostream& out) |
| 352 | { | 352 | { |
| 353 | out | 353 | out |
| 354 | << "Bitmap File Header:" << endl | 354 | << "Bitmap File Header:" << endl |
diff --git a/ue2/imgsynth2/cbitmap.h b/ue2/imgsynth2/cwindowsbitmap.h index ca3d6ef..420ad1e 100644 --- a/ue2/imgsynth2/cbitmap.h +++ b/ue2/imgsynth2/cwindowsbitmap.h | |||
| @@ -1,22 +1,22 @@ | |||
| 1 | /** | 1 | /** |
| 2 | * @module cbitmap | 2 | * @module cwindowsbitmap |
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) |
| 4 | * @brief Implementation of CFile handling Windows Bitmaps. | 4 | * @brief Implementation of CBitmap handling Windows Bitmaps. |
| 5 | * @date 17.04.2009 | 5 | * @date 17.04.2009 |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #ifndef CBITMAP_H | 8 | #ifndef CWINDOWSBITMAP_H |
| 9 | #define CBITMAP_H | 9 | #define CWINDOWSBITMAP_H |
| 10 | 10 | ||
| 11 | #include <stdint.h> | 11 | #include <stdint.h> |
| 12 | #include "cfile.h" | 12 | #include "cbitmap.h" |
| 13 | 13 | ||
| 14 | class CPixelFormat; | 14 | class CPixelFormat; |
| 15 | #include "cpixelformat.h" | 15 | #include "cpixelformat.h" |
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 18 | * @class CBitmap | 18 | * @class CWindowsBitmap |
| 19 | * @brief Implementation of CFile handling Windows Bitmaps. | 19 | * @brief Implementation of CBitmap handling Windows Bitmaps. |
| 20 | * | 20 | * |
| 21 | * In order to support operations on bitmaps with different color bitcounts | 21 | * In order to support operations on bitmaps with different color bitcounts |
| 22 | * different implementations of CPixelFormat are used. These classes are | 22 | * different implementations of CPixelFormat are used. These classes are |
| @@ -24,11 +24,11 @@ class CPixelFormat; | |||
| 24 | * | 24 | * |
| 25 | * On error CFile::FileError is thrown. | 25 | * On error CFile::FileError is thrown. |
| 26 | */ | 26 | */ |
| 27 | class CBitmap : public CFile | 27 | class CWindowsBitmap : public CBitmap |
| 28 | { | 28 | { |
| 29 | public: | 29 | public: |
| 30 | /** | 30 | /** |
| 31 | * @method CBitmap | 31 | * @method CWindowsBitmap |
| 32 | * @brief Default ctor | 32 | * @brief Default ctor |
| 33 | * @param - | 33 | * @param - |
| 34 | * @return - | 34 | * @return - |
| @@ -36,10 +36,10 @@ class CBitmap : public CFile | |||
| 36 | * @exception none | 36 | * @exception none |
| 37 | * @conditions none | 37 | * @conditions none |
| 38 | */ | 38 | */ |
| 39 | CBitmap(); | 39 | CWindowsBitmap(); |
| 40 | 40 | ||
| 41 | /** | 41 | /** |
| 42 | * @method ~CBitmap | 42 | * @method ~CWindowsBitmap |
| 43 | * @brief Default dtor | 43 | * @brief Default dtor |
| 44 | * @param - | 44 | * @param - |
| 45 | * @return - | 45 | * @return - |
| @@ -47,7 +47,7 @@ class CBitmap : public CFile | |||
| 47 | * @exception none | 47 | * @exception none |
| 48 | * @conditions none | 48 | * @conditions none |
| 49 | */ | 49 | */ |
| 50 | ~CBitmap(); | 50 | ~CWindowsBitmap(); |
| 51 | 51 | ||
| 52 | /** | 52 | /** |
| 53 | * @method read | 53 | * @method read |
diff --git a/ue2/imgsynth2/x1 b/ue2/imgsynth2/x1 deleted file mode 100644 index 5593645..0000000 --- a/ue2/imgsynth2/x1 +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | 00000000 42 4d 8a 01 00 00 00 00 00 00 36 00 00 00 28 00 |BM........6...(.| | ||
| 2 | 00000010 00 00 09 00 00 00 11 00 00 00 01 00 10 00 00 00 |................| | ||
| 3 | 00000020 00 00 54 01 00 00 13 0b 00 00 13 0b 00 00 00 00 |..T.............| | ||
| 4 | 00000030 00 00 00 00 00 00 00 00 00 00 1f 00 1f 00 1f 00 |................| | ||
| 5 | 00000040 1f 00 1f 00 1f 00 1f 00 00 00 00 00 00 00 1f 00 |................| | ||
| 6 | 00000050 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 00 00 00 00 |................| | ||
| 7 | 00000060 00 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 |................| | ||
| 8 | 00000070 00 00 00 00 00 00 1f 00 1f 00 1f 00 1f 00 1f 00 |................| | ||
| 9 | 00000080 1f 00 1f 00 00 00 00 00 00 00 00 00 a0 7f 00 00 |................| | ||
| 10 | 00000090 a0 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 11 | 000000a0 a0 7f 00 00 a0 7f 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 12 | 000000b0 a0 7f 00 00 a0 7f a0 7f a0 7f 00 00 a0 7f 00 00 |................| | ||
| 13 | 000000c0 00 00 00 00 a0 7f 00 00 a0 7f a0 7f a0 7f 00 00 |................| | ||
| 14 | 000000d0 a0 7f 00 00 00 00 00 00 a0 7f 00 00 a0 7f a0 7f |................| | ||
| 15 | 000000e0 a0 7f 00 00 a0 7f 00 00 00 00 e0 03 e0 03 e0 03 |................| | ||
| 16 | 000000f0 e0 03 e0 03 e0 03 00 00 a0 7f 00 00 00 00 e0 03 |................| | ||
| 17 | 00000100 e0 03 e0 03 e0 03 e0 03 e0 03 a0 7f 00 00 00 00 |................| | ||
| 18 | 00000110 00 00 e0 03 e0 03 e0 03 e0 03 e0 03 e0 03 00 00 |................| | ||
| 19 | 00000120 00 00 00 00 00 00 e0 03 e0 03 e0 03 e0 03 e0 03 |................| | ||
| 20 | 00000130 e0 03 00 00 00 00 00 00 00 00 e0 03 e0 03 e0 03 |................| | ||
| 21 | 00000140 e0 03 e0 03 e0 03 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 22 | 00000150 00 00 00 00 a0 7f a0 7f a0 7f 00 00 00 00 00 00 |................| | ||
| 23 | 00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 24 | * | ||
| 25 | 00000180 00 00 00 00 00 00 00 00 00 00 |..........| | ||
| 26 | 0000018a | ||
diff --git a/ue2/imgsynth2/x2 b/ue2/imgsynth2/x2 deleted file mode 100644 index 26cbf82..0000000 --- a/ue2/imgsynth2/x2 +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | 00000000 42 4d 8a 01 00 00 00 00 00 00 36 00 00 00 28 00 |BM........6...(.| | ||
| 2 | 00000010 00 00 09 00 00 00 11 00 00 00 01 00 10 00 00 00 |................| | ||
| 3 | 00000020 00 00 54 01 00 00 13 0b 00 00 13 0b 00 00 00 00 |..T.............| | ||
| 4 | 00000030 00 00 00 00 00 00 00 00 00 00 1f 00 1f 00 1f 00 |................| | ||
| 5 | 00000040 1f 00 1f 00 1f 00 1f 00 00 00 00 00 00 00 1f 00 |................| | ||
| 6 | 00000050 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 00 00 00 00 |................| | ||
| 7 | 00000060 00 00 1f 00 1f 7f 1f 00 1f 7f 1f 00 1f 00 1f 00 |................| | ||
| 8 | 00000070 00 00 00 00 00 00 1f 00 1f 7f 1f 00 1f 7f 1f 00 |................| | ||
| 9 | 00000080 1f 00 1f 00 00 00 00 00 00 00 00 00 a0 7f 00 00 |................| | ||
| 10 | 00000090 a0 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 11 | 000000a0 a0 7f 00 00 a0 7f 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 12 | 000000b0 a0 7f 00 00 a0 7f a0 7f a0 7f 00 00 a0 7f 00 00 |................| | ||
| 13 | 000000c0 00 00 00 00 a0 7f 00 00 a0 7f a0 7f a0 7f 00 00 |................| | ||
| 14 | 000000d0 a0 7f 00 00 00 00 00 00 a0 7f 00 00 a0 7f a0 7f |................| | ||
| 15 | 000000e0 a0 7f 00 00 a0 7f 00 00 00 00 00 00 00 7f 00 00 |................| | ||
| 16 | 000000f0 00 7f 00 7f 00 7f 00 00 a0 7f 00 00 00 00 00 00 |................| | ||
| 17 | 00000100 00 00 00 7f 00 7f 00 7f 00 7f a0 7f 00 00 00 00 |................| | ||
| 18 | 00000110 00 00 00 00 00 00 00 00 00 00 00 7f 00 00 00 00 |................| | ||
| 19 | 00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 00 7f |................| | ||
| 20 | 00000130 00 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 21 | 00000140 00 7f 00 7f 00 7f 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 22 | 00000150 00 00 00 00 a0 7f a0 7f a0 7f 00 00 00 00 00 00 |................| | ||
| 23 | 00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 24 | * | ||
| 25 | 00000180 00 00 00 00 00 00 00 00 00 00 |..........| | ||
| 26 | 0000018a | ||
