diff --git a/README.md b/README.md index 2c8256f5..f8d4488e 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ - [Color Support](#color-support) - [fpm dependency](#fpm-dependency) - [How to run demos](#how-to-run-demos) - - [Running `demo_ppm`](#running-demo_ppm) - - [Running `demo_color`](#running-demo_color) + - [Using fpm](#using-fpm) + - [Using CMake](#using-cmake) - [Projects Utilizing ForImage](#projects-utilizing-forimage) - [API documentation](#api-documentation) - [Contributing](#contributing) @@ -89,11 +89,16 @@ forimage = {git="https://github.com/gha3mi/forimage.git"} ## How to run demos +The `demo_ppm` program demonstrates various operations on PPM (Portable Pixmap) images. It generates Mandelbrot fractals, performs diverse manipulations, and exports images in the PPM format. + +The `demo_color` program showcases manipulation of color spaces and their conversions. This program sets a custom color using various methods, converts it to different color spaces, retrieves color values, finds the nearest color, and prints color details. + +To get started, follow these steps: + **Clone the repository:** Clone the `ForImage` repository from GitHub using the following command: - ```shell git clone https://github.com/gha3mi/forimage.git ``` @@ -104,25 +109,42 @@ Navigate to the cloned directory: cd forimage ``` -### Running `demo_ppm` +### Using fpm -The `demo_ppm` program demonstrates various operations on PPM (Portable Pixmap) images. It generates Mandelbrot fractals, performs diverse manipulations, and exports images in the PPM format. - -To run `demo_ppm`, execute the following command: +Run the `demo_ppm` example: ```shell fpm run --example demo_ppm ``` -### Running `demo_color` +Run the `demo_color` example: -The `demo_color` program showcases manipulation of color spaces and their conversions. This program sets a custom color using various methods, converts it to different color spaces, retrieves color values, finds the nearest color, and prints color details. +```shell +fpm run --example demo_color +``` -To run `demo_color`, execute the following command: +### Using CMake ```shell -fpm run --example demo_color +cmake -B build -DBUILD_FORIMAGE_EXAMPLES=ON +``` + +```shell +cmake --build build +``` + +Run the `demo_ppm` example: + +```shell +./build/example/demo_ppm +``` + +Run the `demo_color` example: + +```shell +./build/example/demo_color ``` +Note: The executable must be run from the forimage directory. ## Projects Utilizing ForImage diff --git a/workspace.code-workspace b/workspace.code-workspace index dc667765..11becd7f 100644 --- a/workspace.code-workspace +++ b/workspace.code-workspace @@ -11,6 +11,10 @@ "${workspaceFolder}/src", "${workspaceFolder}/test", "${workspaceFolder}/app" - ] + ], + "cmake.configureSettings": { + "BUILD_TESTING": "ON", + "BUILD_FORIMAGE_EXAMPLES": "ON" + } } } \ No newline at end of file