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]
|
> [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.
|
> 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
|
```c
|
||||||
/*
|
/*
|
||||||
@@ -36,6 +54,7 @@ main()
|
|||||||
LOGERROR(ERR_BUF_NULL);
|
LOGERROR(ERR_BUF_NULL);
|
||||||
return ERR_BUF_NULL;
|
return ERR_BUF_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blur image and save to new pointer
|
// Blur image and save to new pointer
|
||||||
unsigned int* blur = box_blur(buf, &img, 20);
|
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
|
// ending or possibly leaking. Also it stays in heap and a large image
|
||||||
// can take a lot of memory so better to clear anyways.
|
// can take a lot of memory so better to clear anyways.
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
// Check for null image load. In case image doesnt exist or fails to
|
// Check for null image load. In case image doesnt exist or fails to
|
||||||
// load
|
// load
|
||||||
if (!blur)
|
if (!blur)
|
||||||
|
|||||||
Reference in New Issue
Block a user