Skip to content

AFormattedColorConverter#

Unlike AColor, this type is not universal and has a format and thus may be used in performance critical code.

Header:#include <AUI/Image/APixelFormat.h>
CMake:aui_link(my_target PUBLIC aui::image)

Examples#

examples/app/game_of_life/src/main.cpp

Game of Life - Game of Life implementation that uses advanced large dynamic data rendering techniques such as ITexture, AImage to be GPU friendly. The computation is performed in AThreadPool.

        for (unsigned y = 0; y < image.height(); ++y) {
            for (unsigned x = 0; x < image.width(); ++x) {
                image.set(
                    { x, y },
                    AFormattedColorConverter(
                        (*mCells)[glm::ivec2(x, y)] == CellState::ALIVE
                            ? AColor::WHITE
                            : AColor::TRANSPARENT_BLACK));
            }
        }