From 7a62c541f63769b0c4d4da4816a15482097f5c54 Mon Sep 17 00:00:00 2001 From: Seyed Ali Ghasemi Date: Wed, 10 Jan 2024 12:02:32 +0100 Subject: [PATCH 1/3] Updated README with CMake instructions --- README.md | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c8256f5..c86e6359 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,11 @@ - [fpm dependency](#fpm-dependency) - [How to run demos](#how-to-run-demos) - [Running `demo_ppm`](#running-demo_ppm) + - [Using fpm](#using-fpm) + - [Using CMake](#using-cmake) - [Running `demo_color`](#running-demo_color) + - [Using fpm](#using-fpm-1) + - [Using CMake](#using-cmake-1) - [Projects Utilizing ForImage](#projects-utilizing-forimage) - [API documentation](#api-documentation) - [Contributing](#contributing) @@ -108,22 +112,54 @@ cd forimage 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: +To run `demo_ppm`, execute the following commands: + +#### Using fpm ```shell fpm run --example demo_ppm ``` +#### Using CMake + +```shell +cmake -B ./build -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_Fortran_COMPILER=gfortran -DBUILD_TESTING=FALSE -DBUILD_FORIMAGE_EXAMPLES=TRUE +``` + +```shell +cmake --build build/ --config release +``` + +```shell +./build/example/demo_ppm +``` + ### Running `demo_color` 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 run `demo_color`, execute the following command: +To run `demo_color`, execute the following commands: + +#### Using fpm ```shell fpm run --example demo_color ``` +#### Using CMake + +```shell +cmake -B ./build -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_Fortran_COMPILER=gfortran -DBUILD_TESTING=FALSE -DBUILD_FORIMAGE_EXAMPLES=TRUE +``` + +```shell +cmake --build build/ --config release +``` + +```shell +./build/example/demo_color +``` + ## Projects Utilizing ForImage - [ForColormap](https://github.com/vmagnin/forcolormap): A Fortran library for colormaps From 40b85dcfb74221e0aba449ab5ed18ac4543e8b15 Mon Sep 17 00:00:00 2001 From: Seyed Ali Ghasemi Date: Wed, 10 Jan 2024 22:43:37 +0100 Subject: [PATCH 2/3] Add cmake configurarion --- workspace.code-workspace | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 From 2b08ad997d96707dc1d3d35d85a53aa90fcf0926 Mon Sep 17 00:00:00 2001 From: Seyed Ali Ghasemi Date: Wed, 10 Jan 2024 22:44:06 +0100 Subject: [PATCH 3/3] Update README --- README.md | 52 +++++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index c86e6359..f8d4488e 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,8 @@ - [Color Support](#color-support) - [fpm dependency](#fpm-dependency) - [How to run demos](#how-to-run-demos) - - [Running `demo_ppm`](#running-demo_ppm) - - [Using fpm](#using-fpm) - - [Using CMake](#using-cmake) - - [Running `demo_color`](#running-demo_color) - - [Using fpm](#using-fpm-1) - - [Using CMake](#using-cmake-1) + - [Using fpm](#using-fpm) + - [Using CMake](#using-cmake) - [Projects Utilizing ForImage](#projects-utilizing-forimage) - [API documentation](#api-documentation) - [Contributing](#contributing) @@ -93,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 ``` @@ -108,57 +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 commands: - -#### Using fpm +Run the `demo_ppm` example: ```shell fpm run --example demo_ppm ``` -#### Using CMake +Run the `demo_color` example: ```shell -cmake -B ./build -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_Fortran_COMPILER=gfortran -DBUILD_TESTING=FALSE -DBUILD_FORIMAGE_EXAMPLES=TRUE +fpm run --example demo_color ``` -```shell -cmake --build build/ --config release -``` +### Using CMake ```shell -./build/example/demo_ppm +cmake -B build -DBUILD_FORIMAGE_EXAMPLES=ON ``` -### Running `demo_color` - -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 run `demo_color`, execute the following commands: - -#### Using fpm - ```shell -fpm run --example demo_color +cmake --build build ``` -#### Using CMake +Run the `demo_ppm` example: ```shell -cmake -B ./build -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_Fortran_COMPILER=gfortran -DBUILD_TESTING=FALSE -DBUILD_FORIMAGE_EXAMPLES=TRUE +./build/example/demo_ppm ``` -```shell -cmake --build build/ --config release -``` +Run the `demo_color` example: ```shell ./build/example/demo_color ``` +Note: The executable must be run from the forimage directory. ## Projects Utilizing ForImage