feat: introduce complete source code for cge-tools library#4
Conversation
There was a problem hiding this comment.
Pull request overview
This PR performs a major codebase cleanup and modernization, including refactoring and reintroducing/reshaping large portions of the CGE filter stack and public API headers.
Changes:
- Adds/modernizes a large set of filter headers/implementations and introduces a public factory API (
include/cge/filters.h). - Refactors build and packaging with new CMake-based library targets and installation/export support.
- Adds/updates documentation and GitHub workflow guidance for PR submission/review and coding conventions.
Reviewed changes
Copilot reviewed 89 out of 267 changed files in this pull request and generated 25 comments.
Show a summary per file
| File | Description |
|---|---|
| cge/src/filters/adjustments/cgeMultipleEffectsSpecial.h | Adds declarations for “special” multiple-effect filters and helper base classes. |
| cge/src/filters/adjustments/cgeMultipleEffects.h | Introduces multiple-effect filter wrapper and mix helper. |
| cge/src/filters/adjustments/cgeMotionBlurAdjust.h | Adds motion blur filter declaration. |
| cge/src/filters/adjustments/cgeMotionBlurAdjust.cpp | Implements motion blur shader and rendering. |
| cge/src/filters/adjustments/cgeMonochromeAdjust.h | Adds monochrome filter declaration. |
| cge/src/filters/adjustments/cgeMonochromeAdjust.cpp | Implements monochrome shader and parameters. |
| cge/src/filters/adjustments/cgeMinValueFilter.h | Adds min-value filter interfaces. |
| cge/src/filters/adjustments/cgeMidValueFilter.h | Adds median filter interface. |
| cge/src/filters/adjustments/cgeMidValueFilter.cpp | Implements median filter shader + initialization. |
| cge/src/filters/adjustments/cgeMaxValueFilter.h | Adds max-value filter interfaces. |
| cge/src/filters/adjustments/cgeMaxValueFilter.cpp | Implements max-value shader comp function helper. |
| cge/src/filters/adjustments/cgeLookupFilter.h | Adds LUT (lookup) filter interface. |
| cge/src/filters/adjustments/cgeLookupFilter.cpp | Implements LUT shader and texture binding. |
| cge/src/filters/adjustments/cgeLiquidationFilter.h | Adds mesh deformation (“liquidation”) filter interface. |
| cge/src/filters/adjustments/cgeHueAdjust.h | Adds hue adjustment filter interface. |
| cge/src/filters/adjustments/cgeHueAdjust.cpp | Implements hue shader and uniform. |
| cge/src/filters/adjustments/cgeHistogramFilter.h | Adds histogram filter header stub comment. |
| cge/src/filters/adjustments/cgeHistogramFilter.cpp | Adds empty translation unit (stub). |
| cge/src/filters/adjustments/cgeFilterBasic.h | Aggregates basic filters and factory decls (guarded vs public API). |
| cge/src/filters/adjustments/cgeFilterBasic.cpp | Implements basic filter factory functions. |
| cge/src/filters/adjustments/cgeExposureAdjust.h | Adds exposure filter interface. |
| cge/src/filters/adjustments/cgeExposureAdjust.cpp | Implements exposure shader and uniform. |
| cge/src/filters/adjustments/cgeDynamicWaveFilter.h | Adds dynamic wave filter interface. |
| cge/src/filters/adjustments/cgeDynamicWaveFilter.cpp | Implements dynamic wave rendering and motion. |
| cge/src/filters/adjustments/cgeDynamicFilters.h | Adds dynamic filter factory header. |
| cge/src/filters/adjustments/cgeDynamicFilters.cpp | Implements dynamic filter factory. |
| cge/src/filters/adjustments/cgeDistortionFilter.h | Adds distortion filter interface for bloat/wrinkle/forward warp. |
| cge/src/filters/adjustments/cgeDistortionFilter.cpp | Implements distortion shaders and parameter setup. |
| cge/src/filters/adjustments/cgeDataParsingEngine.h | Adds parsing engine interface for rule strings and borders. |
| cge/src/filters/adjustments/cgeCurveAdjust.h | Adds curve interfaces and curve-based filters. |
| cge/src/filters/adjustments/cgeContrastAdjust.h | Adds contrast filter interface. |
| cge/src/filters/adjustments/cgeContrastAdjust.cpp | Implements contrast shader and uniform. |
| cge/src/filters/adjustments/cgeColorMappingFilter.h | Adds color mapping filter interface and configuration. |
| cge/src/filters/adjustments/cgeColorMappingFilter.cpp | Implements buffered-area color mapping mode and mapping setup. |
| cge/src/filters/adjustments/cgeColorLevelAdjust.h | Adds color level filter interface. |
| cge/src/filters/adjustments/cgeColorLevelAdjust.cpp | Implements color level shader and params. |
| cge/src/filters/adjustments/cgeColorBalanceAdjust.h | Adds color balance filter interface. |
| cge/src/filters/adjustments/cgeColorBalanceAdjust.cpp | Implements color balance shader and params. |
| cge/src/filters/adjustments/cgeCardEffects.h | Adds “card border” effect filter interface. |
| cge/src/filters/adjustments/cgeCardEffects.cpp | Implements card border shader + uniforms. |
| cge/src/filters/adjustments/cgeBrightnessAdjust.h | Adds brightness filters interfaces. |
| cge/src/filters/adjustments/cgeBrightnessAdjust.cpp | Implements brightness shaders and fast brightness curve mapping. |
| cge/src/filters/adjustments/cgeBorderEffects.h | Adds border effect filter container interface. |
| cge/src/filters/adjustments/cgeBorderEffects.cpp | Implements border parsing, chaining, and resource loading. |
| cge/src/filters/adjustments/cgeBlendFilter.h | Adds blend filter interfaces and specializations. |
| cge/src/filters/adjustments/cgeAdvancedEffects.h | Adds advanced effects factory declarations (guarded vs public API). |
| cge/src/filters/adjustments/cgeAdvancedEffects.cpp | Implements advanced effects factory functions. |
| cge/src/extend/cgeThread.h | Adds thread utilities: preemptive thread + thread pool. |
| cge/src/extend/cgeThread.cpp | Implements thread utilities behavior. |
| cge/src/core/cgeTextureUtils.h | Adds texture drawer and helper drawing utilities. |
| cge/src/core/cgeStaticAssert.h | Adds static assert compatibility macro. |
| cge/src/core/cgeShaderFunctions.h | Adds shader/program wrappers and uniform parameter batching. |
| cge/src/core/cgeImageHandler.h | Adds/modernizes image handler interfaces and concrete handler API. |
| cge/src/core/cgeImageFilter.h | Adds/modernizes filter interfaces and fast-adjust filters. |
| cge/src/core/cgeImageFilter.cpp | Implements filter base rendering and fast-adjust shader generation. |
| cge/src/core/cgeGlobal.h | Adds global init/config interface and platform header selection. |
| cge/src/core/cgeGlobal.cpp | Implements global init/cleanup and capability probing. |
| cge/src/core/cgeGeometryUtils.h | Adds geometry utility point drawer interface. |
| cge/src/core/cgeGeometryUtils.cpp | Implements point drawer drawing and uniform setup. |
| cge/src/core/cgeGLFunctions.h | Adds GL helpers, resource loaders, and small utility types. |
| cge/src/core/cgeGLFunctions.cpp | Implements GL helper functions and SharedTexture lifetime. |
| cge/include/cge/platform.h | Introduces public platform abstraction wrapper header. |
| cge/include/cge/filters.h | Introduces public filter factory API. |
| cge/include/cge/cge.h | Introduces main umbrella public header pulling in core + factories + platform. |
| cge/CMakeLists.txt | Adds/modernizes library build target, install/export, and platform linking. |
| README.md | Rewrites README with modern build/use documentation and project overview. |
| CMakeLists.txt | Adds top-level CMake project with options and Qt detection. |
| .github/skills/pr-submit/SKILL.md | Adds PR submission guidance. |
| .github/skills/pr-review/SKILL.md | Adds PR review guidance. |
| .github/instructions/code-conventions.instructions.md | Adds formal coding conventions + OpenGL/Qt rules. |
| .github/copilot-instructions.md | Adds repository-specific Copilot guidance. |
| .github/RELEASE.md | Adds release process documentation. |
| .github/CONTRIBUTING.md | Adds contributing workflow documentation. |
| .clang-format | Adds clang-format configuration. |
Comments suppressed due to low confidence (1)
cge/src/filters/adjustments/cgeLookupFilter.h:1
CGELookupFilteralways deletesm_lookupTexturein the destructor (see .cpp), but the setter does a raw assignment with no ownership semantics. If callers pass a texture they manage elsewhere, this can cause double-deletion or unexpected lifetime coupling. Consider adding an ownership flag/parameter (e.g.,setLookupTexture(tex, shouldDelete)) or a dedicatedsetSamplerIDpattern similar toCGEBlendFilter::setSamplerID.
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| m_list4Write.lock(); | ||
| bool canWrite = !m_list4Write.empty(); | ||
| m_list4Write.unlock(); | ||
| return canWrite; | ||
| } | ||
|
|
||
| bool hasData4Read() | ||
| { | ||
| m_list4Read.lock(); | ||
| bool canRead = !m_list4Read.empty(); | ||
| m_list4Read.unlock(); | ||
| return canRead; | ||
| } | ||
|
|
There was a problem hiding this comment.
m_list4Write is a std::list, so calling .lock() / .unlock() is a compile-time error. These functions should lock m_writeMutex (e.g., via std::lock_guard<std::mutex>) before checking m_list4Write.empty(). Apply the same fix to hasData4Read() which repeats the same issue.
| m_list4Write.lock(); | |
| bool canWrite = !m_list4Write.empty(); | |
| m_list4Write.unlock(); | |
| return canWrite; | |
| } | |
| bool hasData4Read() | |
| { | |
| m_list4Read.lock(); | |
| bool canRead = !m_list4Read.empty(); | |
| m_list4Read.unlock(); | |
| return canRead; | |
| } | |
| std::lock_guard<std::mutex> lock(m_writeMutex); | |
| bool canWrite = !m_list4Write.empty(); | |
| return canWrite; | |
| } | |
| bool hasData4Read() | |
| { | |
| std::lock_guard<std::mutex> lock(m_readMutex); | |
| bool canRead = !m_list4Read.empty(); | |
| return canRead; | |
| } |
| void putData4Write(const Type& data) | ||
| { | ||
| m_writeMutex.lock(); | ||
| m_list4Write.push(data); |
There was a problem hiding this comment.
std::list does not have push() / pop() methods (those are std::queue APIs). This will not compile. Use push_back() + pop_front() (and keep front()) or switch the container types to std::queue<Type> / std::deque<Type> if queue semantics are intended.
| if (m_list4Write.empty()) return Type(); | ||
|
|
||
| Type data = m_list4Write.front(); | ||
| m_list4Write.pop(); |
There was a problem hiding this comment.
std::list does not have push() / pop() methods (those are std::queue APIs). This will not compile. Use push_back() + pop_front() (and keep front()) or switch the container types to std::queue<Type> / std::deque<Type> if queue semantics are intended.
| Type data = m_list4Read.front(); | ||
| m_list4Read.pop(); |
There was a problem hiding this comment.
std::list does not have push() / pop() methods (those are std::queue APIs). This will not compile. Use push_back() + pop_front() (and keep front()) or switch the container types to std::queue<Type> / std::deque<Type> if queue semantics are intended.
| { | ||
| public: | ||
| Work() : func(nullptr), arg(NULL) {} | ||
| Work(const std::function<void(void*)>& _func, void* _arg = NULL) : func(_func), arg(_arg) {} |
There was a problem hiding this comment.
This header uses std::function (and the .cpp uses std::bind), but <functional> is not included. This can fail to compile depending on transitive includes. Add #include <functional> to cgeThread.h.
| virtual void pushMapingArea(const MappingArea& area); | ||
| virtual void endPushing(); // Called after pushMapingArea is done |
There was a problem hiding this comment.
Public API names contain consistent typos (MapingMode, pushMapingArea). Since this is part of the filter interface, it’s better to fix the spelling now (before it becomes a long-term API contract). Prefer MappingMode and pushMappingArea (and keep old names only via deprecated aliases if backward-compatibility is required).
| glViewport(0, 0, m_texUnitResolution.width, m_texUnitResolution.height); | ||
| m_drawer->drawTexture(srcTexture); | ||
|
|
||
| glFinish(); |
There was a problem hiding this comment.
glFinish() + glReadPixels() in the render path will hard-stall the GPU and can severely impact frame time. If this is intended for non-real-time/offline paths only, consider documenting that expectation; otherwise consider switching to async readback (e.g., PBO when available) or removing glFinish() and using synchronization that doesn’t force a full pipeline drain.
| glFinish(); |
| message(STATUS "CGE Library configuration:") | ||
| message(STATUS " Core sources: ${CMAKE_CURRENT_LIST_DIR}/src/core") | ||
| message(STATUS " Filter sources: ${CMAKE_CURRENT_LIST_DIR}/src/filters") | ||
| message(STATUS " Public headers: ${CMAKE_CURRENT_LIST_DIR}/include/cge") | ||
| message(STATUS " Total sources: ${CGE_SOURCES}" | wc -w | xargs echo "files") |
There was a problem hiding this comment.
The last message() line includes a shell pipeline (| wc -w | ...) which CMake will not execute; it will just print the literal text (and may even be confusing or malformed depending on CMake parsing). Use CMake-native counting instead (e.g., list(LENGTH CGE_SOURCES CGE_SOURCES_COUNT) and then print ${CGE_SOURCES_COUNT}).
| message(STATUS "CGE Library configuration:") | |
| message(STATUS " Core sources: ${CMAKE_CURRENT_LIST_DIR}/src/core") | |
| message(STATUS " Filter sources: ${CMAKE_CURRENT_LIST_DIR}/src/filters") | |
| message(STATUS " Public headers: ${CMAKE_CURRENT_LIST_DIR}/include/cge") | |
| message(STATUS " Total sources: ${CGE_SOURCES}" | wc -w | xargs echo "files") | |
| list(LENGTH CGE_SOURCES CGE_SOURCES_COUNT) | |
| message(STATUS "CGE Library configuration:") | |
| message(STATUS " Core sources: ${CMAKE_CURRENT_LIST_DIR}/src/core") | |
| message(STATUS " Filter sources: ${CMAKE_CURRENT_LIST_DIR}/src/filters") | |
| message(STATUS " Public headers: ${CMAKE_CURRENT_LIST_DIR}/include/cge") | |
| message(STATUS " Total sources: ${CGE_SOURCES_COUNT} files") |
| * | ||
| * Created on: 2015-3-20 | ||
| * Author: Wang Yang | ||
| * Description: ×î´óÖµÂ˲¨ |
There was a problem hiding this comment.
This comment appears to be mojibake / non-English text; it’s not readable and conflicts with the repo’s “English for code/comments/docs” convention. Replace it with a clear English description (e.g., “Maximum value filter”).
| * Description: ×î´óÖµÂ˲¨ | |
| * Description: Maximum value filter |
| /* | ||
| * cgeHistogramFilter.h | ||
| * | ||
| * Created on: 2015-9-24 | ||
| * Author: Wang Yang | ||
| * Description: Histogram filter that collects column-wise statistics across the entire image to retrieve overall image | ||
| * information | ||
| */ |
There was a problem hiding this comment.
This header is only a comment block (no include guard / declarations). Since it’s now part of the tree and the public API advertises createHistogramFilter(), consider either implementing the histogram filter (header + implementation + factory) or removing these stub files to avoid dead/placeholder API surface.
|
@Auggie review |
- Fix black screen on startup: use defaultFramebufferObject() instead of glBindFramebuffer(GL_FRAMEBUFFER, 0) in QOpenGLWidget context - Replace bg.png texture with GLSL shader-generated checkerboard pattern - Fix useLUT(): directly load identity lookup.png, remove incorrect file dialog - Add filterAdjustWidgetBase.h: template base class reducing boilerplate - Refactor all 16 basicAdjustWidget classes to use template base - Fix dark mode: add explicit color:#000 to all hardcoded light-bg widgets - Fix fitImage on startup: uncomment fitImage() call in initializeGL() - Fix all deprecated Qt6 APIs and compiler warnings (zero warnings build) - Fix previewResults(), resizeEvent(), removeStep() logic - tasks.sh: BUILD_FILTER_GENERATOR defaults ON, remove Python dependency - Add resources: Frieren.jpg, lookup.png, logo.png - Update all docs to reflect filterGenerator is now fully functional
- Removed unused animation system (cgeAction, cgeAnimation) - Removed legacy extended functions and utilities - Removed FFmpeg-based video processing modules - Removed iOS/Android platform-specific code - Removed particle system and duplicate thread implementations - Modernized core library API Breaking changes: - Removed animation APIs - Removed video processing APIs - Removed platform-specific support Build verified: Release build successful
- Remove redundant common-knowledge sections - Consolidate into three core sections: Constraints, Workflow, References - Reduce file length while preserving all essential rules and constraints - Improve readability for Copilot context
- macos-build.yml: builds filterGenerator on macOS arm64 (macos-latest) and x86_64 (macos-13), packages with macdeployqt into .tar.gz archives - linux-build.yml: builds AppImage on Ubuntu 22.04 and inside a Fedora 40 Docker container using linuxdeploy + linuxdeploy-plugin-qt - windows-build.yml: builds with MSVC 2022 using jurplel/install-qt-action, packages with windeployqt into a .zip archive - release.yml: triggered by v*.*.* tags (and pre-release suffixes), calls all three platform workflows and publishes artifacts to GitHub Releases via softprops/action-gh-release; workflow_dispatch supports manual release creation All CI jobs upload artifacts with 30-day retention for per-commit download.
- Add filterGenerator.icns / filterRuleTest.icns (converted from .ico via sips) - Add gen_icns.sh helper script for macOS icns generation - macOS: wire icns into MACOSX_BUNDLE via set_source_files_properties - Windows: add filterGenerator.rc so the exe embeds the icon - Linux: add filterGenerator.desktop.in + CMake install rules for share/applications and share/pixmaps - filterGenerator/CMakeLists.txt: enable RC language on WIN32, remove stale cge/src/* include paths (inherited from cge PUBLIC includes) - Info.plist.in: add CFBundleIconFile key (used by Xcode workflow) - .gitignore: ignore *.iconset/ intermediate directories - tasks.json: fix Run FilterGenerator dependsOn to Load And Build so CMakeLists.txt changes trigger re-configure before running
- Refactor CMakeLists.txt: extract SHARED_SOURCES (excludes both main.cpp and filterRuleTestMain.cpp), introduce cge_add_app() macro to reduce duplication across platforms - Add filterRuleTest target alongside filterGenerator; both share all widget sources, each brings its own main entry point - macOS: filterRuleTest.icns packed into filterRuleTest.app/Contents/Resources - Windows: add filterRuleTest.rc for embedded icon - Linux: add filterRuleTest.desktop.in + install rules - tasks.json: add Run FilterRuleTest (Debug/Release) tasks
macOS (arm64 + x86_64): - macdeployqt filterRuleTest.app alongside filterGenerator.app - pack both .app bundles into the same tar.gz artifact Linux (Ubuntu 22.04 + Fedora): - create a separate AppDir-frt / AppDir-fedora-frt for filterRuleTest - build a second AppImage (filterRuleTest-linux-*) via linuxdeploy - upload both AppImages in the same platform artifact Windows: - windeployqt filterRuleTest.exe (Qt DLLs shared in Release dir) - existing zip packaging picks up both executables automatically release.yml: - rename release from 'FilterGenerator' to 'CGE Tools'
- Replace iOS/Android includes with #error in cgePlatform.h (unsupported platforms) - Replace #ifndef include guards with #pragma once in cge.h, cgeFilters.h, cgePlatform.h - Remove redundant #include cgeImageFilter.h from cgeFilters.h (forward declaration is sufficient) - Change BUILD_FILTER_GENERATOR default from ON to OFF (experimental Qt6 app)
Changes: - Remove examples/ directory and all documentation references * Deleted examples/CMakeLists.txt, simple_filter.cpp, README.md * Removed examples from CMakeLists.txt build system * Cleaned up docs (README.md, QUICKSTART.md, BUILD.md, OPTIMIZATION.md, MODERNIZATION.md) * Updated tasks.sh format targets - Fix static library naming: DEBUG_POSTFIX now only applied on MSVC * Moved DEBUG_POSTFIX "d" from non-MSVC to MSVC branch in cge/CMakeLists.txt * Updated BUILD.md documentation to reflect correct naming * Unix-like systems now use consistent libcge.a for both Debug and Release - Fix compilation error in cgeFilters.h * Added #define _CGE_FILTERS_H_ to properly support cgeFilterBasic.h guard * Prevents function overload conflict when both headers are included Overall: -290 lines of code, simplified maintenance
- Remove source_code from push triggers (only master); PR checks already cover branch builds via pull_request event - Add concurrency groups to cancel stale runs when new commits arrive
pr-review: - Add workflow CI failure diagnosis and fixing procedures - Support both workflow design issues and code implementation issues - Escalate breaking changes for developer decision - Replace PAGER=cat with cross-platform GH_PAGER env var pr-submit: - Add explicit guard 'use ONLY when explicitly asked' to prevent accidental PR creation - Clarify that this skill should NOT be invoked for plain commit/push requests - Simplify and consolidate procedures - Align pager handling with pr-review
CI fixes: - linux-build.yml: fix Fedora package names (qt6-qtopengl-devel, qt6-linguist-tools do not exist in Fedora 40); add -DCMAKE_PREFIX_PATH=/usr for Ubuntu and -DBUILD_FILTER_GENERATOR=ON for both Ubuntu and Fedora - macos-build.yml: add -DBUILD_FILTER_GENERATOR=ON explicitly - windows-build.yml: add -DBUILD_FILTER_GENERATOR=ON explicitly Code fixes: - cgePlatform_QT.h: uncomment glActiveTexture wrapper in CGE4QT_OpenGLFunctions namespace (fixes 'identifier not found' on Windows MSVC) - CMakeLists.txt: add qmake6 to find_program search names (Ubuntu installs Qt6 qmake as qmake6); change BUILD_FILTER_GENERATOR default to OFF per conventions doc - cgeGLFunctions.h: align cgeLoadResourceCommon declaration to match implementation signature (use CGEBufferFormat* fmt, GLint* w, h) - cgeGlobal.cpp: compare glGetError() to GL_NO_ERROR, not GL_FALSE - cgeThread.h: fix std::list usage (push_back/pop_front instead of push/pop); fix hasData4Write/Read to lock correct mutex via lock_guard; add missing #include <functional> - cgeMidValueFilter.cpp: fix GLSL max2/min2 to use actual parameter names c0/c1; add .rgb to texture2D() calls (vec4 -> vec3) - cgeDistortionFilter.cpp: add m_equationLoc(-1) to constructor initializer list; fix bounds check v2Min.x -> v2Max.x - cgeMultipleEffectsSpecial.h/.cpp: initialize m_texture=0 in CGESpecialFilterE73To80Help ctor; fix typo paramTextureNmae -> paramTextureName
Replace the handwritten CGE4QT_OpenGLFunctions namespace with GLEW library. ## Changes ### Platform-specific GL loading - macOS: System OpenGL.framework (unchanged) - Windows/Linux: GLEW via GL/glew.h (new standard) ### Core implementation changes - cge/platform/cgePlatform_QT.h: Removed ~500 lines of Qt GL wrappers, added GLEW include - cge/core/cgeGlobal.cpp: Added glewInit() call in cgeInitialize() - filterGenerator/widgets/canvasWidget.cpp: Replaced Qt g_glFunctions with glewInit() - cge/platform/cgePlatform_QT.cpp: Removed g_glFunctions global variable ### CMake updates - CMakeLists.txt: CMAKE_PREFIX_PATH now appends instead of overrides - cge/CMakeLists.txt: Added GLEW dependency (non-Apple platforms) - CI workflows: Added GLEW installation/deployment steps ### Documentation - docs/BUILD.md: Added GLEW as dependency for Linux/Windows - docs/QUICKSTART.md: Added GLEW to dependency installation steps ## Benefits - Consistency: Single GLEW library instead of 80+ hand-wrapped GL functions - Maintainability: Removes 500+ lines of wrapper code - Standards compliance: GLEW is industry standard for GL extensions - Platform neutrality: Reduces platform-specific GL branching ## Testing - Local macOS build (Release + filterGenerator): PASS - No API changes: Backward compatible
…r conflict and missing std includes - Install qt6-base-dev, libqt6opengl6-dev, libglew-dev, libgl-dev, libglu1-mesa-dev - Fix cgePlatform_QT.h: guard QOpenGLFunctions/QOpenGLContext includes with #ifndef CGE_USE_GLEW to prevent Qt6 headers from undef-ing GLEW symbols; add <cstdio>/<cstring> that were previously provided transitively via Qt - Add missing #include <cstring> to cgeShaderFunctions.h (strncpy/strcmp) - Add missing #include <cstdio> to cgeImageFilter.cpp (sprintf) - Fix CMakeLists.txt Qt auto-detection: fall back to cmake system search paths when QTDIR env var and qmake are absent (handles Debian/Ubuntu system installs)
CI fixes: - CMakeLists.txt: prefer qmake6 over qmake during version detection; guard against empty QT_VERSION_FULL to fix Linux Ubuntu CMake config crash - filterGenerator/CMakeLists.txt: force-include glew.h before Qt OpenGL headers on Windows/MSVC to fix 'gl.h included before glew.h' error (C1189) Code fixes (P1/P2 review comments): - cge/core/cgeMat.h: replace GBK-encoded Chinese comments with English to fix Windows C4828 warnings (non-UTF-8 characters in source file) - cge/filters/cgeMaxValueFilter.h: replace mojibake description with English - cge/filters/cgeColorMappingFilter.h: fix API typos MapingMode->MappingMode, MAPINGMODE_*->MAPPINGMODE_*, pushMapingArea->pushMappingArea - cge/filters/cgeColorMappingFilter.cpp: match corrected header declarations - cge/filters/cgeDataParsingEngine.cpp: update usages to corrected API names
Root cause: mainwindow.h included <QtWidgets> before cge.h, causing Qt's qopengl.h to pull in <GL/gl.h> before <GL/glew.h>. GLEW requires being included first and errors out with '#error gl.h included before glew.h'. Source-level fix: - mainwindow.h: move cge.h include above all Qt headers - canvasWidget.cpp: move canvasWidget.h (which includes cge.h) above standalone Qt headers CMake-level fix (covers MOC-generated compilation units): - Extend force-include from Windows-only to all non-Apple GLEW platforms (Linux with GCC uses -include flag, MSVC uses /FI) - Resolve GLEW include path from both GLEW_INCLUDE_DIR (Windows CI) and GLEW_INCLUDE_DIRS (CMake FindGLEW module on Linux)
Qt's qopenglfunctions.h #undef's all GLEW GL function macros (glBindBuffer, glUniform2f, etc.) when included after glew.h. On some Qt versions, QOpenGLWidget indirectly pulls in this header via QOpenGLContext, breaking all GL 2.0+ function calls. Fix: Pre-define QOPENGLFUNCTIONS_H and QOPENGLEXTRAFUNCTIONS_H include guards in cgePlatform_QT.h when CGE_USE_GLEW is active. This prevents the destructive header from ever being processed. The QOpenGLFunctions class is not needed on GLEW platforms since all GL functions are accessed through GLEW's function pointers. Also: - Add find_package(GLEW) to top-level CMakeLists.txt so filterGenerator can use GLEW_INCLUDE_DIRS for force-include - Fix remaining MapingMode typos in styleAdjustWidget.cpp
linuxdeploy requires square icons in standard sizes (256x256). The previous logo.png (170x80) caused AppImage creation to fail. Added dedicated 256x256 PNG icons derived from the existing .ico files for both filterGenerator and filterRuleTest.
Use CMake FetchContent to download and build GLEW 2.2.0 from source as a static library on Linux and Windows, eliminating the need for any system- level GLEW package (libglew-dev, glew-devel) or manual pre-installation. Changes: - CMakeLists.txt: add FetchContent_Declare/MakeAvailable for GLEW tarball; set CMAKE_POLICY_VERSION_MINIMUM=3.5 to satisfy CMake 4.x policy check on GLEW 2.2.0's legacy cmake_minimum_required; patch glew_s target with BUILD_INTERFACE include dir; restore BUILD_FILTER_GENERATOR default to ON; remove redundant re-find_package(GLEW) inside BUILD_FILTER_GENERATOR block - cge/CMakeLists.txt: link against glew_s (FetchContent target) instead of find_package GLEW::GLEW - filterGenerator/CMakeLists.txt: use glew_SOURCE_DIR variable directly for force-include path, replacing the complex GLEW_INCLUDE_DIR/GLEW_INCLUDE_DIRS path-resolution logic - .github/workflows/windows-build.yml: remove manual GLEW zip download step and -DGLEW_INCLUDE_DIR/-DGLEW_LIBRARY cmake args; remove glew32.dll copy (no longer needed with static linking) - .github/workflows/linux-build.yml: remove libglew-dev (Ubuntu) and glew-devel (Fedora) packages; add git to Fedora container for FetchContent - cge/core/cgeGlobal.cpp: remove dead reference to non-existent class TimeActionInterfaceAbstract (caused MSVC Debug build failure) - .vscode/tasks.json: restore accidentally deleted comment separator line
- Introduce cmake/findQt.cmake for automatic Qt version detection (Qt5 5.15+ or Qt6 6.0+)
- Qt6 takes precedence if both are available; fallback to CMake package search and qmake
- Update CMakeLists.txt to use findQt.cmake instead of manual version detection
- Make Qt::OpenGLWidgets conditional (Qt6 only; Qt5 includes it in Qt::Widgets)
- Fix filterGenerator CMakeLists to use ${QT} variable for version-independent targeting
- Replace QMouseEvent::globalPosition() with globalPos() for Qt5/Qt6 compatibility
- Update cgePlatform_QT.h to use QOpenGLFunctions/QOpenGLContext for Qt5 desktop instead of deprecated QGLFunctions/qgl.h
- Update documentation (README, BUILD.md, QUICKSTART.md, CONTRIBUTING.md) to reflect Qt5/Qt6 support
- Project now supports both Qt5 (5.15+) and Qt6 (6.0+) with automatic detection at build time
Summary
Introduces the complete source code for the cge-tools library with a fully working cross-platform build system.
Key Changes
Build System
FetchContent GLEW (
CMakeLists.txt,cge/CMakeLists.txt,filterGenerator/CMakeLists.txt):find_package(GLEW)calls withFetchContentto download and statically build GLEW 2.2.0 from source at configure timelibglew-dev,glew-devel, manual zip download on Windows)glew32.dlldeployment requirement on WindowsCMAKE_POLICY_VERSION_MINIMUM=3.5workaround for GLEW 2.2.0's legacycmake_minimum_required(VERSION 2.8)under CMake 4.xBUILD_FILTER_GENERATORdefault toON(filterGenerator is the core deliverable)Line endings &
.gitattributes:.gitattributesenforcing LF line endings for all source, script, and CMake filestasks.sh,format-all.sh,filterGenerator/gen_icns.sh, and allCMakeLists.txtfiles from CRLF to LFCI / Workflows
windows-build.yml: Removed manual GLEW zip download step and-DGLEW_INCLUDE_DIR/-DGLEW_LIBRARYCMake arguments; removedglew32.dllcopy steplinux-build.yml: Removedlibglew-dev(Ubuntu) andglew-devel(Fedora) packages; addedgitto the Fedora container image (required by FetchContent)Bug Fixes
cge/core/cgeGlobal.cpp: Removed dead code referencing non-existent classTimeActionInterfaceAbstract, which caused MSVC Debug build failuresCGEImageFilterInterface*) across headers and definitionsHow to Verify
CMake will automatically download and build GLEW 2.2.0 during the configure step. Both
filterGenerator.exeandfilterRuleTest.exeshould build successfully.