- switch( pixelFormat )
- {
- case Dali::Pixel::A8:
- case Dali::Pixel::L8:
- case Dali::Pixel::LA88:
- {
- byteOffset = 0;
- bitMask = 0;
- break;
- }
- case Dali::Pixel::RGB888:
- case Dali::Pixel::RGB8888:
- case Dali::Pixel::RGBA8888:
- {
- byteOffset = 0;
- bitMask = 0xFF;
- break;
- }
- case Dali::Pixel::BGR8888:
- case Dali::Pixel::BGRA8888:
- {
- byteOffset = 2;
- bitMask = 0xff;
- break;
- }
- case Dali::Pixel::RGB565:
- {
- byteOffset = 0;
- bitMask = 0xf8;
- break;
- }
- case Dali::Pixel::BGR565:
- {
- byteOffset = 1;
- bitMask = 0x1f;
- break;
- }
- case Dali::Pixel::RGBA4444:
- {
- byteOffset = 0;
- bitMask = 0xf0;
- break;
- }
- case Dali::Pixel::BGRA4444:
- {
- byteOffset = 1;
- bitMask = 0xf0;
- break;
- }
- case Dali::Pixel::RGBA5551:
- {
- byteOffset = 0;
- bitMask = 0xf8;
- break;
- }
- case Dali::Pixel::BGRA5551:
- {
- byteOffset = 1;
- bitMask = 0x1e;
- break;
- }
- case Dali::Pixel::INVALID:
- case Dali::Pixel::COMPRESSED_R11_EAC:
- case Dali::Pixel::COMPRESSED_SIGNED_R11_EAC:
- case Dali::Pixel::COMPRESSED_RG11_EAC:
- case Dali::Pixel::COMPRESSED_SIGNED_RG11_EAC:
- case Dali::Pixel::COMPRESSED_RGB8_ETC2:
- case Dali::Pixel::COMPRESSED_SRGB8_ETC2:
- case Dali::Pixel::COMPRESSED_RGB8_ETC1:
- case Dali::Pixel::COMPRESSED_RGB_PVRTC_4BPPV1:
- case Dali::Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
- case Dali::Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
- case Dali::Pixel::COMPRESSED_RGBA8_ETC2_EAC:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
- {
- DALI_LOG_ERROR("Pixel formats for compressed images are not compatible with simple masking-out of per-pixel alpha.\n");
- byteOffset=0;
- bitMask=0;
- break;
- }
- case Dali::Pixel::RGB16F:
- case Dali::Pixel::RGB32F:
- case Dali::Pixel::DEPTH_UNSIGNED_INT:
- case Dali::Pixel::DEPTH_FLOAT:
- case Dali::Pixel::DEPTH_STENCIL:
- {
- DALI_LOG_ERROR("Pixel format not compatible.\n");
- byteOffset=0;
- bitMask=0;
- break;
- }
- }