diff options
Diffstat (limited to 'ue2/imgsynth2/cpixmap.h')
| -rw-r--r-- | ue2/imgsynth2/cpixmap.h | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/ue2/imgsynth2/cpixmap.h b/ue2/imgsynth2/cpixmap.h index 863cbd4..eb219aa 100644 --- a/ue2/imgsynth2/cpixmap.h +++ b/ue2/imgsynth2/cpixmap.h | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <stdint.h> | 11 | #include <stdint.h> |
| 12 | #include "cbitmap.h" | 12 | #include "cbitmap.h" |
| 13 | 13 | ||
| 14 | |||
| 15 | /** | 14 | /** |
| 16 | * @class CPixmap | 15 | * @class CPixmap |
| 17 | * @brief Implementation of CFile handling Pixmap file format. | 16 | * @brief Implementation of CFile handling Pixmap file format. |
| @@ -48,7 +47,7 @@ class CPixmap : public CBitmap | |||
| 48 | ~CPixmap() | 47 | ~CPixmap() |
| 49 | {} | 48 | {} |
| 50 | 49 | ||
| 51 | /** | 50 | /** |
| 52 | * @method read | 51 | * @method read |
| 53 | * @brief Reads Pixmap from filestream. | 52 | * @brief Reads Pixmap from filestream. |
| 54 | * On error an exception is thrown. | 53 | * On error an exception is thrown. |
| @@ -71,8 +70,8 @@ class CPixmap : public CBitmap | |||
| 71 | * @exception bad_alloc | 70 | * @exception bad_alloc |
| 72 | * @conditions none | 71 | * @conditions none |
| 73 | */ | 72 | */ |
| 74 | |||
| 75 | void write(std::ofstream& out, std::string& filename); | 73 | void write(std::ofstream& out, std::string& filename); |
| 74 | |||
| 76 | #ifdef DEBUG | 75 | #ifdef DEBUG |
| 77 | /** | 76 | /** |
| 78 | * @method dump | 77 | * @method dump |
| @@ -86,8 +85,6 @@ class CPixmap : public CBitmap | |||
| 86 | void dump(std::ostream& out); | 85 | void dump(std::ostream& out); |
| 87 | #endif | 86 | #endif |
| 88 | 87 | ||
| 89 | |||
| 90 | |||
| 91 | /** | 88 | /** |
| 92 | * @brief Pixmap Header structure | 89 | * @brief Pixmap Header structure |
| 93 | */ | 90 | */ |
| @@ -112,45 +109,56 @@ class CPixmap : public CBitmap | |||
| 112 | bool _XPMEXT; | 109 | bool _XPMEXT; |
| 113 | /* unchanged extension */ | 110 | /* unchanged extension */ |
| 114 | std::string extension; | 111 | std::string extension; |
| 115 | |||
| 116 | } PIXMAP_FILEHEADER; | 112 | } PIXMAP_FILEHEADER; |
| 117 | #pragma pack(pop) | 113 | #pragma pack(pop) |
| 118 | 114 | ||
| 119 | 115 | /* TODO */ | |
| 120 | const uint32_t getPixelDataSize() | 116 | const uint32_t getPixelDataSize() |
| 121 | { | 117 | { |
| 122 | return m_fileheader.xpmWidth * | 118 | return m_fileheader.xpmWidth * m_fileheader.xpmHeight * m_fileheader.nChar; |
| 123 | m_fileheader.xpmHeight * | ||
| 124 | m_fileheader.nChar; | ||
| 125 | } | 119 | } |
| 126 | 120 | ||
| 127 | 121 | /* TODO */ | |
| 128 | const uint32_t getHeight() | 122 | const uint32_t getHeight() |
| 129 | { | 123 | { |
| 130 | /* width and height can be negativ */ | 124 | /* width and height can be negativ */ |
| 131 | return m_fileheader.xpmHeight; | 125 | return m_fileheader.xpmHeight; |
| 132 | } | 126 | } |
| 133 | 127 | ||
| 128 | /* TODO */ | ||
| 134 | const uint32_t getWidth() | 129 | const uint32_t getWidth() |
| 135 | { | 130 | { |
| 136 | /* width and height can be negativ */ | 131 | /* width and height can be negativ */ |
| 137 | return m_fileheader.xpmWidth; | 132 | return m_fileheader.xpmWidth; |
| 138 | } | 133 | } |
| 139 | 134 | ||
| 135 | /** | ||
| 136 | * @method hasColorTable | ||
| 137 | * @brief Check if bitmap has a colortable | ||
| 138 | * (we don't support this yet for windows bitmaps) | ||
| 139 | * @param - | ||
| 140 | * @return true if bitmap has a colortable. false otherwise | ||
| 141 | * @globalvars none | ||
| 142 | * @exception none | ||
| 143 | * @conditions none | ||
| 144 | */ | ||
| 145 | const bool hasColorTable() | ||
| 146 | { | ||
| 147 | return true; | ||
| 148 | } | ||
| 140 | 149 | ||
| 150 | /* TODO */ | ||
| 141 | const bool isMirrored() | 151 | const bool isMirrored() |
| 142 | { | 152 | { |
| 143 | /* pixmap is never mirrored */ | 153 | /* pixmap is never mirrored */ |
| 144 | return false; | 154 | return false; |
| 145 | } | 155 | } |
| 146 | 156 | ||
| 147 | protected: | 157 | protected: |
| 148 | /* members */ | 158 | /* members */ |
| 149 | /** fileheader */ | 159 | /** fileheader */ |
| 150 | PIXMAP_FILEHEADER m_fileheader; | 160 | PIXMAP_FILEHEADER m_fileheader; |
| 151 | /** infoheader */ | 161 | /** infoheader */ |
| 152 | |||
| 153 | |||
| 154 | }; | 162 | }; |
| 155 | 163 | ||
| 156 | #endif | 164 | #endif |
