A picture with a title, a caption and a credit meant typing the same font, size and colour into every text stage, and changing the look meant typing them all again. A project now holds named styles: a stage follows one, and editing it moves every stage that follows it at once. The front-ends learn nothing effect-specific. A ParamSpec can be marked .styled(), saying a style carries it rather than the stage, and Effect::styleKind() names the pool it comes from -- so styleSpecs(kind) is to a style what params() is to a stage, and a second text-ish effect would slot into the styles that already exist. The look is what a style carries; the words and the placement stay on the stage, which is what lets two stages share a typography in two different corners. stageValues() resolves one in a single place, and a stage keeps a full set of values of its own beside the style, so switching it to Custom, dropping the style, or opening the project in a build that does not know it renders exactly the same picture. A style moves stages together; it never holds the only copy of anything. The command line builds no styles and passes none, so it renders what it always did. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
66 lines
2.1 KiB
CMake
66 lines
2.1 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(effector VERSION 0.1.0 LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
|
endif()
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(GTKMM REQUIRED IMPORTED_TARGET gtkmm-4.0)
|
|
pkg_check_modules(GDKPIXBUF REQUIRED IMPORTED_TARGET gdk-pixbuf-2.0)
|
|
# Pango and Cairo draw the text effect's glyphs. Neither needs a display, so
|
|
# the core stays headless.
|
|
pkg_check_modules(PANGOCAIRO REQUIRED IMPORTED_TARGET pangocairo)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
# --- core: effects and image handling, no GUI ---------------------------------
|
|
add_library(effector_core STATIC
|
|
src/core/canvas.cpp
|
|
src/core/chain.cpp
|
|
src/core/effect.cpp
|
|
src/core/image.cpp
|
|
src/core/params.cpp
|
|
src/core/project.cpp
|
|
src/core/registry.cpp
|
|
src/core/rng.cpp
|
|
src/core/style.cpp
|
|
src/effects/blur.cpp
|
|
src/effects/grain.cpp
|
|
src/effects/monochrome.cpp
|
|
src/effects/overlay.cpp
|
|
src/effects/scanlines.cpp
|
|
src/effects/text.cpp
|
|
src/effects/tiles.cpp
|
|
)
|
|
target_include_directories(effector_core PUBLIC src)
|
|
# The core is GUI-free: it only needs gdk-pixbuf for decoding and encoding,
|
|
# so headless rendering works without a display.
|
|
target_link_libraries(effector_core PUBLIC PkgConfig::GDKPIXBUF PkgConfig::PANGOCAIRO Threads::Threads)
|
|
target_compile_options(effector_core PRIVATE -Wall -Wextra -Wpedantic)
|
|
|
|
# --- application --------------------------------------------------------------
|
|
add_executable(effector
|
|
src/main.cpp
|
|
src/cli/options.cpp
|
|
src/gui/app.cpp
|
|
src/gui/window.cpp
|
|
)
|
|
target_link_libraries(effector PRIVATE effector_core PkgConfig::GTKMM)
|
|
target_compile_options(effector PRIVATE -Wall -Wextra -Wpedantic)
|
|
|
|
install(TARGETS effector RUNTIME DESTINATION bin)
|
|
|
|
# --- tests --------------------------------------------------------------------
|
|
include(CTest)
|
|
if(BUILD_TESTING)
|
|
add_subdirectory(tests)
|
|
endif()
|