Overview

The CG Plug-in System Framework is a key component of the Vulkan-based high-performance CG Rendering Framework. It provides plug-in management and plug-in development standards that allows you to extend and enhance the capabilities of CG Kit, enabling easy and efficient development.
You need to perform the following operations:

What You Will Create

In this codelab, you will use the demo project to call the CG Kit APIs provided by Huawei. Through this demo project, you will:

What You Will Learn

Hardware Requirements

Software Requirements

Required Knowledge

To integrate HUAWEI CG Kit, you must complete the following preparations:

  1. Register as a developer.
  2. Create an App.
  3. Generate a signing certificate fingerprint.
  4. Configure the signing certificate fingerprint.
For details, please refer to CG Kit Development Guide.
  1. Create an Android Studio project.
  2. Modify the /app/build.gradle file to specify the C++ file for CMake building. Create the build dependencies of CMake in the /app/build.gradle file.
  3. Configure the NDK ABI filter.

  4. Copy libraries and header files.
    a) Download the CG Rendering Framework SDK package and Plug-in System Framework SDK package here.
    b) Download the Offline Super-Resolution plug-in SDK package here.
    c) Copy the header file in the CG Rendering Framework SDK package to the resource library.
    Copy the header file in the CG Rendering Framework SDK package to the src/cpp/include directory in Android Studio.

    d) Copy the .so files in the CG Rendering Framework SDK package and Plug-in System Framework SDK package to the resource library.
    Copy libs\arm64-v8a\libcgkit.so and libs\armeabi-v7a\libcgkit.so in the CG Rendering Framework SDK package to /libs/arm64-v8a and /libs/armeabi-v7a in Android Studio, respectively.
    Copy libs\arm64-v8a\libPluginInterface.so and libs\armeabi-v7a\libPluginInterface.so in the Plug-in System Framework SDK package to /libs/arm64-v8a and /libs/armeabi-v7a in Android Studio, respectively
    e) Copy the .so files in the Offline Super-Resolution plug-in SDK package and configuration files to the resource library.
    Copy libs\arm64-v8a\ libcgkit_plugin_offlineSupRes.so and pluginList in the Offline Super-Resolution plug-in SDK package to /libs/arm64-v8a and src/assets in Android Studio, respectively. (The Offline Super-Resolution plug-in supports only the arm64-v8a platform architecture.)
    Where:

    f) Overwrite the CMakeLists.txt file in app/src/main/cpp with the following code. The CGRenderingFramework folder name can be user-defined.
    cmake_minimum_required(VERSION 3.4.1) include_directories( ${CMAKE_SOURCE_DIR}/include/CGRenderingFramework ) include_directories( ${CMAKE_SOURCE_DIR}/include/MainApplication ${CMAKE_SOURCE_DIR}/include/OSRPlugin ) add_library( main-lib SHARED source/Main.cpp source/MainApplication.cpp source/OSRPlugin.cpp) ADD_LIBRARY( cgkit SHARED IMPORTED) set_target_properties(cgkit PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../../../libs/${ANDROID_ABI}/libcgkit.so ) SET( VULKAN_INCLUDE_DIR "$ENV{VULKAN_SDK}/include") #"${ANDROID_NDK}/sources/third_party/vulkan/src/include") include_directories(${VULKAN_INCLUDE_DIR}) SET( NATIVE_APP_GLUE_DIR "${ANDROID_NDK}/sources/android/native_app_glue") FILE( GLOB NATIVE_APP_GLUE_FILLES "${NATIVE_APP_GLUE_DIR}/*.c" "${NATIVE_APP_GLUE_DIR}/*.h") ADD_LIBRARY(native_app_glue STATIC ${NATIVE_APP_GLUE_FILLES}) TARGET_INCLUDE_DIRECTORIES( native_app_glue PUBLIC ${NATIVE_APP_GLUE_DIR}) find_library( log-lib log ) target_link_libraries( main-lib cgkit native_app_glue android ${log-lib} ) SET( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
  5. Click Sync Project with Gradle Files.
  1. Create a cubemap.