Skip to content

Fix/improve small problems #36

Description

@emdevv
  1. Bug: RotateOp::apply_native early-returns without filling img_out when angle == 0
    When angle normalizes to 0, the function just returns and img_out stays as a default-constructed empty Image. The caller in engine_logic.cpp then displays and saves that empty image. Same issue exists in apply_kernel.
    Fix should look like this for both:
    if (angle == 0) { img_out = img; // pass through unchanged return; }

  2. Bug: BlurOp::apply_native early-returns without filling img_out when percentage == 0 or radius == 0.
    Same pattern as above — img_out is never populated. Same fix: img_out = img; return;

  3. Missing: <chrono> include in blur.cpp and crop.cpp
    Both use std::chrono::high_resolution_clock but only rotate.cpp has #include <chrono>. It probably compiles due to SYCL's transitive includes, but this is fragile. Add it explicitly to both files.

  4. Inconsistent profiling style
    Native ops use std::cout << while SYCL ops use std::print. Since we're on C++23 and already have <print> included, just use std::print everywhere for consistency.

  5. convolution CLI subcommand has no kernel selection
    The kernel is hardcoded as a Laplacian edge-detect in engine_logic.cpp. The user can't choose anything. A minimal improvement: add a --preset option to conv_cmd with choices like sharpen, edge, emboss. This is a few lines of CLI11 and a switch in run_operations.

  6. CMakeLists.txt: image_engine_core has SFML as PRIVATE but image_io.cpp uses SFML in its headers

image_io.h includes <SFML/Graphics.hpp> which means anything that includes image_io.h transitively needs SFML. Currently SFML is linked PRIVATE to image_engine_core, which means the executable might not get the SFML link on all compilers/linkers. Change it to PUBLIC:
e.g. :target_link_libraries(image_engine_core PUBLIC sfml-graphics sfml-window sfml-system )

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions