BMPWriter.h

Go to the documentation of this file.
00001 #ifndef BMPWRITER_H
00002 #define BMPWRITER_H
00003 
00004 #include "MercuryString.h"
00005 #include "MercuryTexture.h"
00006 
00007 struct BMPHeader //size 14
00008 {
00009     char ID[2];
00010     unsigned int fileSize;
00011     unsigned int reserved;
00012     unsigned int offset;
00013 };
00014 
00015 struct BMPInfoHeader //size 40
00016 {
00017     unsigned int headerSize;
00018     unsigned int width;
00019     unsigned int height;
00020     short planes;
00021     short bbp;
00022     int compression;
00023     unsigned int imagesize;
00024     int resx; //pix per meter
00025     int resy; //pic per meter
00026     unsigned int numColor;
00027     unsigned int importantColor;
00028 };
00029 
00030 void WriteBMP(const MString& path, const RawImageData& image);
00031 
00032 #endif
00033 
00034 /* 
00035  * Copyright (c) 2006 Joshua Allen
00036  * All rights reserved.
00037  *
00038  * Redistribution and use in source and binary forms, with or
00039  * without modification, are permitted provided that the following
00040  * conditions are met:
00041  *  -   Redistributions of source code must retain the above
00042  *      copyright notice, this list of conditions and the following disclaimer.
00043  *  -   Redistributions in binary form must reproduce the above copyright
00044  *      notice, this list of conditions and the following disclaimer in
00045  *      the documentation and/or other materials provided with the distribution.
00046  *  -   Neither the name of the Mercury Engine nor the names of its
00047  *      contributors may be used to endorse or promote products derived from
00048  *      this software without specific prior written permission.
00049  *
00050  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00051  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00052  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00053  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
00054  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00055  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00056  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00057  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00058  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00059  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00060  */

Hosted by SourceForge.net Logo