opencv/modules/imgcodecs
Letu Ren 4546f40d8b Refine logic of parsing PNG version
Currently, if `PNG_FOUND`, cmake scripts will check include and parse
header while we can use `PNG_VERSION_STRING` conveniently. If
`BUILD_PNG`, parse version from `PNG_LIBPNG_VER_STRING` directly is more
convenient than parsing major, minor and patch and concatenate them.

The comment of png.h also supports this.
```
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
```
https://github.com/glennrp/libpng/blob/libpng16/png.h#L287

This patch also modifies `ocv_parse_header_version` macro to receive
another parameter to make it more general.

The reason why changing `PNG_VERSION` to `PNG_VERSION_STRING` is to be
consistent with cmake's FindPNG.

This patch removes `HAVE_LIBPNG_PNG_H` variable because `PNG_INCLUDE_DIR`
is where to find png.h, etc according to
https://cmake.org/cmake/help/latest/module/FindPNG.html.

This patch also removes `PNG_PNG_INCLUDE_DIR` variable which is an
advanced variable used in cmake's FindPNG and is not used in opencv.
2023-12-23 16:01:42 +08:00
..
include/opencv2 Merge pull request #24405 from kochanczyk:4.x 2023-10-30 11:58:08 +03:00
misc Merge pull request #24136 from komakai:visionos_support 2023-12-20 15:35:10 +03:00
perf Merge pull request #22372 from ocpalo:libjpegturbo_nasm 2022-09-14 09:08:28 +03:00
src Refine logic of parsing PNG version 2023-12-23 16:01:42 +08:00
test Merge pull request #24405 from kochanczyk:4.x 2023-10-30 11:58:08 +03:00
CMakeLists.txt Merge pull request #24136 from komakai:visionos_support 2023-12-20 15:35:10 +03:00