diff options
Diffstat (limited to 'ue2/imgsynth2/cwindowsbitmap.h')
| -rw-r--r-- | ue2/imgsynth2/cwindowsbitmap.h | 129 |
1 files changed, 50 insertions, 79 deletions
diff --git a/ue2/imgsynth2/cwindowsbitmap.h b/ue2/imgsynth2/cwindowsbitmap.h index 9fb40db..28eb88d 100644 --- a/ue2/imgsynth2/cwindowsbitmap.h +++ b/ue2/imgsynth2/cwindowsbitmap.h | |||
| @@ -60,14 +60,13 @@ class CWindowsBitmap : public CBitmap | |||
| 60 | * @method write | 60 | * @method write |
| 61 | * @brief Writes Windows Bitmap to filestream. | 61 | * @brief Writes Windows Bitmap to filestream. |
| 62 | * @param out filestream to read data from | 62 | * @param out filestream to read data from |
| 63 | * @param filename filename (maybe useful for some handlers) | ||
| 64 | * @return - | 63 | * @return - |
| 65 | * @globalvars none | 64 | * @globalvars none |
| 66 | * @exception FileError | 65 | * @exception FileError |
| 67 | * @exception bad_alloc | 66 | * @exception bad_alloc |
| 68 | * @conditions none | 67 | * @conditions none |
| 69 | */ | 68 | */ |
| 70 | void write(std::ofstream& out, std::string& filename); | 69 | void write(std::ofstream& out); |
| 71 | 70 | ||
| 72 | #ifdef DEBUG | 71 | #ifdef DEBUG |
| 73 | /** | 72 | /** |
| @@ -83,83 +82,6 @@ class CWindowsBitmap : public CBitmap | |||
| 83 | #endif | 82 | #endif |
| 84 | 83 | ||
| 85 | /** | 84 | /** |
| 86 | * @brief Windows Bitmap File Header structure | ||
| 87 | */ | ||
| 88 | #pragma pack(push,1) | ||
| 89 | typedef struct | ||
| 90 | { | ||
| 91 | /** the magic number used to identify the BMP file */ | ||
| 92 | uint8_t bfType[2]; | ||
| 93 | /** the size of the BMP file in bytes */ | ||
| 94 | uint32_t bfSize; | ||
| 95 | /** reserved */ | ||
| 96 | uint32_t bfReserved; | ||
| 97 | /** the offset of the byte where the bitmap data can be found */ | ||
| 98 | uint32_t bfOffBits; | ||
| 99 | } BITMAP_FILEHEADER; | ||
| 100 | #pragma pack(pop) | ||
| 101 | |||
| 102 | /** | ||
| 103 | * @brief Windows Bitmap Info Header structure | ||
| 104 | */ | ||
| 105 | #pragma pack(push,1) | ||
| 106 | typedef struct | ||
| 107 | { | ||
| 108 | /** the size of this header (40 bytes) */ | ||
| 109 | uint32_t biSize; | ||
| 110 | /** the bitmap width in pixels (signed integer) */ | ||
| 111 | int32_t biWidth; | ||
| 112 | /** the bitmap height in pixels (signed integer) */ | ||
| 113 | int32_t biHeight; | ||
| 114 | /** the number of color planes being used. Must be set to 1 */ | ||
| 115 | uint16_t biPlanes; | ||
| 116 | /** the number of bits per pixel, which is the color depth of the image */ | ||
| 117 | uint16_t biBitCount; | ||
| 118 | /** the compression method being used */ | ||
| 119 | uint32_t biCompression; | ||
| 120 | /** the image size */ | ||
| 121 | uint32_t biSizeImage; | ||
| 122 | /** the horizontal resolution of the image (pixel per meter) */ | ||
| 123 | int32_t biXPelsPerMeter; | ||
| 124 | /** the vertical resolution of the image (pixel per meter) */ | ||
| 125 | int32_t biYPelsPerMeter; | ||
| 126 | /** the number of colors in the color palette, or 0 to default to 2^n */ | ||
| 127 | uint32_t biClrUsed; | ||
| 128 | /** the number of important colors used, or 0 when every color is | ||
| 129 | * important; generally ignored. */ | ||
| 130 | uint32_t biClrImportant; | ||
| 131 | } BITMAP_INFOHEADER; | ||
| 132 | #pragma pack(pop) | ||
| 133 | |||
| 134 | /** | ||
| 135 | * @method getFileHeader | ||
| 136 | * @brief Returns reference to fileheader structure of bitmap | ||
| 137 | * @param - | ||
| 138 | * @return reference to fileheader structure | ||
| 139 | * @globalvars none | ||
| 140 | * @exception none | ||
| 141 | * @conditions none | ||
| 142 | */ | ||
| 143 | BITMAP_FILEHEADER &getFileHeader() | ||
| 144 | { | ||
| 145 | return m_fileheader; | ||
| 146 | } | ||
| 147 | |||
| 148 | /** | ||
| 149 | * @method getInfoHeader | ||
| 150 | * @brief Returns reference to infoheader structure of bitmap | ||
| 151 | * @param - | ||
| 152 | * @return reference to infoheader structure | ||
| 153 | * @globalvars none | ||
| 154 | * @exception none | ||
| 155 | * @conditions none | ||
| 156 | */ | ||
| 157 | BITMAP_INFOHEADER &getInfoHeader() | ||
| 158 | { | ||
| 159 | return m_infoheader; | ||
| 160 | } | ||
| 161 | |||
| 162 | /** | ||
| 163 | * @method getPixelDataSize | 85 | * @method getPixelDataSize |
| 164 | * @brief Return size of pixelbuffer | 86 | * @brief Return size of pixelbuffer |
| 165 | * @param - | 87 | * @param - |
| @@ -234,6 +156,55 @@ class CWindowsBitmap : public CBitmap | |||
| 234 | } | 156 | } |
| 235 | 157 | ||
| 236 | protected: | 158 | protected: |
| 159 | /** | ||
| 160 | * @brief Windows Bitmap File Header structure | ||
| 161 | */ | ||
| 162 | #pragma pack(push,1) | ||
| 163 | typedef struct | ||
| 164 | { | ||
| 165 | /** the magic number used to identify the BMP file */ | ||
| 166 | uint8_t bfType[2]; | ||
| 167 | /** the size of the BMP file in bytes */ | ||
| 168 | uint32_t bfSize; | ||
| 169 | /** reserved */ | ||
| 170 | uint32_t bfReserved; | ||
| 171 | /** the offset of the byte where the bitmap data can be found */ | ||
| 172 | uint32_t bfOffBits; | ||
| 173 | } BITMAP_FILEHEADER; | ||
| 174 | #pragma pack(pop) | ||
| 175 | |||
| 176 | /** | ||
| 177 | * @brief Windows Bitmap Info Header structure | ||
| 178 | */ | ||
| 179 | #pragma pack(push,1) | ||
| 180 | typedef struct | ||
| 181 | { | ||
| 182 | /** the size of this header (40 bytes) */ | ||
| 183 | uint32_t biSize; | ||
| 184 | /** the bitmap width in pixels (signed integer) */ | ||
| 185 | int32_t biWidth; | ||
| 186 | /** the bitmap height in pixels (signed integer) */ | ||
| 187 | int32_t biHeight; | ||
| 188 | /** the number of color planes being used. Must be set to 1 */ | ||
| 189 | uint16_t biPlanes; | ||
| 190 | /** the number of bits per pixel, which is the color depth of the image */ | ||
| 191 | uint16_t biBitCount; | ||
| 192 | /** the compression method being used */ | ||
| 193 | uint32_t biCompression; | ||
| 194 | /** the image size */ | ||
| 195 | uint32_t biSizeImage; | ||
| 196 | /** the horizontal resolution of the image (pixel per meter) */ | ||
| 197 | int32_t biXPelsPerMeter; | ||
| 198 | /** the vertical resolution of the image (pixel per meter) */ | ||
| 199 | int32_t biYPelsPerMeter; | ||
| 200 | /** the number of colors in the color palette, or 0 to default to 2^n */ | ||
| 201 | uint32_t biClrUsed; | ||
| 202 | /** the number of important colors used, or 0 when every color is | ||
| 203 | * important; generally ignored. */ | ||
| 204 | uint32_t biClrImportant; | ||
| 205 | } BITMAP_INFOHEADER; | ||
| 206 | #pragma pack(pop) | ||
| 207 | |||
| 237 | /* members */ | 208 | /* members */ |
| 238 | /** fileheader */ | 209 | /** fileheader */ |
| 239 | BITMAP_FILEHEADER m_fileheader; | 210 | BITMAP_FILEHEADER m_fileheader; |
