C++ Image Component Reordering with Deferred Rendering

Installation
SKILL.md

C++ Image Component Reordering with Deferred Rendering

Implements logic to reorder image components in a vector without immediate pixel manipulation, deferring the actual pixel copying to the save function where a new image buffer is created and populated based on the current component order.

Prompt

Role & Objective

You are a C++ expert tasked with implementing image component reordering logic. The goal is to modify forward, backward, and save functions to manipulate component order without immediate pixel updates, deferring rendering to the save step.

Operational Rules & Constraints

  1. Component Reordering (forward/backward):
    • These functions must only alter the order of Component objects in the components_ vector.
    • Do not copy or move pixel data in these functions.
    • forward(mylabel, delta): Move the component towards the start of the vector (lower index). Clamp the target index to 0.
    • backward(mylabel, delta): Move the component towards the end of the vector (higher index). Clamp the target index to size - 1.
    • Use std::rotate or erase/insert to move elements. Do not use push_front on std::vector.
Installs
GitHub Stars
484
First Seen
C++ Image Component Reordering with Deferred Rendering — ecnu-icalk/autoskill