README: Updated to show pulling the project as dependency to other projects
This commit is contained in:
@@ -8,7 +8,25 @@ _A "powerful" library that I have worked on allowing you to take a PPM image and
|
||||
> [Warning]
|
||||
> There are a lot of changes you can make to an image but this is not an extensive library to use mainstream. I would hope you understood that already. This Is for a self made project learning bitwise for c originally and now has become bigger and cooler than expected.
|
||||
|
||||
### Example
|
||||
## Installation
|
||||
|
||||
_You can pull libimg through FetchContent in your ```CMakeLists.txt```:_
|
||||
|
||||
|
||||
```Make
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(imgproc
|
||||
GIT_REPOSITORY https://git.moomancer.xyz/DarthMooMancer/libimg.git
|
||||
GIT_TAG main
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
FetchContent_MakeAvailable(imgproc)
|
||||
target_link_libraries(libgl PRIVATE imgproc)
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
_White it is not an extensive example, it shows many of the many logic of how to use all functions throughout the codebase._
|
||||
|
||||
```c
|
||||
/*
|
||||
@@ -36,6 +54,7 @@ main()
|
||||
LOGERROR(ERR_BUF_NULL);
|
||||
return ERR_BUF_NULL;
|
||||
}
|
||||
|
||||
// Blur image and save to new pointer
|
||||
unsigned int* blur = box_blur(buf, &img, 20);
|
||||
|
||||
@@ -43,6 +62,7 @@ main()
|
||||
// ending or possibly leaking. Also it stays in heap and a large image
|
||||
// can take a lot of memory so better to clear anyways.
|
||||
free(buf);
|
||||
|
||||
// Check for null image load. In case image doesnt exist or fails to
|
||||
// load
|
||||
if (!blur)
|
||||
|
||||
Reference in New Issue
Block a user