├── src ├── mixer3 │ ├── CMakeLists.txt │ └── RGB │ │ └── CMakeLists.txt ├── filter │ ├── bw0r │ │ ├── bw0r_pre.jpg │ │ ├── bw0r_post.jpg │ │ ├── CMakeLists.txt │ │ └── bw0r.c │ ├── elastic_scale │ │ ├── img1.jpg │ │ ├── img2.jpg │ │ ├── img3.jpg │ │ ├── CMakeLists.txt │ │ └── README.md │ ├── tehroxx0r │ │ ├── tehroxx0r.jpg │ │ └── CMakeLists.txt │ ├── distort0r │ │ ├── distort0r_pre.jpg │ │ ├── distort0r_post.jpg │ │ └── CMakeLists.txt │ ├── invert0r │ │ ├── invert0r_post.jpg │ │ ├── invert0r_pre.jpg │ │ ├── CMakeLists.txt │ │ └── invert0r.c │ ├── pixeliz0r │ │ ├── pixeliz0r_pre.jpg │ │ ├── pixeliz0r_post.jpg │ │ └── CMakeLists.txt │ ├── kaleid0sc0pe │ │ ├── colorful_stones-400.jpg │ │ ├── colorful_stones-tr16-400.jpg │ │ ├── new-years-day-2024-source-480.jpg │ │ ├── kaleid0sc0pe.xml │ │ └── CMakeLists.txt │ ├── glow │ │ └── CMakeLists.txt │ ├── pixs0r │ │ └── CMakeLists.txt │ ├── sobel │ │ ├── CMakeLists.txt │ │ └── sobel.cpp │ ├── water │ │ └── CMakeLists.txt │ ├── aech0r │ │ └── CMakeLists.txt │ ├── baltan │ │ └── CMakeLists.txt │ ├── cluster │ │ └── CMakeLists.txt │ ├── dither │ │ └── CMakeLists.txt │ ├── emboss │ │ └── CMakeLists.txt │ ├── flippo │ │ └── CMakeLists.txt │ ├── tint0r │ │ └── CMakeLists.txt │ ├── vertigo │ │ └── CMakeLists.txt │ ├── 3dflippo │ │ └── CMakeLists.txt │ ├── balanc0r │ │ └── CMakeLists.txt │ ├── cartoon │ │ └── CMakeLists.txt │ ├── colorize │ │ └── CMakeLists.txt │ ├── colortap │ │ └── CMakeLists.txt │ ├── delay0r │ │ ├── CMakeLists.txt │ │ └── delay0r.cpp │ ├── edgeglow │ │ └── CMakeLists.txt │ ├── filmgrain │ │ └── CMakeLists.txt │ ├── gateweave │ │ └── CMakeLists.txt │ ├── glitch0r │ │ └── CMakeLists.txt │ ├── heatmap0r │ │ └── CMakeLists.txt │ ├── luminance │ │ └── CMakeLists.txt │ ├── mask0mate │ │ └── CMakeLists.txt │ ├── nervous │ │ └── CMakeLists.txt │ ├── nosync0r │ │ ├── CMakeLists.txt │ │ └── nosync0r.cpp │ ├── posterize │ │ └── CMakeLists.txt │ ├── saturat0r │ │ └── CMakeLists.txt │ ├── select0r │ │ └── CMakeLists.txt │ ├── sharpness │ │ └── CMakeLists.txt │ ├── softglow │ │ └── CMakeLists.txt │ ├── sopsat │ │ └── CMakeLists.txt │ ├── twolay0r │ │ ├── CMakeLists.txt │ │ └── twolay0r.cpp │ ├── autothresh0ld │ │ ├── CMakeLists.txt │ │ └── variance.h │ ├── brightness │ │ └── CMakeLists.txt │ ├── c0rners │ │ └── CMakeLists.txt │ ├── contrast0r │ │ └── CMakeLists.txt │ ├── curves │ │ └── CMakeLists.txt │ ├── delaygrab │ │ └── CMakeLists.txt │ ├── equaliz0r │ │ └── CMakeLists.txt │ ├── normaliz0r │ │ └── CMakeLists.txt │ ├── primaries │ │ ├── CMakeLists.txt │ │ └── primaries.cpp │ ├── rgbsplit0r │ │ └── CMakeLists.txt │ ├── scanline0r │ │ ├── CMakeLists.txt │ │ └── scanline0r.cpp │ ├── squareblur │ │ ├── CMakeLists.txt │ │ └── squareblur.c │ ├── threelay0r │ │ ├── CMakeLists.txt │ │ └── threelay0r.cpp │ ├── vignette │ │ └── CMakeLists.txt │ ├── bgsubtract0r │ │ └── CMakeLists.txt │ ├── letterb0xed │ │ └── CMakeLists.txt │ ├── perspective │ │ └── CMakeLists.txt │ ├── spillsupress │ │ └── CMakeLists.txt │ ├── threshold0r │ │ └── CMakeLists.txt │ ├── transparency │ │ └── CMakeLists.txt │ ├── bluescreen0r │ │ └── CMakeLists.txt │ ├── colordistance │ │ └── CMakeLists.txt │ ├── colorhalftone │ │ └── CMakeLists.txt │ ├── keyspillm0pup │ │ └── CMakeLists.txt │ ├── lenscorrection │ │ └── CMakeLists.txt │ ├── host_param_test │ │ └── CMakeLists.txt │ ├── medians │ │ └── CMakeLists.txt │ ├── ntsc │ │ └── CMakeLists.txt │ ├── sigmoidaltransfer │ │ └── CMakeLists.txt │ ├── gamma │ │ └── CMakeLists.txt │ ├── colgate │ │ └── CMakeLists.txt │ ├── blur │ │ └── CMakeLists.txt │ ├── rgbnoise │ │ └── CMakeLists.txt │ ├── coloradj │ │ ├── CMakeLists.txt │ │ └── readme │ ├── defish0r │ │ └── CMakeLists.txt │ ├── denoise │ │ ├── CMakeLists.txt │ │ └── README │ ├── hueshift0r │ │ └── CMakeLists.txt │ ├── premultiply │ │ ├── CMakeLists.txt │ │ └── premultiply.cpp │ ├── lightgraffiti │ │ └── CMakeLists.txt │ ├── d90stairsteppingfix │ │ └── CMakeLists.txt │ ├── mirr0r │ │ └── CMakeLists.txt │ ├── scale0tilt │ │ └── CMakeLists.txt │ ├── cairogradient │ │ └── CMakeLists.txt │ ├── levels │ │ └── CMakeLists.txt │ ├── cairoimagegrid │ │ └── CMakeLists.txt │ ├── rgbparade │ │ └── CMakeLists.txt │ ├── vectorscope │ │ └── CMakeLists.txt │ ├── ndvi │ │ └── CMakeLists.txt │ ├── three_point_balance │ │ └── CMakeLists.txt │ ├── timeout │ │ └── CMakeLists.txt │ ├── tutorial │ │ └── CMakeLists.txt │ ├── measure │ │ └── CMakeLists.txt │ ├── RGB │ │ ├── CMakeLists.txt │ │ ├── B.c │ │ ├── R.c │ │ └── G.c │ ├── facebl0r │ │ └── CMakeLists.txt │ ├── facedetect │ │ └── CMakeLists.txt │ └── alpha0ps │ │ └── CMakeLists.txt ├── generator │ ├── ising0r │ │ ├── ising0r.jpg │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── dem0scene │ │ └── CMakeLists.txt │ ├── nois0r │ │ ├── CMakeLists.txt │ │ └── nois0r.cpp │ ├── onecol0r │ │ ├── CMakeLists.txt │ │ └── onecol0r.cpp │ ├── partik0l │ │ └── CMakeLists.txt │ ├── lissajous0r │ │ ├── CMakeLists.txt │ │ └── lissajous0r.cpp │ └── test_pat │ │ └── CMakeLists.txt ├── CMakeLists.txt └── mixer2 │ ├── hue │ ├── CMakeLists.txt │ └── hue.cpp │ ├── blend │ ├── CMakeLists.txt │ └── blend.cpp │ ├── burn │ ├── CMakeLists.txt │ └── burn.cpp │ ├── dodge │ ├── CMakeLists.txt │ └── dodge.cpp │ ├── uvmap │ └── CMakeLists.txt │ ├── value │ ├── CMakeLists.txt │ └── value.cpp │ ├── alphain │ ├── CMakeLists.txt │ └── alphain.cpp │ ├── darken │ ├── CMakeLists.txt │ └── darken.cpp │ ├── divide │ ├── CMakeLists.txt │ └── divide.cpp │ ├── lighten │ ├── CMakeLists.txt │ └── lighten.cpp │ ├── overlay │ ├── CMakeLists.txt │ └── overlay.cpp │ ├── screen │ ├── CMakeLists.txt │ └── screen.cpp │ ├── xfade0r │ ├── CMakeLists.txt │ └── xfade0r.cpp │ ├── addition │ ├── CMakeLists.txt │ └── addition.cpp │ ├── alphaout │ ├── CMakeLists.txt │ └── alphaout.cpp │ ├── alphaxor │ ├── CMakeLists.txt │ └── alphaxor.cpp │ ├── multiply │ ├── CMakeLists.txt │ └── multiply.cpp │ ├── subtract │ ├── CMakeLists.txt │ └── subtract.cpp │ ├── alphaatop │ ├── CMakeLists.txt │ └── alphaatop.cpp │ ├── alphaover │ ├── CMakeLists.txt │ └── alphaover.cpp │ ├── color_only │ ├── CMakeLists.txt │ └── color_only.cpp │ ├── composition │ └── CMakeLists.txt │ ├── difference │ ├── CMakeLists.txt │ └── difference.cpp │ ├── hardlight │ ├── CMakeLists.txt │ └── hardlight.cpp │ ├── saturation │ ├── CMakeLists.txt │ └── saturation.cpp │ ├── softlight │ ├── CMakeLists.txt │ └── softlight.cpp │ ├── grain_merge │ ├── CMakeLists.txt │ └── grain_merge.cpp │ ├── alphainjection │ └── CMakeLists.txt │ ├── euclid_eraser │ ├── CMakeLists.txt │ └── euclid_eraser.md │ ├── grain_extract │ ├── CMakeLists.txt │ └── grain_extract.cpp │ ├── addition_alpha │ ├── CMakeLists.txt │ └── addition_alpha.cpp │ ├── cairoblend │ └── CMakeLists.txt │ ├── cairoaffineblend │ └── CMakeLists.txt │ ├── sleid0r │ └── CMakeLists.txt │ └── CMakeLists.txt ├── msvc ├── frei0r_1_0.def ├── frei0r_1_1.def └── frei0r_1_2.def ├── frei0r.pc.in ├── .releaserc ├── .travis.yml ├── .gitignore ├── test └── Makefile ├── cmake └── modules │ ├── TargetDistclean.cmake │ └── FindCairo.cmake ├── BUILD.md ├── AUTHORS.md ├── CMakeLists.txt ├── include └── frei0r │ └── math.h └── .github └── workflows └── test.yml /src/mixer3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory (RGB) -------------------------------------------------------------------------------- /src/filter/bw0r/bw0r_pre.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/bw0r/bw0r_pre.jpg -------------------------------------------------------------------------------- /src/filter/bw0r/bw0r_post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/bw0r/bw0r_post.jpg -------------------------------------------------------------------------------- /src/filter/elastic_scale/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/elastic_scale/img1.jpg -------------------------------------------------------------------------------- /src/filter/elastic_scale/img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/elastic_scale/img2.jpg -------------------------------------------------------------------------------- /src/filter/elastic_scale/img3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/elastic_scale/img3.jpg -------------------------------------------------------------------------------- /src/generator/ising0r/ising0r.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/generator/ising0r/ising0r.jpg -------------------------------------------------------------------------------- /src/filter/tehroxx0r/tehroxx0r.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/tehroxx0r/tehroxx0r.jpg -------------------------------------------------------------------------------- /src/filter/distort0r/distort0r_pre.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/distort0r/distort0r_pre.jpg -------------------------------------------------------------------------------- /src/filter/invert0r/invert0r_post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/invert0r/invert0r_post.jpg -------------------------------------------------------------------------------- /src/filter/invert0r/invert0r_pre.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/invert0r/invert0r_pre.jpg -------------------------------------------------------------------------------- /src/filter/pixeliz0r/pixeliz0r_pre.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/pixeliz0r/pixeliz0r_pre.jpg -------------------------------------------------------------------------------- /src/filter/distort0r/distort0r_post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/distort0r/distort0r_post.jpg -------------------------------------------------------------------------------- /src/filter/pixeliz0r/pixeliz0r_post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/pixeliz0r/pixeliz0r_post.jpg -------------------------------------------------------------------------------- /src/filter/kaleid0sc0pe/colorful_stones-400.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/kaleid0sc0pe/colorful_stones-400.jpg -------------------------------------------------------------------------------- /src/filter/kaleid0sc0pe/colorful_stones-tr16-400.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/kaleid0sc0pe/colorful_stones-tr16-400.jpg -------------------------------------------------------------------------------- /src/filter/kaleid0sc0pe/new-years-day-2024-source-480.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyne/frei0r/HEAD/src/filter/kaleid0sc0pe/new-years-day-2024-source-480.jpg -------------------------------------------------------------------------------- /msvc/frei0r_1_0.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | f0r_init 3 | f0r_deinit 4 | f0r_get_plugin_info 5 | f0r_get_param_info 6 | f0r_construct 7 | f0r_destruct 8 | f0r_set_param_value 9 | f0r_get_param_value 10 | f0r_update -------------------------------------------------------------------------------- /msvc/frei0r_1_1.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | f0r_init 3 | f0r_deinit 4 | f0r_get_plugin_info 5 | f0r_get_param_info 6 | f0r_construct 7 | f0r_destruct 8 | f0r_set_param_value 9 | f0r_get_param_value 10 | f0r_update2 -------------------------------------------------------------------------------- /msvc/frei0r_1_2.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | f0r_init 3 | f0r_deinit 4 | f0r_get_plugin_info 5 | f0r_get_param_info 6 | f0r_construct 7 | f0r_destruct 8 | f0r_set_param_value 9 | f0r_get_param_value 10 | f0r_update2 11 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") 2 | if(NOT MSVC) 3 | link_libraries(m) 4 | endif() 5 | add_subdirectory (filter) 6 | add_subdirectory (generator) 7 | add_subdirectory (mixer2) 8 | add_subdirectory (mixer3) 9 | -------------------------------------------------------------------------------- /src/generator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory (dem0scene) 2 | add_subdirectory (ising0r) 3 | add_subdirectory (lissajous0r) 4 | add_subdirectory (nois0r) 5 | add_subdirectory (onecol0r) 6 | add_subdirectory (partik0l) 7 | add_subdirectory (test_pat) 8 | -------------------------------------------------------------------------------- /frei0r.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: frei0r 7 | Description: minimalistic plugin API for video effects 8 | Version: @VERSION@ 9 | Libs: 10 | Cflags: -I${includedir} 11 | 12 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | "repositoryUrl": "git@github.com:dyne/frei0r.git", 3 | "dryRun": false, 4 | "plugins": [ 5 | "@semantic-release/changelog", 6 | "@semantic-release/commit-analyzer", 7 | "@semantic-release/release-notes-generator" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/filter/bw0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES bw0r.c) 2 | set (TARGET bw0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/glow/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES glow.c) 2 | set (TARGET glow) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/pixs0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES pixs0r.cc) 2 | set (TARGET pixs0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) -------------------------------------------------------------------------------- /src/filter/sobel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES sobel.cpp) 2 | set (TARGET sobel) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/water/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES water.cpp) 2 | set (TARGET water) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/hue/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES hue.cpp) 2 | set (TARGET hue) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer3/RGB/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES RGB.c) 2 | set (TARGET RGB) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/aech0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES aech0r.cpp) 2 | set (TARGET aech0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/baltan/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES baltan.cpp) 2 | set (TARGET baltan) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/cluster/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES cluster.c) 2 | set (TARGET cluster) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/dither/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES dither.c) 2 | set (TARGET dither) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/emboss/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES emboss.c) 2 | set (TARGET emboss) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/flippo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES flippo.c) 2 | set (TARGET flippo) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/tint0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES tint0r.c) 2 | set (TARGET tint0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/vertigo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES vertigo.c) 2 | set (TARGET vertigo) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/blend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES blend.cpp) 2 | set (TARGET blend) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/burn/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES burn.cpp) 2 | set (TARGET burn) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/dodge/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES dodge.cpp) 2 | set (TARGET dodge) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/uvmap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES uvmap.c) 2 | set (TARGET uvmap) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/value/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES value.cpp) 2 | set (TARGET value) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/3dflippo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES 3dflippo.c) 2 | set (TARGET 3dflippo) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/balanc0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES balanc0r.c) 2 | set (TARGET balanc0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/cartoon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES cartoon.cpp) 2 | set (TARGET cartoon) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/colorize/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES colorize.c) 2 | set (TARGET colorize) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/colortap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES colortap.c) 2 | set (TARGET colortap) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/delay0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES delay0r.cpp) 2 | set (TARGET delay0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/distort0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES distort0r.c) 2 | set (TARGET distort0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/edgeglow/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES edgeglow.cpp) 2 | set (TARGET edgeglow) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/filmgrain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES filmgrain.c) 2 | set (TARGET filmgrain) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/gateweave/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES gateweave.c) 2 | set (TARGET gateweave) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/glitch0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES glitch0r.c) 2 | set (TARGET glitch0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/heatmap0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES heatmap0r.c) 2 | set (TARGET heatmap0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/invert0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES invert0r.c) 2 | set (TARGET invert0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/luminance/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES luminance.c) 2 | set (TARGET luminance) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/mask0mate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES mask0mate.c) 2 | set (TARGET mask0mate) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/nervous/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES nervous.cpp) 2 | set (TARGET nervous) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/nosync0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES nosync0r.cpp) 2 | set (TARGET nosync0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/pixeliz0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES pixeliz0r.c) 2 | set (TARGET pixeliz0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/posterize/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES posterize.c) 2 | set (TARGET posterize) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/saturat0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES saturat0r.c) 2 | set (TARGET saturat0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/select0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES select0r.c) 2 | set (TARGET select0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/sharpness/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES sharpness.c) 2 | set (TARGET sharpness) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/softglow/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES softglow.c) 2 | set (TARGET softglow) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/sopsat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES sopsat.cpp) 2 | set (TARGET sopsat) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | 10 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 11 | 12 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 13 | -------------------------------------------------------------------------------- /src/filter/tehroxx0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES tehroxx0r.c) 2 | set (TARGET tehroxx0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/twolay0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES twolay0r.cpp) 2 | set (TARGET twolay0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/generator/dem0scene/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES plasma.cpp) 2 | set (TARGET plasma) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/generator/ising0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES ising0r.c) 2 | set (TARGET ising0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/generator/nois0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES nois0r.cpp) 2 | set (TARGET nois0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/alphain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES alphain.cpp) 2 | set (TARGET alphain) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/darken/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES darken.cpp) 2 | set (TARGET darken) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/divide/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES divide.cpp) 2 | set (TARGET divide) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/lighten/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES lighten.cpp) 2 | set (TARGET lighten) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/overlay/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES overlay.cpp) 2 | set (TARGET overlay) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/screen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES screen.cpp) 2 | set (TARGET screen) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/xfade0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES xfade0r.cpp) 2 | set (TARGET xfade0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/autothresh0ld/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES autothresh0ld.c) 2 | set (TARGET autothresh0ld) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | 10 | # No «lib» prefix (name.so instead of libname.so) 11 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 12 | -------------------------------------------------------------------------------- /src/filter/brightness/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES brightness.c) 2 | set (TARGET brightness) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/c0rners/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES c0rners.c interp.h) 2 | set (TARGET c0rners) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/contrast0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES contrast0r.c) 2 | set (TARGET contrast0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/curves/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES curves.c) 2 | set (TARGET curves) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "" C_STANDARD 99) 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/delaygrab/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES delaygrab.cpp) 2 | set (TARGET delaygrab) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/equaliz0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES equaliz0r.cpp) 2 | set (TARGET equaliz0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/normaliz0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES normaliz0r.c) 2 | set (TARGET normaliz0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/primaries/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES primaries.cpp) 2 | set (TARGET primaries) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/rgbsplit0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES rgbsplit0r.c) 2 | set (TARGET rgbsplit0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/scanline0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES scanline0r.cpp) 2 | set (TARGET scanline0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/squareblur/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES squareblur.c) 2 | set (TARGET squareblur) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/threelay0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES threelay0r.cpp) 2 | set (TARGET threelay0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/vignette/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES vignette.cpp) 2 | set (TARGET vignette) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | 10 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 11 | 12 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 13 | -------------------------------------------------------------------------------- /src/generator/onecol0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES onecol0r.cpp) 2 | set (TARGET onecol0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/generator/partik0l/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES partik0l.cpp) 2 | set (TARGET partik0l) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/addition/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES addition.cpp) 2 | set (TARGET addition) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/alphaout/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES alphaout.cpp) 2 | set (TARGET alphaout) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/alphaxor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES alphaxor.cpp) 2 | set (TARGET alphaxor) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/multiply/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES multiply.cpp) 2 | set (TARGET multiply) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/subtract/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES subtract.cpp) 2 | set (TARGET subtract) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/bgsubtract0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES bgsubtract0r.c) 2 | set (TARGET bgsubtract0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/letterb0xed/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES letterb0xed.c) 2 | set (TARGET letterb0xed) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/perspective/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES perspective.c) 2 | set (TARGET perspective) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/spillsupress/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES spillsupress.c) 2 | set (TARGET spillsupress) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/threshold0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES threshold0r.c) 2 | set (TARGET threshold0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/transparency/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES transparency.c) 2 | set (TARGET transparency) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/alphaatop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES alphaatop.cpp) 2 | set (TARGET alphaatop) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/alphaover/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES alphaover.cpp) 2 | set (TARGET alphaover) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/color_only/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES color_only.cpp) 2 | set (TARGET color_only) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/composition/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES composition.c) 2 | set (TARGET composition) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/difference/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES difference.cpp) 2 | set (TARGET difference) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/hardlight/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES hardlight.cpp) 2 | set (TARGET hardlight) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/saturation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES saturation.cpp) 2 | set (TARGET saturation) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/softlight/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES softlight.cpp) 2 | set (TARGET softlight) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/bluescreen0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES bluescreen0r.cpp) 2 | set (TARGET bluescreen0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/colordistance/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES colordistance.c) 2 | set (TARGET colordistance) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/colorhalftone/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES colorhalftone.c) 2 | set (TARGET colorhalftone) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/keyspillm0pup/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES keyspillm0pup.c) 2 | set (TARGET keyspillm0pup) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/lenscorrection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES lenscorrection.c) 2 | set (TARGET lenscorrection) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/generator/lissajous0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES lissajous0r.cpp) 2 | set (TARGET lissajous0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/grain_merge/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES grain_merge.cpp) 2 | set (TARGET grain_merge) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/elastic_scale/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES elastic_scale.cpp) 2 | set (TARGET elastic_scale) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | 10 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 11 | 12 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 13 | -------------------------------------------------------------------------------- /src/filter/host_param_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES host_param_test.c) 2 | set (TARGET host_param_test) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/medians/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES medians.c ctmf.h small_medians.h) 2 | set (TARGET medians) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/ntsc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES crt_core.c crt_ntsc.c ntsc-effect.c) 2 | set (TARGET ntsc) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) -------------------------------------------------------------------------------- /src/mixer2/alphainjection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES alphainjection.c) 2 | set (TARGET alphainjection) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/euclid_eraser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES euclid_eraser.cpp) 2 | set (TARGET euclid_eraser) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/grain_extract/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES grain_extract.cpp) 2 | set (TARGET grain_extract) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/sigmoidaltransfer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES sigmoidaltransfer.c) 2 | set (TARGET sigmoidaltransfer) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/mixer2/addition_alpha/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES addition_alpha.cpp) 2 | set (TARGET addition_alpha) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_1_1_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 10 | 11 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 12 | -------------------------------------------------------------------------------- /src/filter/gamma/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES gamma.c) 2 | set (TARGET gamma) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | if(NOT MSVC) 9 | link_libraries(m) 10 | endif() 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | 14 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 15 | -------------------------------------------------------------------------------- /src/filter/colgate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES colgate.c) 2 | set (TARGET colgate) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | if(NOT MSVC) 9 | link_libraries(m) 10 | endif() 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | 14 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 15 | -------------------------------------------------------------------------------- /src/filter/blur/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES IIRblur.c fibe.h) 2 | set (TARGET IIRblur) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | if(NOT MSVC) 9 | link_libraries(m) 10 | endif() 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | 14 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 15 | -------------------------------------------------------------------------------- /src/filter/rgbnoise/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES rgbnoise.c) 2 | set (TARGET rgbnoise) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | if(NOT MSVC) 9 | link_libraries(m) 10 | endif() 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | 14 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 15 | -------------------------------------------------------------------------------- /src/filter/coloradj/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES coloradj_RGB.c) 2 | set (TARGET coloradj_RGB) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | if(NOT MSVC) 9 | link_libraries(m) 10 | endif() 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | 14 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 15 | -------------------------------------------------------------------------------- /src/filter/defish0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES defish0r.c interp.h) 2 | set (TARGET defish0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | if(NOT MSVC) 9 | link_libraries(m) 10 | endif() 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | 14 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 15 | -------------------------------------------------------------------------------- /src/filter/denoise/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES denoise_hqdn3d.c) 2 | set (TARGET denoise_hqdn3d) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | if(NOT MSVC) 9 | link_libraries(m) 10 | endif() 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | 14 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 15 | -------------------------------------------------------------------------------- /src/filter/hueshift0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES hueshift0r.c matrix.h) 2 | set (TARGET hueshift0r) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | if(NOT MSVC) 9 | link_libraries(m) 10 | endif() 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | 14 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 15 | -------------------------------------------------------------------------------- /src/filter/premultiply/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES premultiply.cpp) 2 | set (TARGET premultiply) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | 10 | # No «lib» prefix (name.so instead of libname.so) 11 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 12 | 13 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 14 | -------------------------------------------------------------------------------- /src/filter/lightgraffiti/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES lightgraffiti.cpp) 2 | set (TARGET lightgraffiti) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | 10 | # No «lib» prefix (name.so instead of libname.so) 11 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 12 | 13 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 14 | -------------------------------------------------------------------------------- /src/filter/d90stairsteppingfix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES d90stairsteppingfix.cpp) 2 | set (TARGET d90stairsteppingfix) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | add_library (${TARGET} MODULE ${SOURCES}) 9 | 10 | # No «lib» prefix (name.so instead of libname.so) 11 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 12 | 13 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 14 | -------------------------------------------------------------------------------- /src/filter/mirr0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES mirr0r.cpp) 2 | set (TARGET mirr0r) 3 | 4 | include_directories(${Cairo_INCLUDE_DIR}) 5 | set(LIBS ${LIBS} ${Cairo_LIBRARY}) 6 | 7 | if (MSVC) 8 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 9 | endif (MSVC) 10 | 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | 13 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 14 | target_link_libraries(mirr0r ${LIBS}) 15 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 16 | -------------------------------------------------------------------------------- /src/filter/scale0tilt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES scale0tilt.c) 2 | set (TARGET scale0tilt) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | include_directories (${GAVL_INCLUDE_DIRS}) 9 | link_directories (${GAVL_LIBRARY_DIRS}) 10 | LINK_LIBRARIES(${GAVL_LIBRARIES}) 11 | 12 | add_library (${TARGET} MODULE ${SOURCES}) 13 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 14 | 15 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 16 | -------------------------------------------------------------------------------- /src/mixer2/cairoblend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES cairoblend.c) 2 | set (TARGET cairoblend) 3 | 4 | include_directories(${Cairo_INCLUDE_DIR}) 5 | set(LIBS ${LIBS} ${Cairo_LIBRARY}) 6 | 7 | if (MSVC) 8 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 9 | endif (MSVC) 10 | 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | target_link_libraries(cairoblend ${LIBS}) 14 | 15 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 16 | -------------------------------------------------------------------------------- /src/filter/cairogradient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES cairogradient.c) 2 | set (TARGET cairogradient) 3 | 4 | include_directories(${Cairo_INCLUDE_DIR}) 5 | set(LIBS ${LIBS} ${Cairo_LIBRARY}) 6 | 7 | if (MSVC) 8 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 9 | endif (MSVC) 10 | 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | target_link_libraries(cairogradient ${LIBS}) 14 | 15 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 16 | -------------------------------------------------------------------------------- /src/filter/levels/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Set C99 flag for gcc 2 | if (CMAKE_COMPILER_IS_GNUCC) 3 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") 4 | endif (CMAKE_COMPILER_IS_GNUCC) 5 | 6 | set (SOURCES levels.c) 7 | set (TARGET levels) 8 | 9 | if (MSVC) 10 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 11 | endif (MSVC) 12 | 13 | add_library (${TARGET} MODULE ${SOURCES}) 14 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 15 | 16 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 17 | -------------------------------------------------------------------------------- /src/filter/cairoimagegrid/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES cairoimagegrid.c) 2 | set (TARGET cairoimagegrid) 3 | 4 | include_directories(${Cairo_INCLUDE_DIR}) 5 | set(LIBS ${LIBS} ${Cairo_LIBRARY}) 6 | 7 | if (MSVC) 8 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 9 | endif (MSVC) 10 | 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | target_link_libraries(cairoimagegrid ${LIBS}) 14 | 15 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 16 | -------------------------------------------------------------------------------- /src/filter/rgbparade/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES rgbparade.c rgbparade_image.h) 2 | set (TARGET rgbparade) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | include_directories (${GAVL_INCLUDE_DIRS}) 9 | link_directories (${GAVL_LIBRARY_DIRS}) 10 | LINK_LIBRARIES(${GAVL_LIBRARIES}) 11 | 12 | add_library (${TARGET} MODULE ${SOURCES}) 13 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 14 | 15 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 16 | -------------------------------------------------------------------------------- /src/filter/vectorscope/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES vectorscope.c vectorscope_image.h) 2 | set (TARGET vectorscope) 3 | 4 | if (MSVC) 5 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 6 | endif (MSVC) 7 | 8 | include_directories (${GAVL_INCLUDE_DIRS}) 9 | link_directories (${GAVL_LIBRARY_DIRS}) 10 | LINK_LIBRARIES(${GAVL_LIBRARIES}) 11 | 12 | add_library (${TARGET} MODULE ${SOURCES}) 13 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 14 | 15 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 16 | -------------------------------------------------------------------------------- /src/mixer2/cairoaffineblend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES cairoaffineblend.c) 2 | set (TARGET cairoaffineblend) 3 | 4 | include_directories(${Cairo_INCLUDE_DIR}) 5 | set(LIBS ${LIBS} ${Cairo_LIBRARY}) 6 | 7 | if (MSVC) 8 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 9 | endif (MSVC) 10 | 11 | add_library (${TARGET} MODULE ${SOURCES}) 12 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 13 | target_link_libraries(cairoaffineblend ${LIBS}) 14 | 15 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 16 | -------------------------------------------------------------------------------- /src/filter/ndvi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (SOURCES ndvi.cpp gradientlut.hpp) 2 | set (TARGET ndvi) 3 | 4 | if (Cairo_FOUND) 5 | include_directories(${Cairo_INCLUDE_DIR}) 6 | set(LIBS ${LIBS} ${Cairo_LIBRARY}) 7 | endif (Cairo_FOUND) 8 | 9 | if (MSVC) 10 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 11 | endif (MSVC) 12 | 13 | add_library (${TARGET} MODULE ${SOURCES}) 14 | target_link_libraries(ndvi ${LIBS}) 15 | 16 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 17 | 18 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 19 | -------------------------------------------------------------------------------- /src/filter/three_point_balance/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Set C99 flag for gcc 2 | if (CMAKE_COMPILER_IS_GNUCC) 3 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") 4 | endif (CMAKE_COMPILER_IS_GNUCC) 5 | 6 | set (SOURCES three_point_balance.c) 7 | set (TARGET three_point_balance) 8 | 9 | if (MSVC) 10 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 11 | endif (MSVC) 12 | 13 | add_library (${TARGET} MODULE ${SOURCES}) 14 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 15 | 16 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | notifications: 2 | email: false 3 | env: 4 | - RELEASE_BRANCH="master" 5 | language: c 6 | os: 7 | - linux 8 | - osx 9 | sudo: required 10 | services: 11 | - docker 12 | 13 | before_install: 14 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull dyne/devuan:beowulf && docker build -t dyne/frei0r-plugins .; fi 15 | 16 | script: 17 | - cmake . && make -j && sudo make install 18 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run dyne/frei0r-plugins /bin/sh -c "git clean -fd && ./autogen.sh && ./configure && make -j && make install" ; fi 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .envrc 2 | gallery 3 | aclocal.m4 4 | autom4te.cache 5 | config.h 6 | config.log 7 | config.status 8 | config.guess 9 | config.sub 10 | m4 11 | configure 12 | config.h.in 13 | cscope.out 14 | depcomp 15 | install-sh 16 | libtool 17 | ltmain.sh 18 | missing 19 | stamp-h1 20 | tags 21 | *.[oa] 22 | *.so 23 | *.la 24 | *.lo 25 | cmake_install.cmake 26 | CMakeFiles 27 | install_manifest.txt 28 | *~ 29 | Makefile.in 30 | Makefile 31 | .deps 32 | .obj 33 | .libs 34 | TAGS 35 | ylwrap 36 | frei0r.pc 37 | doc/html 38 | /build/ 39 | /out/ 40 | /.vs/ 41 | CMakeSettings.json 42 | .vscode 43 | -------------------------------------------------------------------------------- /src/filter/timeout/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Replace «tutorial» by the library name of your filter 2 | # and add the filter directory in src/filter/CMakeLists.txt. 3 | set (SOURCES timeout.cpp) 4 | set (TARGET timeout) 5 | 6 | if (MSVC) 7 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 8 | endif (MSVC) 9 | 10 | add_library (${TARGET} MODULE ${SOURCES}) 11 | 12 | # No «lib» prefix (name.so instead of libname.so) 13 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 14 | 15 | # Do not install a tutorial effect ;) 16 | # (Can be installed for testing though.) 17 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 18 | -------------------------------------------------------------------------------- /src/filter/tutorial/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Replace «tutorial» by the library name of your filter 2 | # and add the filter directory in src/filter/CMakeLists.txt. 3 | set (SOURCES tutorial.cpp) 4 | set (TARGET tutorial) 5 | 6 | if (MSVC) 7 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 8 | endif (MSVC) 9 | 10 | add_library (${TARGET} MODULE ${SOURCES}) 11 | 12 | # No «lib» prefix (name.so instead of libname.so) 13 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 14 | 15 | # Do not install a tutorial effect ;) 16 | # (Can be installed for testing though.) 17 | #install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 18 | -------------------------------------------------------------------------------- /test/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES ?= -I ../include 2 | 3 | PLUGINDIR ?= ../build/src 4 | 5 | all: build scan-plugins 6 | 7 | scan-plugins: 8 | @$(if $(wildcard ${PLUGINDIR}),,>&2 echo "Scan dir not found: ${PLUGINDIR}" && exit 1) 9 | @find ${PLUGINDIR} -type f -name '*.so' -exec ./frei0r-info {} \; > tmp.json 10 | @echo "[" > frei0r-plugin-list.json 11 | @head -n -1 tmp.json >> frei0r-plugin-list.json 12 | @echo "}\n]" >> frei0r-plugin-list.json 13 | @rm tmp.json 14 | $(info frei0r-plugin-list.json) 15 | 16 | build: 17 | @${CC} -o frei0r-info -ggdb frei0r-info.c ${INCLUDES} 18 | 19 | clean: 20 | rm -f *.o 21 | rm -f frei0r-info 22 | rm -f *.json 23 | -------------------------------------------------------------------------------- /src/filter/measure/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (B_SOURCES measure_pr0be.c measure.h font2.h) 2 | set (F_SOURCES measure_pr0file.c measure.h font2.h) 3 | 4 | if (MSVC) 5 | set (B_SOURCES ${B_SOURCES} ${FREI0R_DEF}) 6 | set (F_SOURCES ${F_SOURCES} ${FREI0R_DEF}) 7 | endif (MSVC) 8 | 9 | # link_libraries(m) 10 | add_library (measure_pr0be MODULE ${B_SOURCES}) 11 | add_library (measure_pr0file MODULE ${F_SOURCES}) 12 | 13 | set_target_properties (measure_pr0be PROPERTIES PREFIX "") 14 | set_target_properties (measure_pr0file PROPERTIES PREFIX "") 15 | 16 | install (TARGETS measure_pr0be LIBRARY DESTINATION ${LIBDIR}) 17 | install (TARGETS measure_pr0file LIBRARY DESTINATION ${LIBDIR}) 18 | -------------------------------------------------------------------------------- /src/filter/RGB/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (R_SOURCES R.c) 2 | set (G_SOURCES G.c) 3 | set (B_SOURCES B.c) 4 | 5 | if (MSVC) 6 | set (R_SOURCES ${R_SOURCES} ${FREI0R_DEF}) 7 | set (G_SOURCES ${G_SOURCES} ${FREI0R_DEF}) 8 | set (B_SOURCES ${B_SOURCES} ${FREI0R_DEF}) 9 | endif (MSVC) 10 | 11 | add_library (R MODULE ${R_SOURCES}) 12 | add_library (G MODULE ${G_SOURCES}) 13 | add_library (B MODULE ${B_SOURCES}) 14 | 15 | set_target_properties (R PROPERTIES PREFIX "") 16 | set_target_properties (G PROPERTIES PREFIX "") 17 | set_target_properties (B PROPERTIES PREFIX "") 18 | 19 | install (TARGETS R LIBRARY DESTINATION ${LIBDIR}) 20 | install (TARGETS G LIBRARY DESTINATION ${LIBDIR}) 21 | install (TARGETS B LIBRARY DESTINATION ${LIBDIR}) 22 | -------------------------------------------------------------------------------- /src/filter/facebl0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # facebl0r filter - requires OpenCV (and protobuf) 2 | # This filter can cause conflicts with applications that also use protobuf 3 | # such as MLT, so it can be disabled with -DWITHOUT_FACERECOGNITION=ON 4 | 5 | if (OpenCV_FOUND AND NOT WITHOUT_FACERECOGNITION) 6 | set (SOURCES facebl0r.cpp) 7 | set (TARGET facebl0r) 8 | 9 | if (MSVC) 10 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 11 | endif (MSVC) 12 | 13 | include_directories(${OpenCV_INCLUDE_DIRS}) 14 | add_library (${TARGET} MODULE ${SOURCES}) 15 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 16 | target_link_libraries(${TARGET} ${OpenCV_LIBS}) 17 | 18 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 19 | endif() 20 | -------------------------------------------------------------------------------- /src/filter/facedetect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # facedetect filter - requires OpenCV (and protobuf) 2 | # This filter can cause conflicts with applications that also use protobuf 3 | # such as MLT, so it can be disabled with -DWITHOUT_FACERECOGNITION=ON 4 | 5 | if (OpenCV_FOUND AND NOT WITHOUT_FACERECOGNITION) 6 | set (SOURCES facedetect.cpp) 7 | set (TARGET facedetect) 8 | 9 | if (MSVC) 10 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 11 | endif (MSVC) 12 | 13 | include_directories(${OpenCV_INCLUDE_DIRS}) 14 | add_library (${TARGET} MODULE ${SOURCES}) 15 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 16 | target_link_libraries(${TARGET} ${OpenCV_LIBS}) 17 | 18 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 19 | endif() 20 | -------------------------------------------------------------------------------- /src/mixer2/sleid0r/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(MIXERS 2 | WIPE-UP 3 | WIPE-LEFT 4 | WIPE-BARN-DOOR-V 5 | SLIDE-RIGHT 6 | PUSH-UP 7 | PUSH-DOWN 8 | WIPE-RIGHT 9 | WIPE-DOWN 10 | WIPE-BARN-DOOR-H 11 | SLIDE-LEFT 12 | PUSH-RIGHT 13 | WIPE-RECT 14 | WIPE-CIRCLE 15 | SLIDE-UP 16 | SLIDE-DOWN 17 | PUSH-LEFT 18 | ) 19 | 20 | foreach(MIXER IN LISTS MIXERS) 21 | string(TOLOWER ${MIXER} LOWERCASE_MIXER) 22 | set(${MIXER}_SOURCES sleid0r_${LOWERCASE_MIXER}.c) 23 | if(MSVC) 24 | set(${MIXER}_SOURCES ${${MIXER}_SOURCES} ${FREI0R_1_2_DEF}) 25 | endif(MSVC) 26 | add_library(sleid0r_${LOWERCASE_MIXER} MODULE ${${MIXER}_SOURCES}) 27 | set_target_properties (sleid0r_${LOWERCASE_MIXER} PROPERTIES PREFIX "") 28 | install (TARGETS sleid0r_${LOWERCASE_MIXER} LIBRARY DESTINATION ${LIBDIR}) 29 | endforeach() 30 | 31 | -------------------------------------------------------------------------------- /cmake/modules/TargetDistclean.cmake: -------------------------------------------------------------------------------- 1 | # add custom target distclean 2 | # cleans and removes cmake generated files etc. 3 | # Jan Woetzel 04/2003 4 | # 5 | 6 | if(UNIX) 7 | add_custom_target(distclean 8 | COMMENT "cleaning for source distribution" 9 | ) 10 | set(DISTCLEANED 11 | cmake.depends 12 | cmake.check_depends 13 | CMakeCache.txt 14 | cmake.check_cache 15 | *.cmake 16 | Makefile 17 | core core.* 18 | gmon.out 19 | *~ 20 | ) 21 | add_custom_command( 22 | POST_BUILD 23 | COMMENT "running target clean" 24 | TARGET distclean 25 | COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target clean 26 | ) 27 | add_custom_command( 28 | POST_BUILD 29 | COMMENT "distribution clean" 30 | COMMAND rm 31 | ARGS -Rf CMakeTmp ${DISTCLEANED} 32 | TARGET distclean 33 | ) 34 | endif(UNIX) 35 | 36 | -------------------------------------------------------------------------------- /src/filter/denoise/README: -------------------------------------------------------------------------------- 1 | Denoise Frei0r plugins 2 | 3 | 4 | For now, I have only ported the Daniel Moreno's hqdn3d filter from 5 | Mplayer. 6 | 7 | I have also tried Mplayer's "ow" (overcomplete wavelet) denoiser, but 8 | despite being only 2D, it is EXTREMELY slow (like <1fps...), so I 9 | decided not to include it for now. 10 | 11 | In the future I would like to try at least a thresholded 3D median, 12 | and maybe port something like fftdenoise3d from Avisynth. That 13 | is a pretty big chunk of code, and originally written for another 14 | operating system, so much more work, and it depends when I'll have 15 | the spare time for that. 16 | 17 | Or maybe some other "smart" denoiser, suggestions welcome. 18 | 19 | 20 | 21 | HQDN3D 22 | 23 | This is a three dimensional nonlinear IIR filter. Does a pretty god 24 | job at moderate noise levels. For stronger denoising, it becomes a bit 25 | asymmetric, which is a consequence of its IIR form. 26 | 27 | 28 | -------------------------------------------------------------------------------- /BUILD.md: -------------------------------------------------------------------------------- 1 | # Build instructions 2 | 3 | Frei0r can be built using CMake. 4 | 5 | The presence of optional libraries on the system will trigger compilation of extra plugins. These libraries are: 6 | 7 | + [Gavl](http://gmerlin.sourceforge.net) required for scale0tilt and vectorscope filters 8 | 9 | + [OpenCV](http://opencvlibrary.sourceforge.net) required for facebl0r filter 10 | 11 | + [Cairo](http://cairographics.org) required for cairo- filters and mixers 12 | 13 | ## Optional build flags 14 | 15 | + `-DWITHOUT_FACERECOGNITION=ON` - Disable face recognition plugins (facedetect and facebl0r) to avoid protobuf conflicts with applications like MLT 16 | 17 | It is recommended to use a separate `build` sub-folder. 18 | 19 | ``` 20 | mkdir -p build 21 | cd build && cmake ../ 22 | make 23 | ``` 24 | 25 | To disable face recognition plugins (recommended when using with MLT): 26 | ``` 27 | mkdir -p build 28 | cd build && cmake -DWITHOUT_FACERECOGNITION=ON ../ 29 | make 30 | ``` 31 | 32 | Also ninja and nmake are supported through cmake: 33 | ``` 34 | cmake -G 'Ninja' ../ 35 | cmake -G 'NMake Makefiles' ../ 36 | ``` 37 | 38 | -------------------------------------------------------------------------------- /src/filter/alpha0ps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (O_SOURCES alpha0ps_alpha0ps.c fibe_f.h) 2 | set (G_SOURCES alpha0ps_alphagrad.c) 3 | set (S_SOURCES alpha0ps_alphaspot.c) 4 | 5 | if (MSVC) 6 | set (O_SOURCES ${O_SOURCES} ${FREI0R_DEF}) 7 | set (G_SOURCES ${G_SOURCES} ${FREI0R_DEF}) 8 | set (S_SOURCES ${S_SOURCES} ${FREI0R_DEF}) 9 | endif (MSVC) 10 | 11 | add_library (alpha0ps_alpha0ps MODULE ${O_SOURCES}) 12 | add_library (alpha0ps_alphagrad MODULE ${G_SOURCES}) 13 | add_library (alpha0ps_alphaspot MODULE ${S_SOURCES}) 14 | 15 | if(NOT MSVC) 16 | target_link_libraries(alpha0ps_alpha0ps -lm) 17 | target_link_libraries(alpha0ps_alphagrad -lm) 18 | target_link_libraries(alpha0ps_alphaspot -lm) 19 | endif() 20 | 21 | set_target_properties (alpha0ps_alpha0ps PROPERTIES PREFIX "") 22 | set_target_properties (alpha0ps_alphagrad PROPERTIES PREFIX "") 23 | set_target_properties (alpha0ps_alphaspot PROPERTIES PREFIX "") 24 | 25 | install (TARGETS alpha0ps_alpha0ps LIBRARY DESTINATION ${LIBDIR}) 26 | install (TARGETS alpha0ps_alphagrad LIBRARY DESTINATION ${LIBDIR}) 27 | install (TARGETS alpha0ps_alphaspot LIBRARY DESTINATION ${LIBDIR}) 28 | -------------------------------------------------------------------------------- /src/mixer2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (${Cairo_FOUND}) 2 | add_subdirectory (cairoaffineblend) 3 | add_subdirectory (cairoblend) 4 | endif (${Cairo_FOUND}) 5 | 6 | add_subdirectory (addition) 7 | add_subdirectory (addition_alpha) 8 | add_subdirectory (alphaatop) 9 | add_subdirectory (alphain) 10 | add_subdirectory (alphainjection) 11 | add_subdirectory (alphaout) 12 | add_subdirectory (alphaover) 13 | add_subdirectory (alphaxor) 14 | add_subdirectory (blend) 15 | add_subdirectory (burn) 16 | add_subdirectory (color_only) 17 | add_subdirectory (composition) 18 | add_subdirectory (darken) 19 | add_subdirectory (difference) 20 | add_subdirectory (divide) 21 | add_subdirectory (dodge) 22 | add_subdirectory (euclid_eraser) 23 | add_subdirectory (grain_extract) 24 | add_subdirectory (grain_merge) 25 | add_subdirectory (hardlight) 26 | add_subdirectory (hue) 27 | add_subdirectory (lighten) 28 | add_subdirectory (multiply) 29 | add_subdirectory (overlay) 30 | add_subdirectory (saturation) 31 | add_subdirectory (screen) 32 | add_subdirectory (softlight) 33 | add_subdirectory (subtract) 34 | add_subdirectory (uvmap) 35 | add_subdirectory (value) 36 | add_subdirectory (xfade0r) 37 | add_subdirectory (sleid0r) 38 | -------------------------------------------------------------------------------- /cmake/modules/FindCairo.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find Cairo 2 | # Once done, this will define 3 | # 4 | # Cairo_FOUND - system has Cairo 5 | # Cairo_INCLUDE_DIRS - the Cairo include directories 6 | # Cairo_LIBRARIES - link these to use Cairo 7 | 8 | include(LibFindMacros) 9 | 10 | # Freetype is not necessarily required on all platforms... 11 | if(NOT WIN32) 12 | set(cairo_needs_freetype true) 13 | endif(NOT WIN32) 14 | 15 | # Dependencies 16 | if(cairo_needs_freetype) 17 | libfind_package(Cairo Freetype) 18 | endif(cairo_needs_freetype) 19 | 20 | # Use pkg-config to get hints about paths 21 | libfind_pkg_check_modules(Cairo_PKGCONF cairo) 22 | 23 | # Include dir 24 | find_path(Cairo_INCLUDE_DIR 25 | NAMES cairo.h 26 | HINTS ${Cairo_PKGCONF_INCLUDE_DIRS} 27 | PATH_SUFFIXES cairo 28 | ) 29 | 30 | # Finally the library itself 31 | find_library(Cairo_LIBRARY 32 | NAMES cairo 33 | HINTS ${Cairo_PKGCONF_LIBRARY_DIRS} 34 | ) 35 | 36 | # Set the include dir variables and the libraries and let libfind_process do the rest. 37 | # NOTE: Singular variables for this library, plural for libraries this this lib depends on. 38 | set(Cairo_PROCESS_INCLUDES Cairo_INCLUDE_DIR) 39 | set(Cairo_PROCESS_LIBS Cairo_LIBRARY) 40 | 41 | libfind_process(Cairo) 42 | -------------------------------------------------------------------------------- /src/mixer2/xfade0r/xfade0r.cpp: -------------------------------------------------------------------------------- 1 | #include "frei0r.hpp" 2 | 3 | #include 4 | 5 | class xfade0r : public frei0r::mixer2 6 | { 7 | public: 8 | xfade0r(unsigned int width, unsigned int height) 9 | { 10 | fader = 0.0; 11 | register_param(fader,"fader","the fader position"); 12 | } 13 | 14 | struct fade_fun 15 | { 16 | fade_fun(double pos) 17 | { 18 | fader_pos=uint8_t(std::max(0.,std::min(255.,pos*255.))); 19 | } 20 | 21 | uint8_t operator()(uint8_t in1,uint8_t in2) 22 | { 23 | return ((255-fader_pos)*in1 + fader_pos*in2) / 256; 24 | } 25 | 26 | uint8_t fader_pos; 27 | }; 28 | 29 | void update(double time, 30 | uint32_t* out, 31 | const uint32_t* in1, 32 | const uint32_t* in2) 33 | { 34 | std::transform(reinterpret_cast(in1), 35 | reinterpret_cast(in1)+(width*height*4), 36 | reinterpret_cast(in2), 37 | reinterpret_cast(out), 38 | fade_fun(fader)); 39 | } 40 | 41 | private: 42 | double fader; 43 | }; 44 | 45 | 46 | frei0r::construct plugin("xfade0r", 47 | "a simple xfader", 48 | "Martin Bayer", 49 | 0,2); 50 | 51 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | # Frei0r developers union 2 | 3 | Read here an account of [Frei0r's project history](https://medium.com/think-do-tank/frei0r-the-free-and-open-source-video-effect-preservation-project-604134dde8b3). 4 | 5 | Frei0r is a Dyne.org project maintained by Denis "Jaromil" Roio and Dan Dennedy. 6 | 7 | ## Developers who contributed, in alphabetic order: 8 | 9 | Akito Iwakura 10 | Albert Frisch 11 | Ajrat Makhmutov 12 | Brendan Hack 13 | Brian Matherly 14 | Burkhard Plaum 15 | Carlo E. Prelz 16 | Christoph Willing 17 | Cynthia 18 | Erik Beck 19 | Esmane 20 | Filippo Giunchedi 21 | Gabriel Finch (Salsaman) 22 | Georg Seidel 23 | Henner Zeller 24 | Hedde Bosman 25 | IOhannes m. zmölnig 26 | Janne Liljeblad 27 | Jean-Baptiste Mardelle 28 | Jean-François Fortin Tam 29 | Jean-Sebastien Senecal 30 | Jerome Blanchi (d.j.a.y) 31 | Johann Jeg 32 | Joshua M. Doe 33 | Luca Bigliardi 34 | Maksim Golovkin (Максим Головкин) 35 | Marko Cebokli 36 | Martin Bayer 37 | Mathieu Guindon 38 | Matthias Schnöll 39 | Nicolas Carion 40 | Niels Elburg 41 | Phillip Promesberger 42 | Raphael Graf 43 | Richard Spindler 44 | Richard Ling (Chungzuwalla) 45 | Robert Schweikert 46 | Ross Lagerwall 47 | Samuel Mimram 48 | Simon A. Eugster 49 | Sofian Audry 50 | Stefano Sabatini 51 | Steinar H. Gunderson 52 | Thomas Coldrick 53 | Thomas Perl 54 | Till Theato 55 | Vadim Druzhin 56 | Vincent Pinon 57 | -------------------------------------------------------------------------------- /src/filter/elastic_scale/README.md: -------------------------------------------------------------------------------- 1 | # Elastic Scale 2 | 3 | Elastic scale allows one to apply non linear scale to video footage. 4 | 5 | Written by Matthias Schnöll, Aug 2018 and released under GNU GPL 6 | 7 | 8 | ## RELEASE NOTES 9 | 10 | ** Aug 2018 11 | initial release of plugin 12 | 13 | 14 | 15 | ## Description of the parameters: 16 | 17 | "Scale Center":
18 | Sets the horizontal center where the scaling origins from. range: [0,1] 19 | 20 | 21 | "Linear Scale Area":
22 | Width of the section that should only be scaled linearly. range: [0,1] 23 | 24 | 25 | "Linear Scale Factor":
26 | Scale factor by how much the linear scale are is scaled. range: [0,1] 27 | 28 | 29 | "Non Linear Scale Factor":
30 | Amount how much the outer left and outer right area besides the linear scale area are scaled non linearly. range: [0,1] 31 | 32 | 33 | 34 | ## Sample Images: 35 | 36 | 37 | The included images show how the effect modifies the respective footage. 38 | img1.jpg: original image, which shows a grid of equally sized squares 39 | 40 | 41 | img2.jpg: elastic_scale (parameters: 0.5|0|0|0.7125) applied to img1.jpg 42 | 43 | 44 | img3.jpg: elastic_scale and 16:9 linear scale applied to img1.jpg 45 | 46 | 47 | ### How to use with ffmpeg: 48 | 49 | Transform img1.jpg to img2.jpg:
50 | ```ffmpeg -i img1.jpg -vf "frei0r=elastic_scale:0.5|0|0|0.7125" img2.jpg``` 51 | 52 | Transform img1.jpg to img3.jpg:
53 | ```ffmpeg -i img1.jpg -vf "frei0r=elastic_scale:0.5|0|0|0.7125,scale=1920:1080,setsar=1:1" img3.jpg``` 54 | -------------------------------------------------------------------------------- /src/filter/scanline0r/scanline0r.cpp: -------------------------------------------------------------------------------- 1 | #include "frei0r.hpp" 2 | 3 | #include 4 | 5 | static inline uint8_t 6 | scale(uint8_t value, uint8_t factor) 7 | { 8 | return std::min((uint16_t)((uint16_t)value * (uint16_t)factor / 128), (uint16_t)value); 9 | } 10 | 11 | static inline void 12 | scale_scanline(uint32_t *dst_begin, const uint32_t *src_begin, const uint32_t *src_end, uint8_t factor) 13 | { 14 | union { uint32_t u32; uint8_t u8[4]; } v; 15 | 16 | while (src_begin < src_end) { 17 | v.u32 = *src_begin++; 18 | v.u8[0] = scale(v.u8[0], factor); 19 | v.u8[1] = scale(v.u8[1], factor); 20 | v.u8[2] = scale(v.u8[2], factor); 21 | v.u8[3] = scale(v.u8[3], factor); 22 | *dst_begin++ = v.u32; 23 | } 24 | } 25 | 26 | class scanline0r : public frei0r::filter 27 | { 28 | public: 29 | scanline0r(unsigned int width, unsigned int height) 30 | { 31 | //register_param(hsync,"HSync","the hsync offset"); 32 | } 33 | 34 | virtual void update(double time, 35 | uint32_t* out, 36 | const uint32_t* in) 37 | { 38 | for (unsigned int line=0; line < height; line+=2) 39 | { 40 | scale_scanline(out+line*width, in+line*width, in+(line+1)*width, 150); 41 | scale_scanline(out+(line+1)*width, in+(line+1)*width, in+(line+2)*width, 64); 42 | } 43 | } 44 | 45 | private: 46 | //double hsync; 47 | }; 48 | 49 | 50 | frei0r::construct plugin("scanline0r", 51 | "interlaced dark lines", 52 | "Martin Bayer", 53 | 0,3); 54 | 55 | -------------------------------------------------------------------------------- /src/generator/test_pat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (B_SOURCES test_pat_B.c) 2 | set (C_SOURCES test_pat_C.c) 3 | set (G_SOURCES test_pat_G.c) 4 | set (I_SOURCES test_pat_I.c) 5 | set (L_SOURCES test_pat_L.c) 6 | set (R_SOURCES test_pat_R.c) 7 | 8 | if (MSVC) 9 | set (B_SOURCES ${B_SOURCES} ${FREI0R_DEF}) 10 | set (C_SOURCES ${C_SOURCES} ${FREI0R_DEF}) 11 | set (G_SOURCES ${G_SOURCES} ${FREI0R_DEF}) 12 | set (I_SOURCES ${I_SOURCES} ${FREI0R_DEF}) 13 | set (L_SOURCES ${L_SOURCES} ${FREI0R_DEF}) 14 | set (R_SOURCES ${R_SOURCES} ${FREI0R_DEF}) 15 | endif (MSVC) 16 | 17 | if(NOT MSVC) 18 | link_libraries(m) 19 | endif() 20 | add_library (test_pat_B MODULE ${B_SOURCES}) 21 | add_library (test_pat_C MODULE ${C_SOURCES}) 22 | add_library (test_pat_G MODULE ${G_SOURCES}) 23 | add_library (test_pat_I MODULE ${I_SOURCES}) 24 | add_library (test_pat_L MODULE ${L_SOURCES}) 25 | add_library (test_pat_R MODULE ${R_SOURCES}) 26 | 27 | set_target_properties (test_pat_B PROPERTIES PREFIX "") 28 | set_target_properties (test_pat_C PROPERTIES PREFIX "") 29 | set_target_properties (test_pat_G PROPERTIES PREFIX "") 30 | set_target_properties (test_pat_I PROPERTIES PREFIX "") 31 | set_target_properties (test_pat_L PROPERTIES PREFIX "") 32 | set_target_properties (test_pat_R PROPERTIES PREFIX "") 33 | 34 | install (TARGETS test_pat_B LIBRARY DESTINATION ${LIBDIR}) 35 | install (TARGETS test_pat_C LIBRARY DESTINATION ${LIBDIR}) 36 | install (TARGETS test_pat_G LIBRARY DESTINATION ${LIBDIR}) 37 | install (TARGETS test_pat_I LIBRARY DESTINATION ${LIBDIR}) 38 | install (TARGETS test_pat_L LIBRARY DESTINATION ${LIBDIR}) 39 | install (TARGETS test_pat_R LIBRARY DESTINATION ${LIBDIR}) 40 | -------------------------------------------------------------------------------- /src/filter/nosync0r/nosync0r.cpp: -------------------------------------------------------------------------------- 1 | #include "frei0r.hpp" 2 | 3 | #include 4 | #include 5 | 6 | class nosync0r : public frei0r::filter 7 | { 8 | public: 9 | nosync0r(unsigned int width, unsigned int height) 10 | { 11 | hsync = 0.0; 12 | register_param(hsync,"HSync","the hsync offset"); 13 | vsync = 0.0; 14 | register_param(vsync,"VSync","the vsync offset"); 15 | } 16 | 17 | virtual void update(double time, 18 | uint32_t* out, 19 | const uint32_t* in) 20 | { 21 | if (hsync == 0.0 && vsync == 0.0) { 22 | std::copy(in, in+width*height, out); 23 | } else if (vsync == 0.0) { 24 | unsigned int 25 | first_line=static_cast(height*std::fmod(std::fabs(hsync),1.0)); 26 | 27 | std::copy(in+width*first_line, in+width*height, out); 28 | std::copy(in, in+width*first_line, out+width*(height-first_line)); 29 | } else { 30 | unsigned int hoffset=static_cast(height*std::fmod(std::fabs(hsync),1.0)); 31 | unsigned int voffset=static_cast(width*std::fmod(std::fabs(vsync),1.0)); 32 | for (unsigned int src_line = 0; src_line < height; src_line++) { 33 | unsigned int dst_line = (src_line + hoffset) % height; 34 | const uint32_t* src_pix = in + (width * src_line); 35 | uint32_t* dst_pix = out + (width * dst_line); 36 | std::copy(src_pix, src_pix + width - voffset, dst_pix + voffset); 37 | std::copy(src_pix + width - voffset, src_pix + width, dst_pix); 38 | } 39 | } 40 | } 41 | 42 | private: 43 | double hsync; 44 | double vsync; 45 | }; 46 | 47 | 48 | frei0r::construct plugin("nosync0r", 49 | "broken tv", 50 | "Martin Bayer", 51 | 0,2); 52 | 53 | -------------------------------------------------------------------------------- /src/generator/nois0r/nois0r.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This frei0r plugin generates white noise images 3 | 4 | Copyright (C) 2004, 2005 Martin Bayer 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | 23 | #include 24 | 25 | struct wnoise 26 | { 27 | wnoise(unsigned int s) 28 | : seed(s) {} 29 | 30 | unsigned int seed; 31 | 32 | unsigned int operator()() 33 | { 34 | seed *= 3039177861U; // parameter for LCG 35 | unsigned char rd = seed >> 24; 36 | return (rd | rd << 8 | rd << 16 | 0xff000000); 37 | } 38 | 39 | 40 | }; 41 | 42 | class nois0r : public frei0r::source 43 | { 44 | public: 45 | nois0r(unsigned int width, unsigned int height) 46 | { 47 | } 48 | 49 | 50 | virtual void update(double time, 51 | uint32_t* out) 52 | { 53 | wnoise wn(0x0f0f0f0f ^ (unsigned int)(time*100000.0)); 54 | 55 | std::generate(out, out+width*height, wn); 56 | } 57 | }; 58 | 59 | 60 | frei0r::construct plugin("Nois0r", 61 | "Generates white noise images", 62 | "Martin Bayer", 63 | 0,3); 64 | 65 | -------------------------------------------------------------------------------- /src/generator/onecol0r/onecol0r.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This frei0r plugin generates solid color images 3 | 4 | Copyright (C) 2004, 2005 Martin Bayer 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | 23 | #include 24 | 25 | class onecol0r : public frei0r::source 26 | { 27 | public: 28 | onecol0r(unsigned int width, unsigned int height) 29 | { 30 | register_param(color,"Color","the color of the image"); 31 | color.r = color.g = color.b = 0; 32 | } 33 | 34 | virtual void update(double time, 35 | uint32_t* out) 36 | { 37 | unsigned int col; 38 | unsigned char* c = reinterpret_cast(&col); 39 | 40 | c[0]=static_cast(color.b*255); 41 | c[1]=static_cast(color.g*255); 42 | c[2]=static_cast(color.r*255); 43 | c[3]=255; 44 | 45 | std::fill(out, out+width*height, col); 46 | } 47 | 48 | private: 49 | f0r_param_color color; 50 | }; 51 | 52 | 53 | frei0r::construct plugin("onecol0r", 54 | "image with just one color", 55 | "Martin Bayer", 56 | 0,3); 57 | 58 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.12) 2 | 3 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) 4 | 5 | project (frei0r) 6 | set (VERSION 2.5.1) 7 | 8 | include(GNUInstallDirs) 9 | 10 | option (WITHOUT_OPENCV "Disable plugins dependent upon OpenCV" OFF) 11 | option (WITHOUT_FACERECOGNITION "Disable facedetect plugin to avoid protobuf conflicts" OFF) 12 | 13 | if (NOT WITHOUT_OPENCV) 14 | find_package (OpenCV) 15 | endif () 16 | 17 | find_package (Cairo) 18 | 19 | include(FindPkgConfig) 20 | option (WITHOUT_GAVL "Disable plugins dependent upon gavl" OFF) 21 | if (PKG_CONFIG_FOUND AND NOT WITHOUT_GAVL) 22 | pkg_check_modules(GAVL gavl) 23 | endif () 24 | 25 | include_directories (AFTER include) 26 | 27 | if (NOT CMAKE_BUILD_TYPE) 28 | set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING 29 | "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." 30 | FORCE) 31 | endif (NOT CMAKE_BUILD_TYPE) 32 | 33 | set (LIBDIR "${CMAKE_INSTALL_LIBDIR}/frei0r-1") 34 | set (FREI0R_DEF "${CMAKE_SOURCE_DIR}/msvc/frei0r_1_0.def") 35 | set (FREI0R_1_1_DEF "${CMAKE_SOURCE_DIR}/msvc/frei0r_1_1.def") 36 | 37 | # --- custom targets: --- 38 | INCLUDE( cmake/modules/TargetDistclean.cmake OPTIONAL) 39 | 40 | install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) 41 | 42 | # For code documentation run: doxygen doc/Doxyfile 43 | # add_subdirectory (doc) 44 | 45 | add_subdirectory (src) 46 | 47 | # Generate frei0r.pc and install it. 48 | set (prefix "${CMAKE_INSTALL_PREFIX}") 49 | set (exec_prefix "${CMAKE_INSTALL_PREFIX}") 50 | set (libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") 51 | set (includedir "${CMAKE_INSTALL_PREFIX}/include") 52 | configure_file ("frei0r.pc.in" "frei0r.pc" @ONLY) 53 | install (FILES "${CMAKE_CURRENT_BINARY_DIR}/frei0r.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") 54 | -------------------------------------------------------------------------------- /include/frei0r/math.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_FREI0R_MATH_H 2 | #define INCLUDED_FREI0R_MATH_H 3 | 4 | /* 5 | 6 | Code stripped from The Gimp: 7 | INT_MULT(a,b,t) 8 | INT_MULT3(a,b,c,t) 9 | INT_BLEND(a,b,alpha,tmp) 10 | CLAMP 11 | ROUND 12 | MAX255 13 | 14 | Code stripped from Drone: 15 | CLAMP0255 16 | SQR 17 | */ 18 | 19 | /* Clamps a int32-range int between 0 and 255 inclusive. */ 20 | #ifndef CLAMP0255 21 | static inline unsigned char CLAMP0255(int32_t a) 22 | { 23 | return (unsigned char) 24 | ( (((-a) >> 31) & a) // 0 if the number was negative 25 | | (255 - a) >> 31); // -1 if the number was greater than 255 26 | } 27 | #endif 28 | 29 | /* Provided temporary int t, returns a * b / 255 */ 30 | #ifndef INT_MULT 31 | #define INT_MULT(a,b,t) ((t) = (a) * (b) + 0x80, ((((t) >> 8) + (t)) >> 8)) 32 | #endif 33 | 34 | /* This version of INT_MULT3 is very fast, but suffers from some 35 | slight roundoff errors. It returns the correct result 99.987 36 | percent of the time */ 37 | #ifndef INT_MULT3 38 | #define INT_MULT3(a,b,c,t) ((t) = (a) * (b) * (c) + 0x7F5B, \ 39 | ((((t) >> 7) + (t)) >> 16)) 40 | #endif 41 | 42 | #ifndef INT_BLEND 43 | #define INT_BLEND(a,b,alpha,tmp) (INT_MULT((a) - (b), alpha, tmp) + (b)) 44 | #endif 45 | 46 | #ifndef CLAMP 47 | //! Clamp x at min and max 48 | #define CLAMP(x,min,max) ((x) < (min) ? (min) : ((x) > (max) ? (max) : (x))) 49 | #endif 50 | 51 | #ifndef ROUND 52 | //! Round. 53 | #define ROUND(x) ((int32_t)((x)+0.5)) 54 | #endif 55 | 56 | #ifndef SQR 57 | //! Square. 58 | #define SQR(x) ((x) * (x)) 59 | #endif 60 | 61 | #ifndef MAX255 62 | //! Limit a (0->511) int to 255. 63 | uint8_t MAX255(uint32_t a) { return (uint8_t) (a | ((a & 256) - ((a & 256) >> 8))); } 64 | #endif 65 | 66 | #ifndef MIN 67 | #define MIN(x, y) ((x) < (y) ? (x) : (y)) 68 | #endif 69 | 70 | #ifndef MAX 71 | #define MAX(x, y) ((x) > (y) ? (x) : (y)) 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/filter/invert0r/invert0r.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "frei0r.h" 5 | 6 | typedef struct inverter_instance 7 | { 8 | unsigned int width; 9 | unsigned int height; 10 | } inverter_instance_t; 11 | 12 | int f0r_init() 13 | { 14 | return 1; 15 | } 16 | 17 | void f0r_deinit() 18 | { /* no initialization required */ } 19 | 20 | void f0r_get_plugin_info(f0r_plugin_info_t* inverterInfo) 21 | { 22 | inverterInfo->name = "Invert0r"; 23 | inverterInfo->author = "Gephex crew"; 24 | inverterInfo->plugin_type = F0R_PLUGIN_TYPE_FILTER; 25 | inverterInfo->color_model = F0R_COLOR_MODEL_RGBA8888; 26 | inverterInfo->frei0r_version = FREI0R_MAJOR_VERSION; 27 | inverterInfo->major_version = 0; 28 | inverterInfo->minor_version = 9; 29 | inverterInfo->num_params = 0; 30 | inverterInfo->explanation = "Inverts all colors of a source image"; 31 | } 32 | 33 | void f0r_get_param_info(f0r_param_info_t* info, int param_index) 34 | { 35 | /* no params */ 36 | } 37 | 38 | f0r_instance_t f0r_construct(unsigned int width, unsigned int height) 39 | { 40 | inverter_instance_t* inst = (inverter_instance_t*)calloc(1, sizeof(*inst)); 41 | inst->width = width; inst->height = height; 42 | return (f0r_instance_t)inst; 43 | } 44 | 45 | void f0r_destruct(f0r_instance_t instance) 46 | { 47 | free(instance); 48 | } 49 | 50 | void f0r_set_param_value(f0r_instance_t instance, 51 | f0r_param_t param, int param_index) 52 | { /* no params */ } 53 | 54 | void f0r_get_param_value(f0r_instance_t instance, 55 | f0r_param_t param, int param_index) 56 | { /* no params */ } 57 | 58 | void f0r_update(f0r_instance_t instance, double time, 59 | const uint32_t* inframe, uint32_t* outframe) 60 | { 61 | assert(instance); 62 | inverter_instance_t* inst = (inverter_instance_t*)instance; 63 | unsigned int w = inst->width; 64 | unsigned int h = inst->height; 65 | unsigned int x,y; 66 | 67 | uint32_t* dst = outframe; 68 | const uint32_t* src = inframe; 69 | for(y=0;y 4 | #include 5 | #include 6 | #include 7 | 8 | class delay0r : public frei0r::filter 9 | { 10 | public: 11 | delay0r(unsigned int width, unsigned int height) 12 | { 13 | delay = 0.0; 14 | register_param(delay,"DelayTime","the delay time"); 15 | } 16 | 17 | ~delay0r() 18 | { 19 | for (std::list< std::pair< double, unsigned int* > >::iterator i=buffer.begin(); i != buffer.end(); ++i) 20 | { 21 | delete[] i->second; 22 | i=buffer.erase(i); 23 | } 24 | } 25 | 26 | virtual void update(double time, 27 | uint32_t* out, 28 | const uint32_t* in) 29 | { 30 | unsigned int* reusable = 0; 31 | // remove old frames 32 | for (std::list< std::pair< double, unsigned int* > >::iterator i=buffer.begin(); i != buffer.end(); ++i) 33 | { 34 | if (i->first < (time - delay) || i->first >= time) 35 | { 36 | // remove me 37 | if (reusable != 0) 38 | delete[] i->second; 39 | else 40 | reusable = i->second; 41 | 42 | i=buffer.erase(i); 43 | } 44 | } 45 | 46 | // add new frame 47 | if (reusable == 0) 48 | reusable = new unsigned int[width*height]; 49 | 50 | std::copy(in, in+width*height,reusable); 51 | buffer.push_back(std::make_pair(time,reusable)); 52 | 53 | // copy best 54 | unsigned int* best_data=0; 55 | double best_time=0; 56 | 57 | assert (buffer.size() >0); 58 | for (std::list< std::pair< double, unsigned int* > >::iterator i=buffer.begin(); i != buffer.end(); ++i) 59 | { 60 | if (best_data==0 || (i->first < best_time)) 61 | { 62 | best_time=i->first; 63 | best_data=i->second; 64 | } 65 | } 66 | 67 | assert(best_data != 0); 68 | std::copy(best_data,best_data+width*height,out); 69 | } 70 | 71 | private: 72 | double delay; 73 | std::list< std::pair< double, unsigned int* > > buffer; 74 | }; 75 | 76 | 77 | frei0r::construct plugin("delay0r", 78 | "video delay", 79 | "Martin Bayer", 80 | 0,2); 81 | 82 | -------------------------------------------------------------------------------- /src/filter/bw0r/bw0r.c: -------------------------------------------------------------------------------- 1 | #include "frei0r.h" 2 | #include 3 | #include 4 | 5 | typedef struct blackwhite_instance 6 | { 7 | unsigned int width; 8 | unsigned int height; 9 | } blackwhite_instance_t; 10 | 11 | int f0r_init() 12 | { 13 | return 1; 14 | } 15 | 16 | void f0r_deinit() 17 | { /* no initialization required */ } 18 | 19 | void f0r_get_plugin_info(f0r_plugin_info_t* blackwhiteInfo) 20 | { 21 | blackwhiteInfo->name = "bw0r"; 22 | blackwhiteInfo->author = "coma@gephex.org"; 23 | blackwhiteInfo->plugin_type = F0R_PLUGIN_TYPE_FILTER; 24 | blackwhiteInfo->color_model = F0R_COLOR_MODEL_RGBA8888; 25 | blackwhiteInfo->frei0r_version = FREI0R_MAJOR_VERSION; 26 | blackwhiteInfo->major_version = 0; 27 | blackwhiteInfo->minor_version = 9; 28 | blackwhiteInfo->num_params = 0; 29 | blackwhiteInfo->explanation = "Turns image black/white."; 30 | } 31 | 32 | void f0r_get_param_info(f0r_param_info_t* info, int param_index) 33 | { 34 | /* no params */ 35 | } 36 | 37 | f0r_instance_t f0r_construct(unsigned int width, unsigned int height) 38 | { 39 | blackwhite_instance_t* inst = (blackwhite_instance_t*)calloc(1, sizeof(*inst)); 40 | inst->width = width; inst->height = height; 41 | return (f0r_instance_t)inst; 42 | } 43 | 44 | void f0r_destruct(f0r_instance_t instance) 45 | { 46 | free(instance); 47 | } 48 | 49 | void f0r_set_param_value(f0r_instance_t instance, 50 | f0r_param_t param, int param_index) 51 | { /* no params */ } 52 | 53 | void f0r_get_param_value(f0r_instance_t instance, 54 | f0r_param_t param, int param_index) 55 | { /* no params */ } 56 | 57 | void f0r_update(f0r_instance_t instance, double time, 58 | const uint32_t* inframe, uint32_t* outframe) 59 | { 60 | assert(instance); 61 | blackwhite_instance_t* inst = (blackwhite_instance_t*)instance; 62 | unsigned int w = inst->width; 63 | unsigned int h = inst->height; 64 | unsigned int x,y; 65 | 66 | uint32_t* dst = outframe; 67 | const uint32_t* src = inframe; 68 | for(y=h;y>0;--y) 69 | for(x=w;x>0;--x,++src,++dst) 70 | { 71 | int tmpbw; 72 | unsigned char* tmpc = (unsigned char*)src; 73 | tmpbw = (tmpc[0] + tmpc[1] + tmpc[2]) / 3; 74 | *dst = (tmpc[3] << 24) | (tmpbw << 16) | (tmpbw << 8) | tmpbw; 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /src/filter/kaleid0sc0pe/kaleid0sc0pe.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Kaleid0sc0pe 4 | Does what a kaleidoscope does 5 | Brendan Hack 6 | 7 | Origin-X 8 | 9 | 10 | Origin-Y 11 | 12 | 13 | segmentation 14 | 15 | 16 | Manual source segment 17 | 18 | 19 | Centred,Anti Clockwise,Clockwise 20 | Rotation direction 21 | 22 | 23 | Source angle 24 | 25 | 26 | Reflect into edges 27 | 28 | 29 | Edge Threshold 30 | 31 | 32 | Top Right,Top Left,Bottom Left,Bottom Right 33 | Preferred Corner 34 | 35 | 36 | Search CW for preferred corner 37 | 38 | 39 | Background Colour 40 | 41 | 42 | Background Alpha 43 | 44 | 45 | Multithreaded 46 | 47 | 48 | Thread count 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/filter/primaries/primaries.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * primaries 3 | * 2009 Hedde Bosman 4 | * 5 | * This source code is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Public License as published by 7 | * the Free Software Foundation; either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This source code is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Please refer 13 | * to the GNU Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Public License along 16 | * with this source code; if not, write to: Free Software Foundation, 17 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | */ 20 | #include "frei0r.hpp" 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | union px_t { 30 | uint32_t u; 31 | unsigned char c[4]; // 0=B, 1=G,2=R,3=A ? i think :P 32 | }; 33 | 34 | class primaries : public frei0r::filter { 35 | private: 36 | double factor; 37 | 38 | public: 39 | primaries(unsigned int width, unsigned int height) { 40 | factor = 1; 41 | register_param(factor, "Factor", "influence of mean px value. > 32 = 0"); 42 | } 43 | ~primaries() { 44 | } 45 | 46 | virtual void update(double time, 47 | uint32_t* out, 48 | const uint32_t* in) { 49 | unsigned char mean = 0; 50 | 51 | int f = factor+1; // f = [2,inf) 52 | int factor127 = (f*f-3)*127; 53 | int factorTot = f*f; 54 | if (factor127 < 0) { 55 | factor127 = 0; 56 | factorTot = 3; 57 | } 58 | 59 | for (unsigned int i = 0; i < size; i++) { 60 | px_t pi; 61 | pi.u = in[i]; 62 | 63 | if (f > 32) // influence of mean color value does hardly change after this value 64 | mean = 127; 65 | else 66 | mean = (pi.c[0] + pi.c[1] + pi.c[2] + factor127)/factorTot; 67 | pi.c[0] = (pi.c[0] > mean ? 255 : 0); 68 | pi.c[1] = (pi.c[1] > mean ? 255 : 0); 69 | pi.c[2] = (pi.c[2] > mean ? 255 : 0); 70 | 71 | out[i] = pi.u; 72 | } 73 | } 74 | }; 75 | 76 | 77 | frei0r::construct plugin("primaries", 78 | "Reduce image to primary colors", 79 | "Hedde Bosman", 80 | 0,2); 81 | 82 | -------------------------------------------------------------------------------- /src/filter/twolay0r/twolay0r.cpp: -------------------------------------------------------------------------------- 1 | #include "frei0r.hpp" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | class twolay0r : public frei0r::filter 11 | { 12 | static unsigned char grey(unsigned int value) 13 | { 14 | unsigned char* rgba = reinterpret_cast(&value); 15 | unsigned char gw= (rgba[0] + rgba[1] + 2*rgba[2])/4; 16 | return gw; 17 | } 18 | 19 | struct histogram 20 | { 21 | histogram() 22 | : hist(256) 23 | { 24 | std::fill(hist.begin(),hist.end(),0); 25 | } 26 | 27 | void operator()(uint32_t value) 28 | { 29 | ++hist[grey(value)]; 30 | } 31 | 32 | std::vector hist; 33 | }; 34 | 35 | public: 36 | twolay0r(unsigned int width, unsigned int height) 37 | { 38 | } 39 | 40 | virtual void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in) 43 | { 44 | histogram h; 45 | 46 | // create histogramm 47 | for (const unsigned int* i=in; i != in + (width*height);++i) 48 | h(*i); 49 | 50 | // calc th 51 | int th=127; 52 | int th_old=0; 53 | 54 | while (th!=th_old) 55 | { 56 | th_old=th; 57 | // calc low 58 | double num = 0; 59 | double val = 0; 60 | for (int i= (int)(th-1); i!= -1; --i) 61 | { 62 | num += h.hist[i]; 63 | val += h.hist[i]*i; 64 | } 65 | unsigned char low = static_cast(val/num); 66 | 67 | // clac hi 68 | num = 0; 69 | val = 0; 70 | for (unsigned int i=th;i!=256;++i) 71 | { 72 | num += h.hist[i]; 73 | val += h.hist[i]*i; 74 | } 75 | unsigned char hi = static_cast(val/num); 76 | 77 | th = (low + hi) / 2; 78 | } 79 | 80 | 81 | 82 | // create b/w image with the th value 83 | { 84 | uint32_t* outpixel= out; 85 | const uint32_t* pixel=in; 86 | while(pixel != in+(width*height)) 87 | { 88 | if ( grey(*pixel) plugin("Twolay0r", 101 | "dynamic thresholding", 102 | "Martin Bayer", 103 | 0,2); 104 | 105 | -------------------------------------------------------------------------------- /src/generator/lissajous0r/lissajous0r.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This frei0r plugin generates white noise images 3 | 4 | Copyright (C) 2004, 2005 Martin Bayer 5 | Copyright (C) 2005 Georg Seidel 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | 22 | #include "frei0r.hpp" 23 | 24 | #include 25 | #include 26 | 27 | 28 | #ifndef M_PI 29 | #define M_PI 3.14159265358979323846 30 | #endif 31 | 32 | class lissajous0r: public frei0r::source 33 | { 34 | public: 35 | lissajous0r(unsigned int width, unsigned int height) 36 | { 37 | r_x = r_y = 0.0; 38 | register_param(r_x,"ratiox","x-ratio"); 39 | register_param(r_y,"ratioy","y-ratio"); 40 | } 41 | 42 | 43 | virtual void update(double time, 44 | uint32_t* out) 45 | { 46 | std::fill(out, out+width*height, 0x00000000); 47 | 48 | double rx=1.0/(0.999999-r_x); 49 | double ry=1.0/(0.999999-r_y); 50 | 51 | double w = 0.5*(width-1); 52 | double h = 0.5*(height-1); 53 | 54 | const unsigned int samples = 15*(width+height); 55 | 56 | double deltax = (rx*2*M_PI) / (double) samples; 57 | double deltay = (ry*2*M_PI) / (double) samples; 58 | double tx = 0; 59 | double ty = 0; 60 | for (unsigned int i=samples; i != 0; --i, tx+=deltax, ty+=deltay) 61 | { 62 | unsigned int x = static_cast(w*(1.0+sin(tx))); 63 | unsigned int y = static_cast(h*(1.0+cos(ty))); 64 | 65 | out[width*y + x]=0xffffffff; 66 | } 67 | } 68 | private: 69 | double r_x; 70 | double r_y; 71 | }; 72 | 73 | 74 | frei0r::construct plugin("Lissajous0r", 75 | "Generates Lissajous0r images", 76 | "Martin Bayer", 77 | 0,3); 78 | 79 | -------------------------------------------------------------------------------- /src/mixer2/multiply/multiply.cpp: -------------------------------------------------------------------------------- 1 | /* multiply.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class multiply : public frei0r::mixer2 28 | { 29 | public: 30 | multiply(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] multiply operation between the pixel sources 37 | * in1 and in2. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | 50 | uint32_t b, tmp; 51 | 52 | while (sizeCounter--) 53 | { 54 | for (b = 0; b < ALPHA; b++) 55 | dst[b] = INT_MULT(src1[b], src2[b], tmp); 56 | 57 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 58 | 59 | src1 += NBYTES; 60 | src2 += NBYTES; 61 | dst += NBYTES; 62 | } 63 | } 64 | 65 | 66 | 67 | }; 68 | 69 | 70 | frei0r::construct plugin("multiply", 71 | "Perform an RGB[A] multiply operation between the pixel sources.", 72 | "Jean-Sebastien Senecal", 73 | 0,2, 74 | F0R_COLOR_MODEL_RGBA8888); 75 | 76 | -------------------------------------------------------------------------------- /src/mixer2/alphain/alphain.cpp: -------------------------------------------------------------------------------- 1 | /* alphain.cpp 2 | * Copyright (C) 2005 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "frei0r.hpp" 21 | #include "frei0r/math.h" 22 | 23 | #include 24 | 25 | class alphain : public frei0r::mixer2 26 | { 27 | public: 28 | alphain(unsigned int width, unsigned int height) 29 | { 30 | } 31 | 32 | void update(double time, 33 | uint32_t* out, 34 | const uint32_t* in1, 35 | const uint32_t* in2) 36 | { 37 | uint8_t *dst = reinterpret_cast(out); 38 | const uint8_t *src1 = reinterpret_cast(in1); 39 | const uint8_t *src2 = reinterpret_cast(in2); 40 | 41 | for (unsigned int i=0; i plugin("alphain", 69 | "the alpha IN operation", 70 | "Jean-Sebastien Senecal", 71 | 0,2, 72 | F0R_COLOR_MODEL_RGBA8888); 73 | 74 | -------------------------------------------------------------------------------- /src/mixer2/alphaout/alphaout.cpp: -------------------------------------------------------------------------------- 1 | /* alphaout.cpp 2 | * Copyright (C) 2005 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "frei0r.hpp" 21 | #include "frei0r/math.h" 22 | 23 | #include 24 | 25 | class alphaout : public frei0r::mixer2 26 | { 27 | public: 28 | alphaout(unsigned int width, unsigned int height) 29 | { 30 | } 31 | 32 | void update(double time, 33 | uint32_t* out, 34 | const uint32_t* in1, 35 | const uint32_t* in2) 36 | { 37 | uint8_t *dst = reinterpret_cast(out); 38 | const uint8_t *src1 = reinterpret_cast(in1); 39 | const uint8_t *src2 = reinterpret_cast(in2); 40 | 41 | for (unsigned int i=0; i plugin("alphaout", 69 | "the alpha OUT operation", 70 | "Jean-Sebastien Senecal", 71 | 0,2, 72 | F0R_COLOR_MODEL_RGBA8888); 73 | 74 | -------------------------------------------------------------------------------- /src/mixer2/subtract/subtract.cpp: -------------------------------------------------------------------------------- 1 | /* subtract.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class subtract : public frei0r::mixer2 28 | { 29 | public: 30 | subtract(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] subtract operation of the pixel source 37 | * ctx-B from in1. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | 50 | uint32_t b; 51 | int diff; 52 | 53 | while (sizeCounter--) 54 | { 55 | for (b = 0; b < ALPHA; b++) 56 | { 57 | diff = src1[b] - src2[b]; 58 | dst[b] = MAX(diff, 0); 59 | } 60 | 61 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 62 | 63 | src1 += NBYTES; 64 | src2 += NBYTES; 65 | dst += NBYTES; 66 | } 67 | } 68 | 69 | 70 | 71 | }; 72 | 73 | 74 | frei0r::construct plugin("subtract", 75 | "Perform an RGB[A] subtract operation of the pixel source input2 from input1.", 76 | "Jean-Sebastien Senecal", 77 | 0,2, 78 | F0R_COLOR_MODEL_RGBA8888); 79 | 80 | -------------------------------------------------------------------------------- /src/mixer2/difference/difference.cpp: -------------------------------------------------------------------------------- 1 | /* difference.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class difference : public frei0r::mixer2 28 | { 29 | public: 30 | difference(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] difference operation between the pixel sources 37 | * in1 and in2. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | 50 | uint32_t b; 51 | int diff; 52 | 53 | while (sizeCounter--) 54 | { 55 | for (b = 0; b < ALPHA; b++) 56 | { 57 | diff = src1[b] - src2[b]; 58 | dst[b] = (diff < 0) ? -diff : diff; 59 | } 60 | 61 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 62 | 63 | src1 += NBYTES; 64 | src2 += NBYTES; 65 | dst += NBYTES; 66 | } 67 | } 68 | 69 | }; 70 | 71 | 72 | frei0r::construct plugin("difference", 73 | "Perform an RGB[A] difference operation between the pixel sources.", 74 | "Jean-Sebastien Senecal", 75 | 0,2, 76 | F0R_COLOR_MODEL_RGBA8888); 77 | 78 | -------------------------------------------------------------------------------- /src/mixer2/screen/screen.cpp: -------------------------------------------------------------------------------- 1 | /* screen.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class screen : public frei0r::mixer2 28 | { 29 | public: 30 | screen(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] screen operation between the pixel sources 37 | * in1 and in2, using the generalised algorithm: 38 | * 39 | * D = 255 - (255 - A) * (255 - B) 40 | * 41 | **/ 42 | void update(double time, 43 | uint32_t* out, 44 | const uint32_t* in1, 45 | const uint32_t* in2) 46 | { 47 | const uint8_t *src1 = reinterpret_cast(in1); 48 | const uint8_t *src2 = reinterpret_cast(in2); 49 | uint8_t *dst = reinterpret_cast(out); 50 | uint32_t sizeCounter = size; 51 | 52 | uint32_t b, tmp; 53 | 54 | while (sizeCounter--) 55 | { 56 | for (b = 0; b < ALPHA; b++) 57 | dst[b] = 255 - INT_MULT((255 - src1[b]), (255 - src2[b]), tmp); 58 | 59 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 60 | 61 | src1 += NBYTES; 62 | src2 += NBYTES; 63 | dst += NBYTES; 64 | } 65 | } 66 | 67 | 68 | 69 | }; 70 | 71 | 72 | frei0r::construct plugin("screen", 73 | "Perform an RGB[A] screen operation between the pixel sources, using the generalised algorithm: D = 255 - (255 - A) * (255 - B)", 74 | "Jean-Sebastien Senecal", 75 | 0,2, 76 | F0R_COLOR_MODEL_RGBA8888); 77 | 78 | -------------------------------------------------------------------------------- /src/mixer2/divide/divide.cpp: -------------------------------------------------------------------------------- 1 | /* divide.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class divide : public frei0r::mixer2 28 | { 29 | public: 30 | divide(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] divide operation between the pixel sources in1 37 | * and in2. in1 is the numerator, in2 the denominator. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | 50 | uint32_t b, result; 51 | 52 | while (sizeCounter--) 53 | { 54 | for (b = 0; b < ALPHA; b++) 55 | { 56 | result = ((src1[b] * 256) / (1 + src2[b])); 57 | dst[b] = MIN(result, 255u); 58 | } 59 | 60 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 61 | 62 | src1 += NBYTES; 63 | src2 += NBYTES; 64 | dst += NBYTES; 65 | } 66 | } 67 | 68 | 69 | 70 | }; 71 | 72 | 73 | frei0r::construct plugin("divide", 74 | "Perform an RGB[A] divide operation between the pixel sources: input1 is the numerator, input2 the denominator", 75 | "Jean-Sebastien Senecal", 76 | 0,2, 77 | F0R_COLOR_MODEL_RGBA8888); 78 | 79 | -------------------------------------------------------------------------------- /src/filter/coloradj/readme: -------------------------------------------------------------------------------- 1 | coloradj* 2 | 3 | These plugins are for manual color adjustment. 4 | For (semi)automatic color correction, use "balanc0r", "colgate" and/or 5 | "three_point_balance" plugins. 6 | 7 | 8 | Included are the following plugins: 9 | 10 | coloradj_RGB: simple RGB manual color adjustment 11 | 12 | 13 | Written by Marko Cebokli, jul 2010, and released under GNU GPL 14 | 15 | 16 | RELEASE NOTES 17 | 18 | ** jul 2010 19 | Version 0.1 20 | "pre-alpha" (throw it out and see what happens... :-) 21 | 22 | 23 | 24 | 25 | 26 | ****** DESCRIPTIONS OF EACH PLUGIN FOLLOW ****** 27 | 28 | COLORADJ_RGB 29 | 30 | This plugin is for simple manual color adjustment by RGB channel, either 31 | through adding constants, or changing the channel gammas or gains. 32 | 33 | By "simple" I mean that it works channel-wise, no crosstalk. The 34 | off-diagonal elements of the transform matrix are zero - no color 35 | crosstalk, no color space rotation. 36 | But this should be sufficient for many tasks. For example, when 37 | shooting under tungsten light, the blue signal will not migrate into 38 | red, it will simply be too small. Amplifying the blue (and a bit 39 | of green too) should be all that is needed. Similar, an underwater 40 | shot will simply be red deficient, needing some red boost, etc. 41 | 42 | parameters: 43 | 44 | R,G,B: 45 | these determine the change in each of the three color channels. 46 | 47 | Action: 48 | "Add constant" adds a fixed value between -150 and +150 (this 49 | is sometimes called "black level" or "setup"). 50 | "Change gamma" changes channel gamma between 0.3333 and 3.0. 51 | "Multiply" multiplies channel with a value between 0.3333 52 | and 3.0 (sometimes called "gain" or "contrast") 53 | 54 | NOTE1: to apply more than one action above, use cascaded instances of 55 | coloradj_RGB. 56 | NOTE2: "Add constant" simply shifts the RGB "cube" colorspace. This 57 | means, that on one end we are left with empty space, which is filled 58 | with zeros, and on the other end, values can "fall outside", and in this 59 | case they will be truncated to max (255). 60 | "Change gain" changes the size of the cube, keeping the "black" corner 61 | fixed, affecting predominately highlights, but the other end can still 62 | "fall out" and get 255 truncated. 63 | "Change gamma" keeps the whole cube in the same place, just stretches 64 | and squeezes its interior, so no zero filling or truncation is necessary. 65 | To visualize this plugin's actions, apply it to "test_pat_L" pattern 2, 66 | and watch the result with "pr0file". 67 | 68 | Keep luma: 69 | Fixes the luma value, so that the sliders only affect color. 70 | 71 | -------------------------------------------------------------------------------- /src/mixer2/alphaatop/alphaatop.cpp: -------------------------------------------------------------------------------- 1 | /* alphaatop.cpp 2 | * Copyright (C) 2005 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "frei0r.hpp" 21 | #include "frei0r/math.h" 22 | 23 | #include 24 | 25 | class alphaatop : public frei0r::mixer2 26 | { 27 | public: 28 | alphaatop(unsigned int width, unsigned int height) 29 | { 30 | } 31 | 32 | void update(double time, 33 | uint32_t* out, 34 | const uint32_t* in1, 35 | const uint32_t* in2) 36 | { 37 | uint8_t *dst = reinterpret_cast(out); 38 | const uint8_t *src1 = reinterpret_cast(in1); 39 | const uint8_t *src2 = reinterpret_cast(in2); 40 | 41 | for (unsigned int i=0; i plugin("alphaatop", 71 | "the alpha ATOP operation", 72 | "Jean-Sebastien Senecal", 73 | 0,2, 74 | F0R_COLOR_MODEL_RGBA8888); 75 | 76 | -------------------------------------------------------------------------------- /src/mixer2/grain_extract/grain_extract.cpp: -------------------------------------------------------------------------------- 1 | /* grain_extract.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class grain_extract : public frei0r::mixer2 28 | { 29 | public: 30 | grain_extract(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] grain-extract operation between the pixel sources 37 | * in1 and in2. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | 50 | uint32_t b; 51 | int diff; 52 | 53 | while (sizeCounter--) 54 | { 55 | for (b = 0; b < ALPHA; b++) 56 | { 57 | diff = src1[b] - src2[b] + 128; 58 | dst[b] = (uint8_t) CLAMP0255(diff); 59 | } 60 | 61 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 62 | 63 | src1 += NBYTES; 64 | src2 += NBYTES; 65 | dst += NBYTES; 66 | } 67 | } 68 | 69 | 70 | 71 | }; 72 | 73 | 74 | frei0r::construct plugin("grain_extract", 75 | "Perform an RGB[A] grain-extract operation between the pixel sources.", 76 | "Jean-Sebastien Senecal", 77 | 0,2, 78 | F0R_COLOR_MODEL_RGBA8888); 79 | 80 | -------------------------------------------------------------------------------- /src/mixer2/grain_merge/grain_merge.cpp: -------------------------------------------------------------------------------- 1 | /* grain_merge.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class grain_merge : public frei0r::mixer2 28 | { 29 | public: 30 | grain_merge(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] grain-merge operation between the pixel sources 37 | * in1 and in2. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | 50 | uint32_t b; 51 | int sum; 52 | 53 | while (sizeCounter--) 54 | { 55 | for (b = 0; b < ALPHA; b++) 56 | { 57 | /* Add, re-center and clip. */ 58 | sum = src1[b] + src2[b] - 128; 59 | dst[b] = (uint8_t) CLAMP0255(sum); 60 | } 61 | 62 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 63 | 64 | src1 += NBYTES; 65 | src2 += NBYTES; 66 | dst += NBYTES; 67 | } 68 | } 69 | 70 | 71 | }; 72 | 73 | 74 | frei0r::construct plugin("grain_merge", 75 | "Perform an RGB[A] grain-merge operation between the pixel sources.", 76 | "Jean-Sebastien Senecal", 77 | 0,2, 78 | F0R_COLOR_MODEL_RGBA8888); 79 | 80 | -------------------------------------------------------------------------------- /src/filter/autothresh0ld/variance.h: -------------------------------------------------------------------------------- 1 | #ifdef __SSE2__ 2 | #include 3 | #endif 4 | 5 | static float find_variance(float *hist, int thresh) 6 | { 7 | float w_0 = 0.0, mu_0 = 0.0, w_1 = 0.0, mu_1 = 0.0; 8 | 9 | for (int i = 0; i < thresh; ++i) 10 | { 11 | w_0 += hist[i]; 12 | mu_0 += i * hist[i]; 13 | } 14 | for (int i = thresh; i < 256; ++i) 15 | { 16 | w_1 += hist[i]; 17 | mu_1 += i * hist[i]; 18 | } 19 | 20 | float mu_diff = (mu_0/w_0 - mu_1/w_1); 21 | return w_0*w_1*mu_diff*mu_diff; 22 | } 23 | 24 | #ifdef __SSE2__ 25 | static float _sse1_hadd_ps(__m128 v) 26 | { 27 | // Based on a StackOverflow answer. 28 | __m128 shuf = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 3, 0, 1)); 29 | __m128 sums = _mm_add_ps(v, shuf); 30 | shuf = _mm_movehl_ps(shuf, sums); 31 | sums = _mm_add_ss(sums, shuf); 32 | return _mm_cvtss_f32(sums); 33 | } 34 | 35 | static float find_variance_sse2(float *hist, int thresh) 36 | { 37 | __m128 vw_0 = _mm_setzero_ps(), vmu_0 = _mm_setzero_ps(), 38 | vw_1 = _mm_setzero_ps(), vmu_1 = _mm_setzero_ps(); 39 | __m128 vcnt = _mm_set_ps(0, 1, 2, 3); 40 | 41 | int thresh_low = (thresh / 4 + 0) * 4, 42 | thresh_up = (thresh / 4 + 1) * 4; 43 | 44 | for (int i = 0; i < thresh_low; i+=4) 45 | { 46 | __m128 vhist = _mm_castsi128_ps(_mm_loadu_si128((void*)&hist[i])); 47 | 48 | vw_0 = _mm_add_ps(vhist, vw_0); 49 | vmu_0 = _mm_add_ps(_mm_mul_ps(vcnt, vhist), vw_0); 50 | vcnt = _mm_add_ps(vcnt, _mm_set1_ps(4)); 51 | } 52 | 53 | // This is skipped, and handled as an edge case by non-SSE code. 54 | vcnt = _mm_add_ps(vcnt, _mm_set1_ps(4)); 55 | 56 | for (int i = thresh_up; i < 256; i+=4) 57 | { 58 | __m128 vhist = _mm_castsi128_ps(_mm_loadu_si128((void*)&hist[i])); 59 | 60 | vw_1 = _mm_add_ps(vhist, vw_1); 61 | vmu_1 = _mm_add_ps(_mm_mul_ps(vcnt, vhist), vw_1); 62 | vcnt = _mm_add_ps(vcnt, _mm_set1_ps(4)); 63 | } 64 | 65 | float w_0 = _sse1_hadd_ps(vw_0), mu_0 = _sse1_hadd_ps(vmu_0), 66 | w_1 = _sse1_hadd_ps(vw_1), mu_1 = _sse1_hadd_ps(vmu_1); 67 | 68 | // This edge case is here, because thresh may not be a multiple of 4. 69 | for (int i = thresh_low; i < thresh; ++i) 70 | { 71 | w_0 += hist[i]; 72 | mu_0 += i * hist[i]; 73 | } 74 | 75 | for (int i = thresh; i < thresh_up; ++i) 76 | { 77 | w_1 += hist[i]; 78 | mu_1 += i * hist[i]; 79 | } 80 | 81 | float mu_diff = (mu_0/w_0 - mu_1/w_1); 82 | return w_0*w_1*mu_diff*mu_diff; 83 | } 84 | #endif 85 | -------------------------------------------------------------------------------- /src/mixer2/alphaover/alphaover.cpp: -------------------------------------------------------------------------------- 1 | /* alphaover.cpp 2 | * Copyright (C) 2005 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "frei0r.hpp" 21 | #include "frei0r/math.h" 22 | 23 | #include 24 | 25 | class alphaover : public frei0r::mixer2 26 | { 27 | public: 28 | alphaover(unsigned int width, unsigned int height) 29 | { 30 | } 31 | 32 | void update(double time, 33 | uint32_t* out, 34 | const uint32_t* in1, 35 | const uint32_t* in2) 36 | { 37 | uint8_t *dst = reinterpret_cast(out); 38 | const uint8_t *src1 = reinterpret_cast(in1); 39 | const uint8_t *src2 = reinterpret_cast(in2); 40 | 41 | for (unsigned int i=0; i plugin("alphaover", 70 | "the alpha OVER operation", 71 | "Jean-Sebastien Senecal", 72 | 0,2, 73 | F0R_COLOR_MODEL_RGBA8888); 74 | 75 | -------------------------------------------------------------------------------- /src/mixer2/dodge/dodge.cpp: -------------------------------------------------------------------------------- 1 | /* dodge.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class dodge : public frei0r::mixer2 28 | { 29 | public: 30 | dodge(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] dodge operation between the pixel sources 37 | * in1 and in2, using the generalised algorithm: 38 | * 39 | * D = saturation of 255 or (A * 256) / (256 - B) 40 | * 41 | **/ 42 | void update(double time, 43 | uint32_t* out, 44 | const uint32_t* in1, 45 | const uint32_t* in2) 46 | { 47 | const uint8_t *src1 = reinterpret_cast(in1); 48 | const uint8_t *src2 = reinterpret_cast(in2); 49 | uint8_t *dst = reinterpret_cast(out); 50 | uint32_t sizeCounter = size; 51 | 52 | uint32_t b, tmp; 53 | 54 | while (sizeCounter--) 55 | { 56 | for (b = 0; b < ALPHA; b++) 57 | { 58 | tmp = src1[b] << 8; 59 | tmp /= 256 - src2[b]; 60 | dst[b] = MIN(tmp, 255); 61 | } 62 | 63 | dst[ALPHA] = MIN (src1[ALPHA], src2[ALPHA]); 64 | 65 | src1 += NBYTES; 66 | src2 += NBYTES; 67 | dst += NBYTES; 68 | } 69 | } 70 | 71 | }; 72 | 73 | frei0r::construct plugin("dodge", 74 | "Perform an RGB[A] dodge operation between the pixel sources, using the generalised algorithm: D = saturation of 255 or (A * 256) / (256 - B)", 75 | "Jean-Sebastien Senecal", 76 | 0,3, 77 | F0R_COLOR_MODEL_RGBA8888); 78 | 79 | -------------------------------------------------------------------------------- /src/mixer2/euclid_eraser/euclid_eraser.md: -------------------------------------------------------------------------------- 1 | # Euclid Eraser Notes # 2 | 3 | ## Overview ## 4 | This is about the Euclid Eraser mixer. 5 | 6 | 7 | ## Description ## 8 | 9 | This class is intended to operate as a mixer, taking two inputs and 10 | yielding one output. 11 | 12 | The first input is a reference input, such as a single image or a 13 | stretched video of a single image. 14 | 15 | The second input is the video stream to operate on. 16 | 17 | The output is a clone of the RGB data of the second input, but with 18 | the alpha channel modified. 19 | 20 | This mixer takes the (first) reference input, such as a static 21 | background, and removes it from every frame in the video stream of the 22 | second input. 23 | 24 | The alpha channel on the output is based on the euclidean distance of 25 | the two input coordinates in 3-d RGB space. If the calculated distance 26 | between the two inputs for a given pixel is less than a provided 27 | (variable) threshold amount, that indicates the pixel in the 28 | background (reference) image is the same or similar enough to the 29 | operational (second) input that is part of the background to be 30 | removed, and the transparency is set to fully transparent via the 31 | alpha channel (set to 0). 32 | 33 | If the calculated distance exceeds the threshold, then that pixel is 34 | part of the foreground image to be retained, and the transparency 35 | of it is set to be fully opaque (alpha channel for that pixel set 36 | to 255). 37 | 38 | ## Basic Algorithm ## 39 | The basic comparison algorithm is: 40 | 41 | 42 | x is reference image 43 | y is comparison image to remove reference image from 44 | 45 | 46 | ``` 47 | float euclidDistance (int x_r, int x_g, int x_b, int y_r, int y_g, int y_b) 48 | { 49 | //calculating color channel differences for next steps 50 | float red_d = x_r - y_r; 51 | float green_d = x_g - y_g; 52 | float blue_d = x_b - y_b; 53 | 54 | float sq_sum, dist; 55 | 56 | //calculating Euclidean distance 57 | sq_sum = pow(red_d, 2) + pow(green_d, 2) + pow (blue_d) 58 | dist = sqrt(sq_sum); 59 | 60 | return dist; 61 | } 62 | ``` 63 | 64 | ## Note ## 65 | 66 | Here's a handy reminder on how the bits map up. 67 | 68 | ``` 69 | red_src1 = src1[0]; 70 | green_src1 = src1[1]; 71 | blue_src1 = src1[2]; 72 | alpha_src1 = src1[3] 73 | 74 | red_src2 = src2[0]; 75 | green_src2 = src2[1]; 76 | blue_src2 = src2[2]; 77 | alpha_src2 = src2[3] 78 | ``` 79 | ## Further Work ## 80 | 81 | Some potential improvements are: 82 | 83 | - Faster performance (math calculations, others) 84 | - Options beyond binary for alpha 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/mixer2/darken/darken.cpp: -------------------------------------------------------------------------------- 1 | /* darken.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class darken : public frei0r::mixer2 28 | { 29 | public: 30 | darken(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform a darken operation between sources in1 and in2, using 37 | * the generalised algorithm: 38 | * D_r = min(A_r, B_r); 39 | * D_g = min(A_g, B_g); 40 | * D_b = min(A_b, B_b); 41 | * D_a = min(A_a, B_a); 42 | * 43 | **/ 44 | void update(double time, 45 | uint32_t* out, 46 | const uint32_t* in1, 47 | const uint32_t* in2) 48 | { 49 | const uint8_t *src1 = reinterpret_cast(in1); 50 | const uint8_t *src2 = reinterpret_cast(in2); 51 | uint8_t *dst = reinterpret_cast(out); 52 | uint32_t sizeCounter = size; 53 | 54 | uint32_t b; 55 | uint8_t s1, s2; 56 | 57 | while (sizeCounter--) 58 | { 59 | for (b = 0; b < ALPHA; b++) 60 | { 61 | s1 = src1[b]; 62 | s2 = src2[b]; 63 | dst[b] = MIN(s1,s2); 64 | } 65 | 66 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 67 | 68 | src1 += NBYTES; 69 | src2 += NBYTES; 70 | dst += NBYTES; 71 | } 72 | } 73 | 74 | 75 | }; 76 | 77 | 78 | frei0r::construct plugin("darken", 79 | "Perform a darken operation between two sources (minimum value of both sources).", 80 | "Jean-Sebastien Senecal", 81 | 0,2, 82 | F0R_COLOR_MODEL_RGBA8888); 83 | 84 | -------------------------------------------------------------------------------- /src/mixer2/lighten/lighten.cpp: -------------------------------------------------------------------------------- 1 | /* lighten.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class lighten : public frei0r::mixer2 28 | { 29 | public: 30 | lighten(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform a lighten operation between sources in1 and in2, using the 37 | * generalised algorithm: 38 | * D_r = max(A_r, B_r); 39 | * D_g = max(A_g, B_g); 40 | * D_b = max(A_b, B_b); 41 | * D_a = min(A_a, B_a); 42 | * 43 | **/ 44 | void update(double time, 45 | uint32_t* out, 46 | const uint32_t* in1, 47 | const uint32_t* in2) 48 | { 49 | const uint8_t *src1 = reinterpret_cast(in1); 50 | const uint8_t *src2 = reinterpret_cast(in2); 51 | uint8_t *dst = reinterpret_cast(out); 52 | uint32_t sizeCounter = size; 53 | 54 | uint32_t b; 55 | uint8_t s1, s2; 56 | 57 | while (sizeCounter--) 58 | { 59 | for (b = 0; b < ALPHA; b++) 60 | { 61 | s1 = src1[b]; 62 | s2 = src2[b]; 63 | dst[b] = MAX(s1,s2); 64 | } 65 | 66 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 67 | 68 | src1 += NBYTES; 69 | src2 += NBYTES; 70 | dst += NBYTES; 71 | } 72 | } 73 | 74 | 75 | 76 | }; 77 | 78 | 79 | frei0r::construct plugin("lighten", 80 | "Perform a lighten operation between two sources (maximum value of both sources).", 81 | "Jean-Sebastien Senecal", 82 | 0,2, 83 | F0R_COLOR_MODEL_RGBA8888); 84 | 85 | -------------------------------------------------------------------------------- /src/mixer2/alphaxor/alphaxor.cpp: -------------------------------------------------------------------------------- 1 | /* alphaxor.cpp 2 | * Copyright (C) 2005 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "frei0r.hpp" 21 | #include "frei0r/math.h" 22 | 23 | #include 24 | 25 | class alphaxor : public frei0r::mixer2 26 | { 27 | public: 28 | alphaxor(unsigned int width, unsigned int height) 29 | { 30 | } 31 | 32 | void update(double time, 33 | uint32_t* out, 34 | const uint32_t* in1, 35 | const uint32_t* in2) 36 | { 37 | uint8_t *dst = reinterpret_cast(out); 38 | const uint8_t *src1 = reinterpret_cast(in1); 39 | const uint8_t *src2 = reinterpret_cast(in2); 40 | 41 | for (unsigned int i=0; i plugin("alphaxor", 71 | "the alpha XOR operation", 72 | "Jean-Sebastien Senecal", 73 | 0,2, 74 | F0R_COLOR_MODEL_RGBA8888); 75 | 76 | -------------------------------------------------------------------------------- /src/mixer2/addition/addition.cpp: -------------------------------------------------------------------------------- 1 | /* addition.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class addition : public frei0r::mixer2 28 | { 29 | public: 30 | addition(unsigned int width, unsigned int height) 31 | { 32 | // initialize look-up table 33 | for (int i = 0; i < 256; i++) 34 | add_lut[i] = i; 35 | for (int i = 256; i <= 510; i++) 36 | add_lut[i] = 255; 37 | } 38 | 39 | /** 40 | * 41 | * Perform an RGB[A] addition operation of the pixel sources in1 42 | * and in2. 43 | * 44 | **/ 45 | void update(double time, 46 | uint32_t* out, 47 | const uint32_t* in1, 48 | const uint32_t* in2) 49 | { 50 | const uint8_t *A = reinterpret_cast(in1); 51 | const uint8_t *B = reinterpret_cast(in2); 52 | uint8_t *D = reinterpret_cast(out); 53 | uint32_t sizeCounter = size; 54 | 55 | uint32_t b; 56 | 57 | while (sizeCounter--) 58 | { 59 | for (b = 0; b < ALPHA; b++) 60 | D[b] = add_lut[A[b] + B[b]]; 61 | 62 | D[ALPHA] = MIN(A[ALPHA], B[ALPHA]); 63 | A += NBYTES; 64 | B += NBYTES; 65 | D += NBYTES; 66 | } 67 | } 68 | 69 | private: 70 | static uint8_t add_lut[511]; // look-up table storing values to do a quick MAX of two values when you know you add two unsigned chars 71 | }; 72 | 73 | uint8_t addition::add_lut[511]; 74 | 75 | frei0r::construct plugin("addition", 76 | "Perform an RGB[A] addition operation of the pixel sources.", 77 | "Jean-Sebastien Senecal", 78 | 0,2, 79 | F0R_COLOR_MODEL_RGBA8888); 80 | 81 | -------------------------------------------------------------------------------- /src/mixer2/softlight/softlight.cpp: -------------------------------------------------------------------------------- 1 | /* softlight.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class softlight : public frei0r::mixer2 28 | { 29 | public: 30 | softlight(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] softlight operation between the pixel sources 37 | * in1 and in2. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | 50 | uint32_t b, tmpS, tmpM, tmp1, tmp2, tmp3; 51 | 52 | while (sizeCounter--) 53 | { 54 | for (b = 0; b < ALPHA; b++) 55 | { 56 | /* Mix multiply and screen */ 57 | tmpM = INT_MULT(src1[b], src2[b], tmpM); 58 | tmpS = 255 - INT_MULT((255 - src1[b]), (255 - src2[b]), tmp1); 59 | dst[b] = INT_MULT((255 - src1[b]), tmpM, tmp2) + INT_MULT(src1[b], tmpS, tmp3); 60 | } 61 | 62 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 63 | 64 | src1 += NBYTES; 65 | src2 += NBYTES; 66 | dst += NBYTES; 67 | } 68 | } 69 | 70 | 71 | }; 72 | 73 | 74 | frei0r::construct plugin("softlight", 75 | "Perform an RGB[A] softlight operation between the pixel sources.", 76 | "Jean-Sebastien Senecal", 77 | 0,2, 78 | F0R_COLOR_MODEL_RGBA8888); 79 | 80 | -------------------------------------------------------------------------------- /src/filter/squareblur/squareblur.c: -------------------------------------------------------------------------------- 1 | /* squareblur.c 2 | * Copyright (C) 2004--2005 Mathieu Guindon 3 | * Julien Keable 4 | * Jean-Sebastien Senecal (js@drone.ws) 5 | * This file is a Frei0r plugin. 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "frei0r.h" 27 | #include "frei0r/blur.h" 28 | 29 | int f0r_init() 30 | { 31 | return 1; 32 | } 33 | 34 | void f0r_deinit() 35 | { /* no initialization required */ } 36 | 37 | void f0r_get_plugin_info(f0r_plugin_info_t* squareblur_info) 38 | { 39 | squareblur_info->name = "Squareblur"; 40 | squareblur_info->author = "Drone"; 41 | squareblur_info->plugin_type = F0R_PLUGIN_TYPE_FILTER; 42 | squareblur_info->color_model = F0R_COLOR_MODEL_RGBA8888; 43 | squareblur_info->frei0r_version = FREI0R_MAJOR_VERSION; 44 | squareblur_info->major_version = 0; 45 | squareblur_info->minor_version = 1; 46 | squareblur_info->num_params = 1; 47 | squareblur_info->explanation = "Variable-size square blur"; 48 | } 49 | 50 | void f0r_get_param_info(f0r_param_info_t* info, int param_index) 51 | { 52 | blur_get_param_info(info, param_index); 53 | } 54 | 55 | f0r_instance_t f0r_construct(unsigned int width, unsigned int height) 56 | { 57 | return blur_construct(width, height); 58 | } 59 | 60 | void f0r_destruct(f0r_instance_t instance) 61 | { 62 | blur_destruct(instance); 63 | } 64 | 65 | void f0r_set_param_value(f0r_instance_t instance, 66 | f0r_param_t param, int param_index) 67 | { 68 | blur_set_param_value(instance, param, param_index); 69 | } 70 | 71 | void f0r_get_param_value(f0r_instance_t instance, 72 | f0r_param_t param, int param_index) 73 | { 74 | blur_get_param_value(instance, param, param_index); 75 | } 76 | 77 | void f0r_update(f0r_instance_t instance, double time, 78 | const uint32_t* inframe, uint32_t* outframe) 79 | { 80 | blur_update(instance, time, inframe, outframe); 81 | } 82 | -------------------------------------------------------------------------------- /src/filter/kaleid0sc0pe/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(CheckIncludeFileCXX) 2 | include(CheckCSourceCompiles) 3 | include(CheckCXXSourceCompiles) 4 | 5 | cmake_policy(SET CMP0056 NEW) 6 | cmake_policy(SET CMP0066 NEW) 7 | cmake_policy(SET CMP0067 NEW) 8 | 9 | set(CMAKE_CXX_STANDARD 11) 10 | set(CMAKE_CXX_STANDARD_REQUIRED True) 11 | 12 | set (SOURCES api.cpp ikaleid0sc0pe.h kaleid0sc0pe.cpp kaleid0sc0pe.h sse_mathfun_extension.h sse_mathfun.h) 13 | set (TARGET kaleid0sc0pe) 14 | 15 | if (MSVC) 16 | set (SOURCES ${SOURCES} ${FREI0R_DEF}) 17 | endif (MSVC) 18 | 19 | add_library (${TARGET} MODULE ${SOURCES}) 20 | set_target_properties (${TARGET} PROPERTIES PREFIX "") 21 | 22 | if (NOT WIN32) 23 | set(THREADS_PREFER_PTHREAD_FLAG ON) 24 | find_package(Threads REQUIRED) 25 | target_link_libraries(${TARGET} PRIVATE Threads::Threads) 26 | endif() 27 | 28 | if(NO_SSE2) 29 | message(STATUS "SSE2 is disabled") 30 | add_definitions(-DNO_SSE2) 31 | else() 32 | check_include_file_cxx(immintrin.h HAS_INTEL_INTRINSICS) 33 | if (HAS_INTEL_INTRINSICS) 34 | add_definitions(-DHAS_INTEL_INTRINSICS) 35 | if (NOT WIN32) 36 | target_compile_options(${TARGET} PRIVATE -msse2) 37 | set(CMAKE_REQUIRED_FLAGS "-msse2") 38 | endif() 39 | check_c_source_compiles(" 40 | #include 41 | #include 42 | int main(){ __m128 a = _mm_set1_ps(0.0f); a = _mm_sin_ps(a); return 0;}" HAS_SIN_INTRINSIC) 43 | check_c_source_compiles(" 44 | #include 45 | #include 46 | int main(){ __m128 a = _mm_set1_ps(0.0f); a = _mm_cos_ps(a); return 0;}" HAS_COS_INTRINSIC) 47 | check_c_source_compiles(" 48 | #include 49 | #include 50 | int main(){ __m128 a = _mm_set1_ps(0.0f); __m128 b = _mm_set1_ps(0.0f); a = _mm_atan2_ps(a,b); return 0;}" HAS_ATAN2_INTRINSIC) 51 | if (HAS_SIN_INTRINSIC) 52 | add_definitions(-DHAS_SIN_INTRINSIC) 53 | endif() 54 | if (HAS_COS_INTRINSIC) 55 | add_definitions(-DHAS_COS_INTRINSIC) 56 | endif() 57 | if (HAS_ATAN2_INTRINSIC) 58 | add_definitions(-DHAS_ATAN2_INTRINSIC) 59 | endif() 60 | endif() 61 | endif() 62 | 63 | check_cxx_source_compiles(" 64 | #include 65 | int main(){ std::future f; return 0;}" HAS_WORKING_FUTURE) 66 | if (NOT HAS_WORKING_FUTURE) 67 | add_definitions(-DNO_FUTURE) 68 | endif() 69 | install (TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) 70 | -------------------------------------------------------------------------------- /src/filter/sobel/sobel.cpp: -------------------------------------------------------------------------------- 1 | /* sobel.cpp 2 | * Copyright (C) 2005 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "frei0r.hpp" 21 | #include "frei0r/math.h" 22 | #include 23 | 24 | class sobel : public frei0r::filter 25 | { 26 | public: 27 | sobel(unsigned int width, unsigned int height) 28 | { 29 | this->width = width; 30 | this->height = height; 31 | } 32 | 33 | virtual void update(double time, 34 | uint32_t* out, 35 | const uint32_t* in) 36 | { 37 | if (width == 0 || height == 0) return; 38 | 39 | std::copy(in, in + width*height, out); 40 | for (unsigned int y=1; y plugin("Sobel", 69 | "Sobel filter", 70 | "Jean-Sebastien Senecal (Drone)", 71 | 0,2, 72 | F0R_COLOR_MODEL_RGBA8888); 73 | 74 | -------------------------------------------------------------------------------- /src/mixer2/hardlight/hardlight.cpp: -------------------------------------------------------------------------------- 1 | /* hardlight.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class hardlight : public frei0r::mixer2 28 | { 29 | public: 30 | hardlight(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] hardlight operation between the pixel sources 37 | * in1 and in2. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | 50 | uint32_t b, tmp; 51 | 52 | while (sizeCounter--) 53 | { 54 | for (b = 0; b < ALPHA; b++) 55 | { 56 | if (src2[b] > 128) 57 | { 58 | tmp = ((int) 255 - src1[b]) * ((int) 255 - ((src2[b] - 128) << 1)); 59 | dst[b] = (uint8_t) MAX255 (255 - (tmp >> 8)); 60 | } 61 | else 62 | { 63 | tmp = (int) src1[b] * ((int) src2[b] << 1); 64 | dst[b] = (uint8_t) MAX255 (tmp >> 8); 65 | } 66 | } 67 | 68 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 69 | 70 | src1 += NBYTES; 71 | src2 += NBYTES; 72 | dst += NBYTES; 73 | } 74 | } 75 | 76 | 77 | 78 | }; 79 | 80 | 81 | frei0r::construct plugin("hardlight", 82 | "Perform an RGB[A] hardlight operation between the pixel sources", 83 | "Jean-Sebastien Senecal", 84 | 0,2, 85 | F0R_COLOR_MODEL_RGBA8888); 86 | 87 | -------------------------------------------------------------------------------- /src/mixer2/burn/burn.cpp: -------------------------------------------------------------------------------- 1 | /* burn.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class burn : public frei0r::mixer2 28 | { 29 | public: 30 | burn(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform an RGB[A] dodge operation between the pixel sources 37 | * in1 and in2, using the generalised algorithm: 38 | * 39 | * D = saturation of 255 or depletion of 0, of ((255 - A) * 256) / (B + 1) 40 | * 41 | **/ 42 | void update(double time, 43 | uint32_t* out, 44 | const uint32_t* in1, 45 | const uint32_t* in2) 46 | { 47 | const uint8_t *src1 = reinterpret_cast(in1); 48 | const uint8_t *src2 = reinterpret_cast(in2); 49 | uint8_t *dst = reinterpret_cast(out); 50 | uint32_t sizeCounter = size; 51 | 52 | uint32_t b; 53 | 54 | /* FIXME: Is the burn effect supposed to be dependent on the sign of this 55 | * temporary variable? */ 56 | int tmp; 57 | 58 | while (sizeCounter--) 59 | { 60 | for (b = 0; b < ALPHA; b++) 61 | { 62 | tmp = (255 - src1[b]) << 8; 63 | tmp /= src2[b] + 1; 64 | dst[b] = (uint8_t) CLAMP0255(255 - tmp); 65 | } 66 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 67 | 68 | src1 += NBYTES; 69 | src2 += NBYTES; 70 | dst += NBYTES; 71 | } 72 | } 73 | 74 | 75 | 76 | }; 77 | 78 | 79 | frei0r::construct plugin("burn", 80 | "Perform an RGB[A] dodge operation between the pixel sources, using the generalised algorithm: D = saturation of 255 or depletion of 0, of ((255 - A) * 256) / (B + 1)", 81 | "Jean-Sebastien Senecal", 82 | 0,2, 83 | F0R_COLOR_MODEL_RGBA8888); 84 | 85 | -------------------------------------------------------------------------------- /src/filter/premultiply/premultiply.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Dan Dennedy 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #include "frei0r.hpp" 20 | #include "frei0r/math.h" 21 | 22 | class Premultiply : public frei0r::filter 23 | { 24 | 25 | public: 26 | 27 | Premultiply(unsigned int width, unsigned int height) 28 | : m_unpremultiply(0) 29 | { 30 | register_param(m_unpremultiply, "unpremultiply", "Whether to unpremultiply instead"); 31 | } 32 | 33 | ~Premultiply() 34 | { 35 | } 36 | 37 | virtual void update(double, 38 | uint32_t* out, 39 | const uint32_t* in) 40 | { 41 | uint8_t *src = (uint8_t*) in; 42 | uint8_t *dst = (uint8_t*) out; 43 | unsigned int n = width * height + 1; 44 | if (!m_unpremultiply) { 45 | // premultiply 46 | while (--n) { 47 | uint8_t a = src[3]; 48 | dst[0] = (src[0] * a) >> 8; 49 | dst[1] = (src[1] * a) >> 8; 50 | dst[2] = (src[2] * a) >> 8; 51 | dst[3] = a; 52 | src += 4; 53 | dst += 4; 54 | } 55 | } else { 56 | // unpremultiply 57 | while (--n) { 58 | uint8_t a = src[3]; 59 | if (a > 0 && a < 255) { 60 | dst[0] = MIN((src[0] << 8) / a, 255); 61 | dst[1] = MIN((src[1] << 8) / a, 255); 62 | dst[2] = MIN((src[2] << 8) / a, 255); 63 | } else { 64 | dst[0] = src[0]; 65 | dst[1] = src[1]; 66 | dst[2] = src[2]; 67 | } 68 | dst[3] = a; 69 | src += 4; 70 | dst += 4; 71 | } 72 | } 73 | } 74 | 75 | private: 76 | bool m_unpremultiply; 77 | 78 | }; 79 | 80 | frei0r::construct plugin("Premultiply or Unpremultiply", 81 | "Multiply (or divide) each color component by the pixel's alpha value", 82 | "Dan Dennedy", 83 | 0, 2, 84 | F0R_COLOR_MODEL_RGBA8888); 85 | -------------------------------------------------------------------------------- /src/mixer2/blend/blend.cpp: -------------------------------------------------------------------------------- 1 | /* blend.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class blend : public frei0r::mixer2 28 | { 29 | public: 30 | blend(unsigned int width, unsigned int height) 31 | { 32 | this->width = width; 33 | this->height = height; 34 | this->size = width * height; 35 | blend_factor = 0.5; 36 | register_param(blend_factor,"blend","blend factor"); 37 | } 38 | 39 | /** 40 | * 41 | * Perform a blend operation between sources in1 and in2, using 42 | * the generalised algorithm: D = A * (255 - β) + B * β 43 | * 44 | * The result is left in out 45 | **/ 46 | void update(double time, 47 | uint32_t* out, 48 | const uint32_t* in1, 49 | const uint32_t* in2) 50 | { 51 | // Validate inputs 52 | if (!out || !in1 || !in2) { 53 | return; 54 | } 55 | 56 | const uint8_t *src1 = reinterpret_cast(in1); 57 | const uint8_t *src2 = reinterpret_cast(in2); 58 | uint8_t *dst = reinterpret_cast(out); 59 | const uint8_t bf = (const uint8_t) (255 * blend_factor); 60 | const uint8_t one_minus_bf = (255 - bf); 61 | uint32_t w = size; 62 | uint32_t b; 63 | 64 | // Validate size 65 | if (w == 0) { 66 | return; 67 | } 68 | 69 | while (w--) 70 | { 71 | for (b = 0; b < NBYTES; b++) 72 | dst[b] = (src1[b] * one_minus_bf + src2[b] * bf) / 255; 73 | 74 | src1 += NBYTES; 75 | src2 += NBYTES; 76 | dst += NBYTES; 77 | } 78 | } 79 | 80 | private: 81 | double blend_factor; 82 | 83 | }; 84 | 85 | 86 | frei0r::construct plugin("blend", 87 | "Perform a blend operation between two sources", 88 | "Jean-Sebastien Senecal", 89 | 0,2, 90 | F0R_COLOR_MODEL_RGBA8888); 91 | 92 | -------------------------------------------------------------------------------- /src/filter/RGB/B.c: -------------------------------------------------------------------------------- 1 | /* B.c 2 | * Copyright (C) 2007 Richard Spindler (richard.spindler@gmail.com) 3 | * This file is a Frei0r plugin. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "frei0r.h" 24 | 25 | typedef struct rgb_instance 26 | { 27 | unsigned int width; 28 | unsigned int height; 29 | } rgb_instance_t; 30 | 31 | int f0r_init() 32 | { 33 | return 1; 34 | } 35 | 36 | void f0r_deinit() 37 | { /* no initialization required */ } 38 | 39 | void f0r_get_plugin_info(f0r_plugin_info_t* rgbInfo) 40 | { 41 | rgbInfo->name = "B"; 42 | rgbInfo->author = "Richard Spindler"; 43 | rgbInfo->plugin_type = F0R_PLUGIN_TYPE_FILTER; 44 | rgbInfo->color_model = F0R_COLOR_MODEL_RGBA8888; 45 | rgbInfo->frei0r_version = FREI0R_MAJOR_VERSION; 46 | rgbInfo->major_version = 0; 47 | rgbInfo->minor_version = 9; 48 | rgbInfo->num_params = 0; 49 | rgbInfo->explanation = "Extracts Blue from Image"; 50 | } 51 | 52 | void f0r_get_param_info(f0r_param_info_t* info, int param_index) 53 | { 54 | /* no params */ 55 | } 56 | 57 | f0r_instance_t f0r_construct(unsigned int width, unsigned int height) 58 | { 59 | rgb_instance_t* inst = (rgb_instance_t*)calloc(1, sizeof(*inst)); 60 | inst->width = width; inst->height = height; 61 | return (f0r_instance_t)inst; 62 | } 63 | 64 | void f0r_destruct(f0r_instance_t instance) 65 | { 66 | free(instance); 67 | } 68 | 69 | void f0r_set_param_value(f0r_instance_t instance, 70 | f0r_param_t param, int param_index) 71 | { /* no params */ } 72 | 73 | void f0r_get_param_value(f0r_instance_t instance, 74 | f0r_param_t param, int param_index) 75 | { /* no params */ } 76 | 77 | void f0r_update(f0r_instance_t instance, double time, 78 | const uint32_t* inframe, uint32_t* outframe) 79 | { 80 | assert(instance); 81 | rgb_instance_t* inst = (rgb_instance_t*)instance; 82 | unsigned int w = inst->width; 83 | unsigned int h = inst->height; 84 | unsigned int x,y; 85 | 86 | uint32_t* dst = outframe; 87 | const uint32_t* src = inframe; 88 | for(y=0;y> 8 ) | ((0x00ff0000 & (*src)) >> 16 ) ; 91 | } 92 | } 93 | 94 | -------------------------------------------------------------------------------- /src/filter/RGB/R.c: -------------------------------------------------------------------------------- 1 | /* R.c 2 | * Copyright (C) 2007 Richard Spindler (richard.spindler@gmail.com) 3 | * This file is a Frei0r plugin. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "frei0r.h" 24 | 25 | typedef struct rgb_instance 26 | { 27 | unsigned int width; 28 | unsigned int height; 29 | } rgb_instance_t; 30 | 31 | int f0r_init() 32 | { 33 | return 1; 34 | } 35 | 36 | void f0r_deinit() 37 | { /* no initialization required */ } 38 | 39 | void f0r_get_plugin_info(f0r_plugin_info_t* rgbInfo) 40 | { 41 | rgbInfo->name = "R"; 42 | rgbInfo->author = "Richard Spindler"; 43 | rgbInfo->plugin_type = F0R_PLUGIN_TYPE_FILTER; 44 | rgbInfo->color_model = F0R_COLOR_MODEL_RGBA8888; 45 | rgbInfo->frei0r_version = FREI0R_MAJOR_VERSION; 46 | rgbInfo->major_version = 0; 47 | rgbInfo->minor_version = 9; 48 | rgbInfo->num_params = 0; 49 | rgbInfo->explanation = "Extracts Red from Image"; 50 | } 51 | 52 | void f0r_get_param_info(f0r_param_info_t* info, int param_index) 53 | { 54 | /* no params */ 55 | } 56 | 57 | f0r_instance_t f0r_construct(unsigned int width, unsigned int height) 58 | { 59 | rgb_instance_t* inst = (rgb_instance_t*)calloc(1, sizeof(*inst)); 60 | inst->width = width; inst->height = height; 61 | return (f0r_instance_t)inst; 62 | } 63 | 64 | void f0r_destruct(f0r_instance_t instance) 65 | { 66 | free(instance); 67 | } 68 | 69 | void f0r_set_param_value(f0r_instance_t instance, 70 | f0r_param_t param, int param_index) 71 | { /* no params */ } 72 | 73 | void f0r_get_param_value(f0r_instance_t instance, 74 | f0r_param_t param, int param_index) 75 | { /* no params */ } 76 | 77 | void f0r_update(f0r_instance_t instance, double time, 78 | const uint32_t* inframe, uint32_t* outframe) 79 | { 80 | assert(instance); 81 | rgb_instance_t* inst = (rgb_instance_t*)instance; 82 | unsigned int w = inst->width; 83 | unsigned int h = inst->height; 84 | unsigned int x,y; 85 | 86 | uint32_t* dst = outframe; 87 | const uint32_t* src = inframe; 88 | for(y=0;y 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | // based upon twolay0r with some tweaks. 30 | class threelay0r : public frei0r::filter 31 | { 32 | private: 33 | static unsigned char grey(unsigned int value) { 34 | unsigned char* rgba = reinterpret_cast(&value); 35 | unsigned char gw= (rgba[0] + rgba[1] + 2*rgba[2])/4; 36 | return gw; 37 | } 38 | 39 | struct histogram { 40 | histogram() : hist(256) { 41 | std::fill(hist.begin(),hist.end(),0); 42 | } 43 | 44 | void operator()(uint32_t value) { 45 | ++hist[grey(value)]; 46 | } 47 | 48 | std::vector hist; 49 | }; 50 | 51 | public: 52 | threelay0r(unsigned int width, unsigned int height) {} 53 | 54 | virtual void update(double time, 55 | uint32_t* out, 56 | const uint32_t* in) { 57 | histogram h; 58 | 59 | // create histogramm 60 | for (const unsigned int* i=in; i != in + (width*height);++i) 61 | h(*i); 62 | 63 | // calc th 64 | int th1 = 1; 65 | int th2 = 255; 66 | 67 | unsigned num = 0; 68 | unsigned int num1div3 = 4*size/10; // number of pixels in the lower level 69 | unsigned int num2div3 = 8*size/10; // number of pixels in the lower two levels 70 | for (int i = 0; i < 256; i++) { // wee bit faster than a double loop 71 | num += h.hist[i]; 72 | if (num < num1div3) th1 = i; 73 | if (num < num2div3) th2 = i; 74 | } 75 | 76 | // create the 3 level image 77 | uint32_t* outpixel= out; 78 | const uint32_t* pixel=in; 79 | while(pixel != in+size) // size = defined in frei0r.hpp 80 | { 81 | if ( grey(*pixel) < th1 ) 82 | *outpixel=0xFF000000; 83 | else if ( grey(*pixel) < th2) 84 | *outpixel=0xFF808080; 85 | else 86 | *outpixel=0xFFFFFFFF; 87 | ++outpixel; 88 | ++pixel; 89 | } 90 | } 91 | }; 92 | 93 | 94 | frei0r::construct plugin("threelay0r", 95 | "dynamic 3 level thresholding", 96 | "Hedde Bosman", 97 | 0,2); 98 | 99 | -------------------------------------------------------------------------------- /src/filter/RGB/G.c: -------------------------------------------------------------------------------- 1 | /* G.c 2 | * Copyright (C) 2007 Richard Spindler (richard.spindler@gmail.com) 3 | * This file is a Frei0r plugin. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "frei0r.h" 24 | 25 | typedef struct rgb_instance 26 | { 27 | unsigned int width; 28 | unsigned int height; 29 | } rgb_instance_t; 30 | 31 | int f0r_init() 32 | { 33 | return 1; 34 | } 35 | 36 | void f0r_deinit() 37 | { /* no initialization required */ } 38 | 39 | void f0r_get_plugin_info(f0r_plugin_info_t* rgbInfo) 40 | { 41 | rgbInfo->name = "G"; 42 | rgbInfo->author = "Richard Spindler"; 43 | rgbInfo->plugin_type = F0R_PLUGIN_TYPE_FILTER; 44 | rgbInfo->color_model = F0R_COLOR_MODEL_RGBA8888; 45 | rgbInfo->frei0r_version = FREI0R_MAJOR_VERSION; 46 | rgbInfo->major_version = 0; 47 | rgbInfo->minor_version = 9; 48 | rgbInfo->num_params = 0; 49 | rgbInfo->explanation = "Extracts Green from Image"; 50 | } 51 | 52 | void f0r_get_param_info(f0r_param_info_t* info, int param_index) 53 | { 54 | /* no params */ 55 | } 56 | 57 | f0r_instance_t f0r_construct(unsigned int width, unsigned int height) 58 | { 59 | rgb_instance_t* inst = (rgb_instance_t*)calloc(1, sizeof(*inst)); 60 | inst->width = width; inst->height = height; 61 | return (f0r_instance_t)inst; 62 | } 63 | 64 | void f0r_destruct(f0r_instance_t instance) 65 | { 66 | free(instance); 67 | } 68 | 69 | void f0r_set_param_value(f0r_instance_t instance, 70 | f0r_param_t param, int param_index) 71 | { /* no params */ } 72 | 73 | void f0r_get_param_value(f0r_instance_t instance, 74 | f0r_param_t param, int param_index) 75 | { /* no params */ } 76 | 77 | void f0r_update(f0r_instance_t instance, double time, 78 | const uint32_t* inframe, uint32_t* outframe) 79 | { 80 | assert(instance); 81 | rgb_instance_t* inst = (rgb_instance_t*)instance; 82 | unsigned int w = inst->width; 83 | unsigned int h = inst->height; 84 | unsigned int x,y; 85 | 86 | uint32_t* dst = outframe; 87 | const uint32_t* src = inframe; 88 | for(y=0;y> 8 ) ; 91 | } 92 | } 93 | 94 | -------------------------------------------------------------------------------- /src/mixer2/overlay/overlay.cpp: -------------------------------------------------------------------------------- 1 | /* overlay.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | 24 | #define NBYTES 4 25 | #define ALPHA 3 26 | 27 | class overlay : public frei0r::mixer2 28 | { 29 | public: 30 | overlay(unsigned int width, unsigned int height) 31 | { 32 | this->width = width; 33 | this->height = height; 34 | this->size = width * height; 35 | } 36 | 37 | /** 38 | * 39 | * Perform an RGB[A] overlay operation between the pixel sources 40 | * in1 and in2, using the generalised algorithm: 41 | * 42 | * D = A * (B + (2 * B) * (255 - A)) 43 | * 44 | **/ 45 | void update(double time, 46 | uint32_t* out, 47 | const uint32_t* in1, 48 | const uint32_t* in2) 49 | { 50 | // Validate inputs 51 | if (!out || !in1 || !in2) { 52 | return; 53 | } 54 | 55 | const uint8_t *src1 = reinterpret_cast(in1); 56 | const uint8_t *src2 = reinterpret_cast(in2); 57 | uint8_t *dst = reinterpret_cast(out); 58 | uint32_t sizeCounter = size; 59 | 60 | // Validate size 61 | if (sizeCounter == 0) { 62 | return; 63 | } 64 | 65 | uint32_t b, tmp, tmpM; 66 | 67 | while (sizeCounter--) 68 | { 69 | for (b = 0; b < ALPHA; b++) 70 | { 71 | dst[b] = INT_MULT(src1[b], src1[b] + INT_MULT(2 * src2[b], 255 - src1[b], tmpM), tmp); 72 | } 73 | 74 | dst[ALPHA] = MIN(src1[ALPHA], src2[ALPHA]); 75 | 76 | src1 += NBYTES; 77 | src2 += NBYTES; 78 | dst += NBYTES; 79 | } 80 | } 81 | 82 | 83 | 84 | }; 85 | 86 | 87 | frei0r::construct plugin("overlay", 88 | "Perform an RGB[A] overlay operation between the pixel sources, using the generalised algorithm: D = A * (B + (2 * B) * (255 - A))", 89 | "Jean-Sebastien Senecal", 90 | 0,2, 91 | F0R_COLOR_MODEL_RGBA8888); 92 | 93 | -------------------------------------------------------------------------------- /src/mixer2/saturation/saturation.cpp: -------------------------------------------------------------------------------- 1 | /* saturation.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | #include "frei0r/colorspace.h" 24 | 25 | #define NBYTES 4 26 | 27 | class saturation : public frei0r::mixer2 28 | { 29 | public: 30 | saturation(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform a conversion to saturation only of the source in1 using 37 | * the saturation level of in2. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | int r1, g1, b1; 50 | int r2, g2, b2; 51 | 52 | /* assumes inputs are only 4 byte RGBA pixels */ 53 | while (sizeCounter--) 54 | { 55 | r1 = src1[0]; 56 | g1 = src1[1]; 57 | b1 = src1[2]; 58 | r2 = src2[0]; 59 | g2 = src2[1]; 60 | b2 = src2[2]; 61 | rgb_to_hsv_int(&r1, &g1, &b1); 62 | rgb_to_hsv_int(&r2, &g2, &b2); 63 | 64 | g1 = g2; 65 | 66 | /* set the destination */ 67 | hsv_to_rgb_int(&r1, &g1, &b1); 68 | 69 | dst[0] = r1; 70 | dst[1] = g1; 71 | dst[2] = b1; 72 | 73 | dst[3] = MIN(src1[3], src2[3]); 74 | 75 | src1 += NBYTES; 76 | src2 += NBYTES; 77 | dst += NBYTES; 78 | } 79 | } 80 | 81 | }; 82 | 83 | 84 | frei0r::construct plugin("saturation", 85 | "Perform a conversion to saturation only of the source input1 using the saturation level of input2.", 86 | "Jean-Sebastien Senecal", 87 | 0,2, 88 | F0R_COLOR_MODEL_RGBA8888); 89 | 90 | -------------------------------------------------------------------------------- /src/mixer2/value/value.cpp: -------------------------------------------------------------------------------- 1 | /* value.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | #include "frei0r/colorspace.h" 24 | 25 | #define NBYTES 4 26 | 27 | class value : public frei0r::mixer2 28 | { 29 | public: 30 | value(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform a conversion to value only of the source in1 using 37 | * the value of in2. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | int r1, g1, b1; 50 | int r2, g2, b2; 51 | 52 | /* assumes inputs are only 4 byte RGBA pixels */ 53 | /* assumes inputs are only 4 byte RGBA pixels */ 54 | while (sizeCounter--) 55 | { 56 | r1 = src1[0]; 57 | g1 = src1[1]; 58 | b1 = src1[2]; 59 | r2 = src2[0]; 60 | g2 = src2[1]; 61 | b2 = src2[2]; 62 | rgb_to_hsv_int(&r1, &g1, &b1); 63 | rgb_to_hsv_int(&r2, &g2, &b2); 64 | 65 | b1 = b2; 66 | 67 | /* set the destination */ 68 | hsv_to_rgb_int(&r1, &g1, &b1); 69 | 70 | dst[0] = r1; 71 | dst[1] = g1; 72 | dst[2] = b1; 73 | 74 | dst[3] = MIN(src1[3], src2[3]); 75 | 76 | src1 += NBYTES; 77 | src2 += NBYTES; 78 | dst += NBYTES; 79 | } 80 | } 81 | 82 | 83 | }; 84 | 85 | 86 | frei0r::construct plugin("value", 87 | "Perform a conversion to value only of the source input1 using the value of input2.", 88 | "Jean-Sebastien Senecal", 89 | 0,2, 90 | F0R_COLOR_MODEL_RGBA8888); 91 | 92 | -------------------------------------------------------------------------------- /src/mixer2/color_only/color_only.cpp: -------------------------------------------------------------------------------- 1 | /* color_only.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | #include "frei0r/colorspace.h" 24 | 25 | #define NBYTES 4 26 | 27 | class color_only : public frei0r::mixer2 28 | { 29 | public: 30 | color_only(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform a conversion to of the source in1 using 37 | * the hue and saturation values of in2. 38 | * 39 | **/ 40 | void update(double time, 41 | uint32_t* out, 42 | const uint32_t* in1, 43 | const uint32_t* in2) 44 | { 45 | const uint8_t *src1 = reinterpret_cast(in1); 46 | const uint8_t *src2 = reinterpret_cast(in2); 47 | uint8_t *dst = reinterpret_cast(out); 48 | uint32_t sizeCounter = size; 49 | uint32_t r1, g1, b1; 50 | uint32_t r2, g2, b2; 51 | 52 | while (sizeCounter--) 53 | { 54 | r1 = src1[0]; 55 | g1 = src1[1]; 56 | b1 = src1[2]; 57 | r2 = src2[0]; 58 | g2 = src2[1]; 59 | b2 = src2[2]; 60 | rgb_to_hsl_int(&r1, &g1, &b1); 61 | rgb_to_hsl_int(&r2, &g2, &b2); 62 | 63 | /* transfer hue and saturation to the source pixel */ 64 | r1 = r2; 65 | g1 = g2; 66 | 67 | /* set the destination */ 68 | hsl_to_rgb_int(&r1, &g1, &b1); 69 | 70 | dst[0] = r1; 71 | dst[1] = g1; 72 | dst[2] = b1; 73 | 74 | dst[3] = MIN(src1[3], src2[3]); 75 | 76 | src1 += NBYTES; 77 | src2 += NBYTES; 78 | dst += NBYTES; 79 | } 80 | } 81 | 82 | 83 | }; 84 | 85 | 86 | frei0r::construct plugin("color_only", 87 | "Perform a conversion to color only of the source input1 using the hue and saturation values of input2.", 88 | "Jean-Sebastien Senecal", 89 | 0,2, 90 | F0R_COLOR_MODEL_RGBA8888); 91 | 92 | -------------------------------------------------------------------------------- /src/mixer2/hue/hue.cpp: -------------------------------------------------------------------------------- 1 | /* hue.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * This file is a Frei0r plugin. 4 | * The code is a modified version of code from the Gimp. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "frei0r.hpp" 22 | #include "frei0r/math.h" 23 | #include "frei0r/colorspace.h" 24 | 25 | #define NBYTES 4 26 | 27 | class hue : public frei0r::mixer2 28 | { 29 | public: 30 | hue(unsigned int width, unsigned int height) 31 | { 32 | } 33 | 34 | /** 35 | * 36 | * Perform a conversion to hue only of the source in1 using 37 | * the hue of in2. 38 | **/ 39 | void update(double time, 40 | uint32_t* out, 41 | const uint32_t* in1, 42 | const uint32_t* in2) 43 | { 44 | const uint8_t *src1 = reinterpret_cast(in1); 45 | const uint8_t *src2 = reinterpret_cast(in2); 46 | uint8_t *dst = reinterpret_cast(out); 47 | uint32_t sizeCounter = size; 48 | int r1, g1, b1; 49 | int r2, g2, b2; 50 | 51 | /* assumes inputs are only 4 byte RGBA pixels */ 52 | while (sizeCounter--) 53 | { 54 | r1 = src1[0]; 55 | g1 = src1[1]; 56 | b1 = src1[2]; 57 | 58 | r2 = src2[0]; 59 | g2 = src2[1]; 60 | b2 = src2[2]; 61 | 62 | rgb_to_hsv_int (&r1, &g1, &b1); 63 | rgb_to_hsv_int (&r2, &g2, &b2); 64 | 65 | /* Composition should have no effect if saturation is zero. 66 | * otherwise, black would be painted red (see bug #123296). 67 | */ 68 | if (g2) 69 | r1 = r2; 70 | 71 | /* set the destination */ 72 | hsv_to_rgb_int (&r1, &g1, &b1); 73 | 74 | dst[0] = r1; 75 | dst[1] = g1; 76 | dst[2] = b1; 77 | 78 | dst[3] = MIN (src1[3], src2[3]); 79 | 80 | src1 += NBYTES; 81 | src2 += NBYTES; 82 | dst += NBYTES; 83 | } 84 | } 85 | 86 | }; 87 | 88 | 89 | frei0r::construct plugin("hue", 90 | "Perform a conversion to hue only of the source input1 using the hue of input2.", 91 | "Jean-Sebastien Senecal", 92 | 0,2, 93 | F0R_COLOR_MODEL_RGBA8888); 94 | 95 | -------------------------------------------------------------------------------- /src/mixer2/addition_alpha/addition_alpha.cpp: -------------------------------------------------------------------------------- 1 | /* addition_alpha.cpp 2 | * Copyright (C) 2006 Jean-Sebastien Senecal (js@drone.ws) 3 | * 2011 Simon A. Eugster (simon.eu@gmail.com) 4 | * This file is a Frei0r plugin. 5 | * The code is a modified version of code from the Gimp. 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "frei0r.hpp" 23 | #include "frei0r/math.h" 24 | 25 | #define NBYTES 4 26 | #define ALPHA 3 27 | 28 | class addition_alpha : public frei0r::mixer2 29 | { 30 | public: 31 | addition_alpha(unsigned int width, unsigned int height) 32 | { 33 | // initialize look-up table 34 | for (int i = 0; i < 256; i++) 35 | add_lut[i] = i; 36 | for (int i = 256; i <= 510; i++) 37 | add_lut[i] = 255; 38 | } 39 | 40 | /** 41 | * 42 | * Perform an RGB[A] addition_alpha operation of the pixel sources in1 43 | * and in2. 44 | * 45 | * This is a modification of the original addition filter, adding the color of the 46 | * second channel only if its alpha channel is not 0. 47 | * 48 | **/ 49 | void update(double time, 50 | uint32_t* out, 51 | const uint32_t* in1, 52 | const uint32_t* in2) 53 | { 54 | const uint8_t *A = reinterpret_cast(in1); 55 | const uint8_t *B = reinterpret_cast(in2); 56 | uint8_t *D = reinterpret_cast(out); 57 | uint32_t sizeCounter = size; 58 | 59 | uint32_t b; 60 | 61 | while (sizeCounter--) 62 | { 63 | for (b = 0; b < ALPHA; b++) 64 | D[b] = add_lut[A[b] + ((B[b]*B[ALPHA])>>8)]; 65 | 66 | D[ALPHA] = 255; 67 | A += NBYTES; 68 | B += NBYTES; 69 | D += NBYTES; 70 | } 71 | } 72 | 73 | private: 74 | static uint8_t add_lut[511]; // look-up table storing values to do a quick MAX of two values when you know you add two unsigned chars 75 | }; 76 | 77 | uint8_t addition_alpha::add_lut[511]; 78 | 79 | frei0r::construct plugin("addition_alpha", 80 | "Perform an RGB[A] addition_alpha operation of the pixel sources.", 81 | "Jean-Sebastien Senecal", 82 | 0,2, 83 | F0R_COLOR_MODEL_RGBA8888); 84 | 85 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: 010-Test 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - 'doc/**' 7 | - '*.md' 8 | branches: 9 | - master 10 | - release/** 11 | 12 | pull_request: 13 | paths-ignore: 14 | - 'doc/**' 15 | - '*.md' 16 | branches: 17 | - master 18 | - release/** 19 | 20 | concurrency: 21 | group: ${{ github.workflow }}-${{ github.ref_name }} 22 | cancel-in-progress: true 23 | 24 | jobs: 25 | 26 | # reuse: 27 | # name: 🚨 REUSE Compliance 28 | # runs-on: ubuntu-latest 29 | # steps: 30 | # - uses: actions/checkout@v4 31 | # - uses: fsfe/reuse-action@v1 32 | 33 | c-lint: 34 | name: 🚨 C lint 35 | runs-on: ubuntu-latest 36 | if: "!contains(github.event.pull_request.labels.*.name, 'skip-lint')" 37 | steps: 38 | - uses: actions/checkout@v4 39 | - uses: reviewdog/action-cpplint@master 40 | env: 41 | REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} 42 | with: 43 | github_token: ${{ secrets.GITHUB_TOKEN }} 44 | reporter: github-pr-check 45 | targets: --recursive src 46 | level: warning 47 | flags: --linelength=120 # Optional 48 | filter: "-readability/braces\ 49 | ,-readability/casting\ 50 | ,-readability/todo\ 51 | ,-whitespace/comma\ 52 | ,-whitespace/braces\ 53 | ,-whitespace/comments\ 54 | ,-whitespace/indent\ 55 | ,-whitespace/newline\ 56 | ,-whitespace/operators\ 57 | ,-whitespace/parens\ 58 | ,-whitespace/tab\ 59 | ,-whitespace/end_of_line\ 60 | ,-whitespace/line_length\ 61 | ,-whitespace/blank_line\ 62 | ,-whitespace/semicolon\ 63 | ,-build/include_subdir\ 64 | ,-build/include_order\ 65 | ,-build/header_guard\ 66 | " 67 | 68 | test-suite: 69 | name: 🔬 test 70 | needs: [c-lint] 71 | if: "!contains(github.event.pull_request.labels.*.name, 'skip-test')" 72 | strategy: 73 | matrix: 74 | compiler: [clang-14] 75 | fail-fast: false 76 | runs-on: ubuntu-latest 77 | steps: 78 | - uses: actions/checkout@v4 79 | - name: install dependencies 80 | run: | 81 | sudo apt-get update -qy 82 | sudo apt-get install --no-install-recommends -y ${{ matrix.compiler }} cmake ninja-build libfreetype-dev libopencv-dev libcairo2-dev libgavl-dev 83 | - name: ${{ matrix.compiler }} initialize cmake build 84 | run: | 85 | mkdir -p build && cd build 86 | cmake -G "Ninja" ../ 87 | - name: ${{ matrix.compiler }} run ninja build 88 | run: | 89 | cd build && ninja 90 | - name: ${{ matrix.compiler }} analyze plugins 91 | run: | 92 | cd test && make 93 | - name: ${{ matrix.compiler }} upload plugin analysis 94 | uses: actions/upload-artifact@v4 95 | with: 96 | name: release-plugin-analysis 97 | path: test/*.json 98 | --------------------------------------------------------------------------------