mImpl->SetSource( source );
}
+bool NativeImageSource::IsColorDepthSupported( ColorDepth colorDepth )
+{
+ return mImpl->IsColorDepthSupported( colorDepth );
+}
+
bool NativeImageSource::GlExtensionCreate()
{
return mImpl->GlExtensionCreate();
*/
void SetSource( Any source );
+ /**
+ * @brief Check if the specified color depth is supported.
+ *
+ * @SINCE_1_1.34
+ * @param[in] colorDepth The color depth to check.
+ * @return true if colorDepth is supported, false otherwise.
+ */
+ bool IsColorDepthSupported( ColorDepth colorDepth );
+
private: // native image
/**
}
}
+bool NativeImageSource::IsColorDepthSupported( Dali::NativeImageSource::ColorDepth colorDepth )
+{
+ uint32_t* formats;
+ uint32_t formatNum;
+ tbm_format format = TBM_FORMAT_RGB888;
+
+ switch( colorDepth )
+ {
+ case Dali::NativeImageSource::COLOR_DEPTH_DEFAULT:
+ {
+ format = TBM_FORMAT_RGBA8888;
+ break;
+ }
+ case Dali::NativeImageSource::COLOR_DEPTH_8:
+ {
+ format = TBM_FORMAT_C8;
+ break;
+ }
+ case Dali::NativeImageSource::COLOR_DEPTH_16:
+ {
+ format = TBM_FORMAT_RGB565;
+ break;
+ }
+ case Dali::NativeImageSource::COLOR_DEPTH_24:
+ {
+ format = TBM_FORMAT_RGB888;
+ break;
+ }
+ case Dali::NativeImageSource::COLOR_DEPTH_32:
+ {
+ format = TBM_FORMAT_RGBA8888;
+ break;
+ }
+ }
+
+ if( tbm_surface_query_formats( &formats, &formatNum ) )
+ {
+ for( unsigned int i = 0; i < formatNum; i++ )
+ {
+ if( formats[i] == format )
+ {
+ free( formats );
+ return true;
+ }
+ }
+ }
+
+ free( formats );
+ return false;
+}
+
bool NativeImageSource::GlExtensionCreate()
{
if( mEglImageKHR != NULL )