Skip to content

Commit

Permalink
Merge pull request #14 from gha3mi/cmake
Browse files Browse the repository at this point in the history
Updated README with CMake instructions
  • Loading branch information
gha3mi committed Jan 10, 2024
2 parents 3055a9f + 2b08ad9 commit 5158df7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 12 deletions.
44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
```
Expand All @@ -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

Expand Down
6 changes: 5 additions & 1 deletion workspace.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"${workspaceFolder}/src",
"${workspaceFolder}/test",
"${workspaceFolder}/app"
]
],
"cmake.configureSettings": {
"BUILD_TESTING": "ON",
"BUILD_FORIMAGE_EXAMPLES": "ON"
}
}
}

0 comments on commit 5158df7

Please sign in to comment.