Effect::video() says which kind an effect is. The Add effect menu lists the two kinds in sections of their own, each scrolling on its own, and offers video effects only in a video project; a video stage carries a film icon in the chain and, in a still, is dimmed and skipped like a stage switched off. enabledStages takes whether the render is a video and is the one place that leaves video stages out of a still. --help groups the video effects under a heading of their own, --list-effects marks them, and a video effect given for a still is skipped with a warning. VideoEffect is the base every video effect builds on, and keeps the rules a moving stage has to follow: it takes one value from the shared rng, the same on every frame, and hands the effect steady and per-frame generators and loop-rounded time through a Moment, so a subclass writes only animate(). VHS tracking is the first, and the one to copy: the colour planes sway and shake and a tracking bar rolls down the picture. That motion moves out of channel split, which is an image effect again and renders stills exactly as before; forVideo() goes with it. Version 0.7.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
97 lines
3.7 KiB
CMake
97 lines
3.7 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(effector VERSION 0.7.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)
|
|
|
|
# --- version: the one number, and the changelog that goes with it ------------
|
|
# The version is the project() line above; each release is a vX.Y.Z tag on the
|
|
# commit that set it. CHANGELOG.md is baked in so the interface can show it,
|
|
# and editing it re-runs the configure step.
|
|
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md EFFECTOR_CHANGELOG)
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS CHANGELOG.md)
|
|
configure_file(src/core/version.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/generated/core/version.hpp @ONLY)
|
|
|
|
# --- 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/memory.cpp
|
|
src/core/params.cpp
|
|
src/core/project.cpp
|
|
src/core/registry.cpp
|
|
src/core/rng.cpp
|
|
src/core/style.cpp
|
|
src/core/video.cpp
|
|
src/effects/bitcrush.cpp
|
|
src/effects/blur.cpp
|
|
src/effects/channelsplit.cpp
|
|
src/effects/corrupt.cpp
|
|
src/effects/feedback.cpp
|
|
src/effects/grain.cpp
|
|
src/effects/monochrome.cpp
|
|
src/effects/overlay.cpp
|
|
src/effects/pixelsort.cpp
|
|
src/effects/scanlines.cpp
|
|
src/effects/shatter.cpp
|
|
src/effects/slitshift.cpp
|
|
src/effects/text.cpp
|
|
src/effects/tiles.cpp
|
|
src/effects/tracking.cpp
|
|
src/effects/video_effect.cpp
|
|
src/effects/warp.cpp
|
|
)
|
|
target_include_directories(effector_core PUBLIC src ${CMAKE_CURRENT_BINARY_DIR}/generated)
|
|
# 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)
|
|
|
|
# --- interface: the GTK window, split out so the GUI tests can link it --------
|
|
add_library(effector_gui STATIC
|
|
src/cli/options.cpp
|
|
src/gui/app.cpp
|
|
src/gui/window.cpp
|
|
)
|
|
target_link_libraries(effector_gui PUBLIC effector_core PkgConfig::GTKMM)
|
|
target_compile_options(effector_gui PRIVATE -Wall -Wextra -Wpedantic)
|
|
# Where a build that was never installed finds its own icon (see app.cpp).
|
|
target_compile_definitions(effector_gui PRIVATE
|
|
EFFECTOR_SOURCE_ICON_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data/icons")
|
|
|
|
# --- application --------------------------------------------------------------
|
|
add_executable(effector src/main.cpp)
|
|
target_link_libraries(effector PRIVATE effector_gui)
|
|
target_compile_options(effector PRIVATE -Wall -Wextra -Wpedantic)
|
|
|
|
install(TARGETS effector RUNTIME DESTINATION bin)
|
|
# The launcher entry, so the interface shows up in the desktop's app menu.
|
|
install(FILES data/org.effector.Effector.desktop DESTINATION share/applications)
|
|
# The icon it names, in full colour and as a one-colour symbolic for panels.
|
|
install(DIRECTORY data/icons/hicolor DESTINATION share/icons)
|
|
|
|
# --- tests --------------------------------------------------------------------
|
|
include(CTest)
|
|
if(BUILD_TESTING)
|
|
add_subdirectory(tests)
|
|
endif()
|