ASTC can be wrapped in a KTX file, but also has its own native file format.
This patch provides support for the native ASTC file format (.astc).
Textures can be generated using tools (Eg. Mali texture compression tool).
Note: ASTC is "OpenGL friendly" in that the textures are pre-flipped vertically.
In DALi there is currently not a differenciation between different texture compression formats in that the data (once the header is extracted) is given to the hardware as-is.
For this reason textures must currently be pre-flipped vertically (before compression) when using the native .astc file format with DALI.
An example .astc file is included as part of the unit tests.
Change-Id: I78025f11f9aed23ed9ccf369057ce9c5f3a65fca
TestPixelEnumSize( 54 );
+ DALI_TEST_CHECK( Pixel::HasAlpha( Pixel::INVALID ) == false ); // For completeness
+
DALI_TEST_CHECK( Pixel::HasAlpha( Pixel::L8 ) == false );
DALI_TEST_CHECK( Pixel::HasAlpha( Pixel::RGB565 ) == false );
DALI_TEST_CHECK( Pixel::HasAlpha( Pixel::RGB888 ) == false );
tet_infoline("UtcDaliPixelGetBytesPerPixel");
+ DALI_TEST_CHECK( Pixel::GetBytesPerPixel( Pixel::INVALID ) == 0 ); // For completeness
+
DALI_TEST_CHECK( Pixel::GetBytesPerPixel( Pixel::L8 ) == 1 );
DALI_TEST_CHECK( Pixel::GetBytesPerPixel( Pixel::A8 ) == 1 );
// Be sure that the number of cases tested below is correct:
TestPixelEnumSize( 54 );
+ Pixel::GetAlphaOffsetAndMask( Pixel::INVALID, byteOffset, bitMask ); // For completeness
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+
Pixel::GetAlphaOffsetAndMask( Pixel::L8, byteOffset, bitMask );
DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
Pixel::GetAlphaOffsetAndMask( Pixel::A8, byteOffset, bitMask );
internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;
break;
}
+
+ case INVALID:
+ {
+ DALI_LOG_ERROR( "Invalid pixel format for bitmap\n" );
+ internalFormat = 0;
+ break;
+ }
}
}
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 COMPRESSED_SRGB8_ETC2:
case COMPRESSED_RGB8_ETC1:
case COMPRESSED_RGB_PVRTC_4BPPV1:
+ case INVALID:
{
return false;
}
case COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
case COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
case COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
+ case INVALID:
{
DALI_LOG_ERROR("Pixel formats for compressed images do not have meaningful integer bits per pixel values.\n");
return 0;
case COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
case COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
case COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
+ case INVALID:
{
DALI_LOG_ERROR("Pixel formats for compressed images are not compatible with simple masking-out of per-pixel alpha.\n");
byteOffset=0;
*/
enum Format ///< pixel format, default color depth is RGBA 32 bit with alpha
{
+ INVALID = 0,
+
// Start at > 0 to distinguish null data:
A8 = 1, ///< color depth 8-bit, alpha
L8, ///< color depth 8-bit, luminance