// Copyright (c) 2012-2014 The CEF Python authors. All rights reserved.
// License: New BSD License.
// Website: http://code.google.com/p/cefpython/
#pragma once
// OS_WIN is not defined on Windows when CEF is not included.
// _WIN32 is defined on both 32bit and 64bit.
#if defined(_WIN32)
#include "windows.h"
#include "stdint_win.h"
#include
#else
#include
#include
#endif
void FlipBufferUpsideDown(void* _dest, const void* _src, int width, int height \
) {
// In CEF the buffer passed to Browser.GetImage() & RenderHandler.OnPaint()
// has upper-left origin, but some libraries like Panda3D require
// bottom-left origin.
int32_t* dest = (int32_t*)_dest;
int32_t* src = (int32_t*)_src;
unsigned int tb;
int length = width*height;
for (int y = 0; y > 16 // Red >> Blue.
| (bgra & 0xff00ff00) // Green Alpha.
| (bgra & 0x000000ff) > Red.
dest[i] = rgba;
}
}