support BIG_ENDIAN and jpeg output

This commit is contained in:
Dane Springmeyer 2009-11-02 20:55:26 +00:00
parent f8248faf4d
commit 878143960e

View file

@ -22,6 +22,8 @@
//$Id$
#include <mapnik/global.hpp>
extern "C"
{
#include <jpeglib.h>
@ -104,9 +106,15 @@ namespace mapnik {
int index=0;
for (int i=0;i<width;++i)
{
#ifdef MAPNIK_BIG_ENDIAN
row[index++]=(imageRow[i]>>24)&0xff;
row[index++]=(imageRow[i]>>16)&0xff;
row[index++]=(imageRow[i]>>8)&0xff;
#else
row[index++]=(imageRow[i])&0xff;
row[index++]=(imageRow[i]>>8)&0xff;
row[index++]=(imageRow[i]>>16)&0xff;
#endif
}
row_pointer[0] = &row[0];
(void) jpeg_write_scanlines(&cinfo, row_pointer, 1);