Skip to content

Contributor guide: implement a new image operation

Martijn Gribnau edited this page Dec 21, 2020 · 3 revisions

page version: v2020.12.21-r1

Contributor guide: implement a new image operation

Thank you for taking the time to look into adding a new image operation! I've added some ideas on how to implement it below. If there are questions, always feel free to ask!

The mentioned PR's are suggestions; feel free to use a different amount of PR's, if you believe it could be cleaner.

The suggested implementation guide consists of 3 steps:

  • Add the image operation to the operation abstract library (called sic_image_engine)
  • Add the operation to the cli_ops parser, which is used by people using cli ops as cli arguments directly (e.g. the cli option sic --blur 1)
  • Add the operation to the Pest parser, which is used by people which use the sic script with sic --apply-operations <ops>

PR 1:

PR 2 part 1:

  • Create an issue for this step, e.g. titled Image Operation parsing: add <operation name>

  • Consider syntax which works for both cli ops and the --apply-operations script. This means that an operation should be able to be parse-able without introducing ambiguity with both the the Pest parser used for apply-operations script, as well as the cli ops parser used for the cli interface. Additionally, this last syntax should also be compatible with Clap, which is used for the general cli interface (but is inconvenient for the cli ops). The next points will describe the exact steps to implement these parsers. I would recommend doing both in one go to ensure compatibility with each other. You may consider dividing the actual work to multiple PR's, but doing so is optional.

PR 2 part 2:

PR 2 part 3:

Clone this wiki locally