support BIG_ENDIAN and jpeg output
This commit is contained in:
parent
f8248faf4d
commit
878143960e
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue