I *think* it looks like there's something similar going on inside QtMir (http://bazaar.launchpad.net/~mir-team/qtmir/trunk/view/head:/src/platforms/mirserver/screen.cpp#L60):
enum QImage::Format qImageFormatFromMirPixelFormat(MirPixelFormat mirPixelFormat) { switch (mirPixelFormat) { case mir_pixel_format_abgr_8888: if (isLittleEndian()) { // 0xRR,0xGG,0xBB,0xAA return QImage::Format_RGBA8888; } else { // 0xAA,0xBB,0xGG,0xRR qFatal("[mirserver QPA] " "Qt doesn't support mir_pixel_format_abgr_8888 in a big endian architecture"); } break; case mir_pixel_format_xbgr_8888: if (isLittleEndian()) { // 0xRR,0xGG,0xBB,0xXX return QImage::Format_RGBX8888; } else { // 0xXX,0xBB,0xGG,0xRR qFatal("[mirserver QPA] " "Qt doesn't support mir_pixel_format_xbgr_8888 in a big endian architecture"); } break; break; case mir_pixel_format_argb_8888: // 0xAARRGGBB return QImage::Format_ARGB32; break; case mir_pixel_format_xrgb_8888: // 0xffRRGGBB return QImage::Format_RGB32; break; case mir_pixel_format_bgr_888: qFatal("[mirserver QPA] Qt doesn't support mir_pixel_format_bgr_888"); break; default: qFatal("[mirserver QPA] Unknown mir pixel format"); break; } return QImage::Format_Invalid; }
I *think* it looks like there's something similar going on inside QtMir (http:// bazaar. launchpad. net/~mir- team/qtmir/ trunk/view/ head:/src/ platforms/ mirserver/ screen. cpp#L60):
enum QImage::Format qImageFormatFro mMirPixelFormat (MirPixelFormat mirPixelFormat) { format_ abgr_8888: :Format_ RGBA8888;
qFatal( "[mirserver QPA] "
"Qt doesn't support mir_pixel_ format_ abgr_8888 in a big endian architecture"); format_ xbgr_8888: :Format_ RGBX8888;
qFatal( "[mirserver QPA] "
"Qt doesn't support mir_pixel_ format_ xbgr_8888 in a big endian architecture"); format_ argb_8888: :Format_ ARGB32; format_ xrgb_8888: :Format_ RGB32; format_ bgr_888:
qFatal( "[mirserver QPA] Qt doesn't support mir_pixel_ format_ bgr_888" );
qFatal( "[mirserver QPA] Unknown mir pixel format"); :Format_ Invalid;
switch (mirPixelFormat) {
case mir_pixel_
if (isLittleEndian()) {
// 0xRR,0xGG,0xBB,0xAA
return QImage:
} else {
// 0xAA,0xBB,0xGG,0xRR
}
break;
case mir_pixel_
if (isLittleEndian()) {
// 0xRR,0xGG,0xBB,0xXX
return QImage:
} else {
// 0xXX,0xBB,0xGG,0xRR
}
break;
break;
case mir_pixel_
// 0xAARRGGBB
return QImage:
break;
case mir_pixel_
// 0xffRRGGBB
return QImage:
break;
case mir_pixel_
break;
default:
break;
}
return QImage:
}