1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

Compare commits

...

1882 Commits

Author SHA1 Message Date
Alexander Alekhin d7504ecaed OpenCV version++ 2016-12-16 16:19:56 +03:00
Alexander Alekhin c7ae26bf24 Merge pull request #7879 from alalek:backport_7852 2016-12-16 13:19:58 +00:00
Rostislav Vasilikhin 8444c23803 fixed segfault at ORB::compute() near image's border 2016-12-16 14:55:15 +03:00
Alexander Alekhin 22df206e1f Merge pull request #7875 from alalek:winpack_fix_2.4
cmake: update PDB support condition
2016-12-15 18:47:41 +02:00
Alexander Alekhin b06bd50144 cmake: update PDB support condition
Unfortunately there is no stable support for installation of PDB files in CMake.
This patch is just eliminate problems with modern versions.
2016-12-15 19:13:44 +03:00
Alexander Alekhin cc09f5a7de Merge pull request #7854 from alalek:backports_2016
(2.4) Backports from master branch (#7854)
2016-12-15 18:09:44 +02:00
Alexander Alekhin 49e6bb2993 Merge pull request #7868 from alalek:icc_2.4
(2.4) Build with ICC
2016-12-15 18:09:17 +02:00
Alexander Alekhin 667cb2e9fc Merge pull request #7867 from alalek:cuda_warnings_2.4
(2.4) Fix CUDA warnings
2016-12-15 18:09:12 +02:00
Alexander Alekhin 041502e42c build: eliminate ICC warnings 2016-12-15 16:03:15 +03:00
Alexander Alekhin d206e84a13 cmake: use -fp-model precise with ICC 2016-12-15 15:50:30 +03:00
Alexander Alekhin 03beff06ff build: disable warnings (Ubuntu 16.04 + CUDA 8.0)
Examples:
- NPP_staging.cu:1606:105: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
- NCVHaarObjectDetection.hpp:95:37: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
2016-12-15 15:47:41 +03:00
Alexander Alekhin 7db13c7aab Merge pull request #7847 from alalek:install_docs_target_2.4 2016-12-14 11:01:57 +00:00
Alexander Alekhin af0ee306cf Merge pull request #7819 from alalek:fix_mulSpectrums_inplace_2.4 2016-12-14 11:00:54 +00:00
Alexander Alekhin 7241b90dec cmake: special target to build/install docs only 2016-12-13 20:13:06 +03:00
bedbad ffcf866e2f Merge pull request #7754 from LAZI-2240:toupstream2.4
Introducing boundingRect2f() (#7754)

* Introducing boundingRect2f to return exact bounding float rectangle for RotatedRect

* Introducing boundingRect2f to return exact bounding float rectangle for RotatedRect

* Introducing boundingRect2f() - update

* Introducing boundingRect2f to return exact bounding float rectangle for RotatedRect

* Introducing boundingRect2f() - update - tested
2016-12-12 21:29:53 +02:00
Alexander Alekhin 7bceef715c test: fix mulSpectrums error tolerance 2016-12-10 18:38:05 +03:00
Alexander Alekhin 26fbaada0a cmake: disable warning C4127 for MSVS < 2015 2016-12-10 18:38:05 +03:00
Alexander Alekhin 6946f510fe mulSpectrums: refactor code 2016-12-08 18:03:14 +03:00
Alexander Alekhin 62c9ff25e5 core: added inplace check in 'divSpectrums' 2016-12-07 19:59:16 +03:00
Alexander Alekhin ab429d2e73 test: fix inplace in 'mulComplex' from test_dxt 2016-12-07 19:55:40 +03:00
Alexander Alekhin 21f3531b17 core: fix inplace support in mulSpectrums 2016-12-07 19:42:34 +03:00
Alexander Alekhin 7be4a0ee2f Merge pull request #7809 from alalek:backport_7797 2016-12-07 16:20:45 +00:00
Alexander Alekhin 25727454d9 Merge pull request #7807 from alalek:ipp_build_fix_2.4 2016-12-07 16:00:20 +00:00
Maksim Shabunin 29f5294fd2 Merge pull request #7808 from alalek:backport_7767 2016-12-07 14:01:38 +00:00
Maksim Shabunin cf97e6e00f Merge pull request #7806 from alalek:backport_7640 2016-12-07 14:00:41 +00:00
Maksim Shabunin bc96997410 Merge pull request #7805 from alalek:fix_java_test_2.4 2016-12-07 13:58:32 +00:00
Patrik Huber c6af179afc Added VS2017 support (MSVC 1910) 2016-12-06 20:22:59 +03:00
Maksim Shabunin ab260dafd2 Fixed Intel C++ 17 build in VS2015 2016-12-06 20:18:32 +03:00
Alexander Alekhin 10d1b33a80 perf: remove tvl1 check for magic numbers, reduce number of samples 2016-12-06 20:10:40 +03:00
Alexander Alekhin a05444618c test: tvl1 test check update 2016-12-06 20:10:40 +03:00
Alexander Alekhin d42d155c16 java: fix PATH environment variable 2016-12-06 20:07:30 +03:00
Alexander Alekhin 2d28bb4171 ipp: disable compilation with IPP 9+ 2016-12-06 16:04:35 +03:00
Vadim Pisarevsky 3d8395cae9 Merge pull request #7743 from alalek:cmake_ffmpeg_cleanup_2.4 2016-11-29 17:35:12 +00:00
Vadim Pisarevsky 2af4dc7249 Merge pull request #7741 from alalek:cmake_remove_legacy_pkgconfig 2016-11-28 20:55:29 +00:00
Vadim Pisarevsky 5cead19006 Merge pull request #7742 from alalek:backport_5884 2016-11-28 20:53:27 +00:00
Vadim Pisarevsky 7e38a2f0bb Merge pull request #7739 from alalek:fix_gtk_deprecated_2.4 2016-11-28 16:39:17 +00:00
Alexander Alekhin 32f568308a cmake: cleanup ffmpeg detection 2016-11-28 00:21:46 +03:00
Alexander Alekhin 5ac15f09ed cmake: add DEBUG_PRE/DEBUG_POST commands handling
Useful for debug purposes:
    cmake -DDEBUG_POST="ocv_cmake_dump_vars(CUDA)" .
    cmake -DCMAKE_PRE="ocv_cmake_dump_vars(\"OPENCL|opencl\")" .
2016-11-27 21:31:23 +03:00
Alexander Alekhin 36d7712c2c cmake: CMakeVars.txt (for debugging purpose) 2016-11-27 21:23:15 +03:00
Alexander Alekhin e5041abe55 cmake: remove outdated pkg-config module 2016-11-27 20:56:30 +03:00
Alexander Alekhin 90da593316 highgui: g_thread_create deprecated warning 2016-11-26 18:12:04 +03:00
Alexander Alekhin ac118aee78 Merge pull request #7733 from alalek:debug_check_matrelease_2.4 2016-11-26 08:13:38 +00:00
Alexander Alekhin f6d5a1dd2c Merge pull request #7727 from alalek:backport_7536 2016-11-26 08:10:29 +00:00
Alexander Alekhin 56ed8b1721 calib3d: fix fisheye for test fisheyeTest.stereoCalibrateFixIntrinsic 2016-11-26 02:43:39 +03:00
Alexander Alekhin e878b60dbc core: drop type/dims/rows/cols information in Mat::release() 2016-11-26 02:43:05 +03:00
Alexander Alekhin 11b642fb8c viz: eliminate warnings from tutorial code 2016-11-25 09:07:38 +03:00
Alexander Alekhin 6fb75c677b viz: update for VTK6.2+
PCL PR 1205
2016-11-25 09:07:26 +03:00
Alexander Alekhin 4a759abe39 Revert "Fix for VTK6.2 issue."
This reverts commit f45da9866a.
2016-11-25 09:07:04 +03:00
Alexander Alekhin 979b0ae9ce Merge pull request #7711 from alalek:fix_java_tests_2.4 2016-11-24 16:14:25 +00:00
Alexander Alekhin 408e4a7c27 Merge pull request #7708 from alalek:cmake_ccache_2.4 2016-11-24 16:12:46 +00:00
Alexander Alekhin da75d129fe java: fix Calib3d test 2016-11-23 15:49:24 +03:00
Alexander Alekhin a3bfa6f566 cmake: ccache 2016-11-23 15:07:58 +03:00
Alexander Alekhin 8e22b17919 java: backport test changes from master 2016-11-23 14:26:22 +03:00
Vadim Pisarevsky af8e6b06f7 Merge pull request #7689 from alalek:warnings_2.4 2016-11-22 13:30:25 +00:00
Alexander Alekhin 7b13550bdd Merge pull request #7697 from alalek:backport_6561 2016-11-22 11:01:29 +00:00
Vadim Pisarevsky 62b2039040 Merge pull request #7698 from alalek:backport_perf_gabor 2016-11-21 14:42:54 +00:00
Alexander Alekhin f21f153a5f test: backport check for Image_KernelSize_GaborFilter2d perf test 2016-11-21 14:56:51 +03:00
Tomoaki Teshima 3ea4f72e35 fix Core_MulSpectrum test on 64bit ARM + release mode
* fix issue 6536
  * increase threshold in particular tests due to the difference of fmsub and fsub
2016-11-21 14:52:29 +03:00
Alexander Alekhin b1c8557401 Merge pull request #7690 from alalek:backport_arm_toolchain 2016-11-20 11:38:01 +00:00
Alexander Alekhin 0a543c5531 test: fix Legacy_StereoGC.regression assertion 2016-11-18 22:32:32 +03:00
Alexander Alekhin a42be1f9bd backport ARM toolchain from master 2016-11-18 15:36:16 +03:00
Alexander Alekhin 19270eeab4 warnings 2016-11-18 15:31:59 +03:00
Alexander Alekhin 497d0fd2e7 build: OSSpinLock deprecation warning 2016-11-18 15:31:14 +03:00
Maksim Shabunin 21167b1bf1 Fixed several GCC 5.x warnings 2016-11-18 15:31:05 +03:00
Alexander Alekhin 4d041e6809 Merge pull request #7672 from dec1:2.4 2016-11-15 19:01:46 +00:00
Declan Moran 4d84e6efee fix compiler error when building with gnu-5 toolchain (eg as currently shipped with crystax.org android ndk, and presumably soon with android studio).
"ts_perf.cpp ....error: 'errno' was not declared in this scope
      int err=errno;"
2016-11-15 16:35:11 +01:00
Alexander Alekhin 8f4251fbfa Merge pull request #7655 from alalek:backport_7213 2016-11-14 13:42:31 +00:00
Alexander Alekhin 64a2d1904b ffmpeg: backport 7213
Commit:
  6d54abbd0f
2016-11-11 16:57:10 +03:00
Vadim Pisarevsky f632f5c552 Merge pull request #7529 from alalek:backport_7526 2016-11-02 10:50:45 +00:00
Alexander Alekhin f0d592e6b6 Merge pull request #7559 from alalek:cv_xadd_24 2016-10-27 16:00:37 +00:00
Alexander Alekhin c585d3890e core: update CV_XADD
Allow to use custom implementations of CV_XADD (passed via -D of CXXFLAGS)
2016-10-27 13:46:51 +03:00
Alexander Alekhin 8577f71810 ts: 2.4 changes 2016-10-20 16:26:19 +03:00
Alexander Alekhin 6f00e53159 ts: update run.py
Add information about python bindings
2016-10-20 16:23:27 +03:00
Alexander Alekhin 422154dc97 Merge pull request #7499 from catree:add_distortion_images_2.4 2016-10-17 03:21:45 +00:00
Alexander Alekhin 50486bd34d Merge pull request #7498 from catree:morphology_additional_information_2.4 2016-10-17 03:21:26 +00:00
catree 1c409abe9c Add example image about distortion effect. 2016-10-17 00:18:41 +02:00
catree c419552002 Add images for tutorials on morphological operations to avoid possible confusion. 2016-10-17 00:01:08 +02:00
Juha Reunanen 4e7f28811c Merge pull request #7452 from reunanen:issue-7409-2.4
Fix findContours crash for very large images (v2.4)

* Cast step to size_t in order to avoid integer overflow when processing very large images

* Change assert to CV_Assert
2016-10-12 10:37:07 +03:00
Vadim Pisarevsky c7c831bca5 Merge pull request #7414 from StevenPuttemans:fix_docs_OPENNI_2.4 2016-10-06 13:26:47 +00:00
StevenPuttemans 80f03f58e7 backport of 7361 2016-10-06 13:45:55 +02:00
Vadim Pisarevsky a34b8d4abf Merge pull request #7391 from alalek:24_fix_7388 2016-10-04 12:42:18 +00:00
Vadim Pisarevsky 72becbbb1f Merge pull request #7379 from catree:fix_hitmiss_doc_link_2.4 2016-10-04 12:15:35 +00:00
Alexander Alekhin c181f2f493 cmake: fix for GCC 6.x 2016-10-04 13:30:43 +03:00
Alexander Alekhin 36db16a00d Merge pull request #7383 from alalek:fix_get_property 2016-10-02 11:34:36 +00:00
Alexander Alekhin 26a32dcbf6 videoio: remove 'const' from getProperty
'const' is available in OpenCV 3.x only
2016-10-02 03:04:37 +03:00
catree f1009e2234 Fix dead link for hit or miss 2.4 documentation. 2016-09-30 23:56:35 +02:00
Vadim Pisarevsky 9ff63a46fc Merge pull request #7314 from alalek:backport_7266 2016-09-22 11:28:46 +00:00
Alexander Alekhin c314178e7a highgui/osx: backport AVFoundation support 2016-09-19 19:51:10 +03:00
Alexander Alekhin 3648c61172 highgui: clone cap_avfoundation_mac.mm from master 2016-09-19 19:46:42 +03:00
Alexander Alekhin d68e350227 OpenCV version++ 2016-09-16 18:55:58 +03:00
Alexander Alekhin 14ac55d05e Merge pull request #7289 from alalek:android24 2016-09-16 15:55:39 +00:00
Alexander Alekhin 2d10336601 fix documentation 2016-09-16 16:15:51 +03:00
Alexander Alekhin 4d17051f14 android: backport Android SDK build script 2016-09-16 16:15:51 +03:00
Alexander Alekhin 9285dddbaa android: clone build_sdk.py from 3.x 2016-09-16 16:15:51 +03:00
Alexander Alekhin 1f6cf50be3 Merge pull request #7286 from alalek:fix_android_clang 2016-09-16 09:56:34 +00:00
Alexander Alekhin c68b9328ca android: workaround for Android NDK-8e clang ICE 2016-09-14 23:20:10 +03:00
Vadim Pisarevsky 2f01930ecc Merge pull request #7218 from savuor:fix2.4/copyTo 2016-09-14 11:58:29 +00:00
Alexander Alekhin 4bccd9a92a Merge pull request #7239 from savuor:fix2.4/ported 2016-09-08 11:18:13 +00:00
Rostislav Vasilikhin b8b7f155a5 fixed random failures in Core_DFT.complex_output2 test (the case of input_mat.cols == 1) 2016-09-07 14:56:22 +03:00
Rostislav Vasilikhin 27dd27400a fixed invalid output of cv::dft when using DFT_ROWS + DFT_COMPLEX_OUTPUT (http://code.opencv.org/issues/3428) 2016-09-07 14:56:22 +03:00
Rostislav Vasilikhin 6d691f2e05 added test for http://code.opencv.org/issues/1918 2016-09-07 14:56:21 +03:00
Rostislav Vasilikhin 9840825743 added test checking http://code.opencv.org/issues/4050 2016-09-07 14:56:21 +03:00
Maksim Shabunin ce2733bb37 Merge pull request #7242 from bkuhls:asm 2016-09-07 09:09:29 +00:00
Rostislav Vasilikhin cb52d249fe fixed optional args processing in SVD::compute() 2016-09-06 14:09:44 +03:00
Bernd Kuhls c7045184ce types_c.h: Fix compiling VFP assembler code
Replace asm by __asm__ according to
https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate-Keywords
as suggested by Arnout Vandecappelle:
http://lists.busybox.net/pipermail/buildroot/2016-September/171491.html

to fix build errors in ffmpeg with opencv2 support detected by
buildroot autobuilders:
http://autobuild.buildroot.net/results/c32/c32a21240a9933796ee850349a62ff3c2314f25c/build-end.log

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
2016-09-06 12:25:09 +02:00
Rostislav Vasilikhin 0a3a2df433 fixed U non-orthogonality in SVD (http://code.opencv.org/issues/3801) 2016-09-03 21:58:19 +03:00
Rostislav Vasilikhin b28d13430c fixed http://code.opencv.org/issues/3828 2016-09-03 21:49:54 +03:00
Rostislav Vasilikhin 726efee4d2 fixed http://code.opencv.org/issues/4278 2016-09-03 20:28:54 +03:00
Rostislav Vasilikhin be7c924e7c integer overflow fixed in getContinuousSize() 2016-09-02 01:50:54 +03:00
Alexander Alekhin 0a30f64f12 Merge pull request #7206 from alalek:issue_7204 2016-09-01 12:07:02 +00:00
Alexander Alekhin a6e5ebafcf calib3d: fix cornerSubPix memory error 2016-08-31 15:18:25 +03:00
Vadim Pisarevsky e5175dbc1e Merge pull request #7152 from PkLab:fix_rho&phi_doc_2.4 2016-08-23 20:36:39 +00:00
PkLab.net 2d0fe514a0 Fix rho,phi exchange. Backport to 2.4 2016-08-22 20:17:11 +02:00
Vadim Pisarevsky f189ffe9af Merge pull request #7132 from Asalle:fix-6944-template-update 2016-08-19 08:13:26 +00:00
Asal Mirzaieva 0f8023967c add reqiured includes to the "Load, Modify, and Save an Image" tutorial
resolves #6944
2016-08-18 15:57:20 +03:00
Maksim Shabunin 0a1812c257 Merge pull request #7089 from catree:fix_cvProjectPoints2_typo_bug_2_4 2016-08-16 09:31:35 +00:00
catree a893395da8 Fix typo bug in the calculation of some derivatives (dmxdt, dmydt, dmxdr, dmydr) in cvProjectPoints2 function. 2016-08-11 00:56:24 +02:00
Vadim Pisarevsky 35acfcf791 Merge pull request #7015 from lewgate:bugfix_1 2016-08-08 15:20:31 +00:00
Alexander Alekhin fc6c55f070 Merge pull request #7061 from catree:add_camera_model_doc_2_4 2016-08-08 11:47:54 +00:00
Alexander Alekhin 443f302414 Merge pull request #7065 from StevenPuttemans:fix_typo_features2d 2016-08-08 11:39:26 +00:00
StevenPuttemans 79d8d0da3b fix small typo 2016-08-08 10:58:46 +02:00
catree ba14895fd7 Add figure for the pinhole camera model in the 2.4 documentation. 2016-08-08 04:06:46 +02:00
lewgate 0af9bf457a Fix a latent bug for seam_finders.cpp when computing the source and destination points of the seam 2016-07-31 16:22:53 +08:00
Vadim Pisarevsky 6d9c6e9c7a Merge pull request #6805 from sergarrido:sergarrido-fix-useextrinsicguess 2016-07-19 12:52:59 +00:00
Vadim Pisarevsky 744f907815 Merge pull request #6941 from alalek:backport_6932 2016-07-18 21:16:35 +00:00
Vadim Pisarevsky 0d7c16b5fd Merge pull request #6920 from savuor:fix2.4/RNG_Corrupts_memory 2016-07-18 18:16:27 +00:00
Philippe FOUBERT d99821aa44 Resolves issue #6931 2016-07-18 16:25:03 +03:00
Maksim Shabunin 36f1881925 Merge pull request #6934 from catree:hitrate_doc_2.4 2016-07-18 08:45:59 +00:00
Maksim Shabunin bc6d5cc113 Merge pull request #6885 from alalek:migration2.4 2016-07-18 07:50:03 +00:00
catree 87d06eab82 Add bib reference for overall hitrate and false alarm rate for the train cascade user guide (OpenCV 2.4). 2016-07-17 23:06:20 +02:00
Rostislav Vasilikhin 7b2ef647aa fixed memory corruption when normal dist. params have less channels than target matrix; test added 2016-07-16 14:38:28 +03:00
Alexander Alekhin 5e4d3559be Merge pull request #6917 from jet47:gpu-rotate-sanity-test 2016-07-15 16:16:25 +00:00
Vladislav Vinogradov 9e65216108 set threshold to 1 in sanity test for GPU rotate on 8UC1
to fix difference with CUDA 8.0 results
2016-07-15 15:11:36 +03:00
Alexander Alekhin bb5e25ba7c migration: github.com/opencv/opencv 2016-07-12 12:54:33 +03:00
Andrey Pavlenko 688bd28987 Merge pull request #6600 from grochefort:fix_backgroundsubstractormog2 2016-07-04 14:37:24 +00:00
Andrey Pavlenko 56aa03b0e1 Merge pull request #6538 from asmorkalov:libcc_fix 2016-07-04 13:05:34 +00:00
Alexander Smorkalov f29fd63f13 Enabled build with LLVM libc++ for Android. 2016-07-04 14:59:41 +03:00
Alexander Alekhin 8865528dc2 Merge pull request #6743 from alalek:libpng_24 2016-07-01 10:27:57 +00:00
Andrey Pavlenko 1432471650 Merge pull request #6750 from Tomin1:simpleblobdetector-fix 2016-06-30 15:23:46 +00:00
Alexander Alekhin babaa00ac1 libpng: fix NEON 2016-06-30 16:44:53 +03:00
Alexander Alekhin 7c64e03cc9 libpng: re-apply patch 2016-06-30 16:44:53 +03:00
Alexander Alekhin 882e120a9d update libpng 1.5.27 2016-06-30 16:44:53 +03:00
Alexander Alekhin 8bb8f8dcae Merge pull request #6752 from alalek:backport_6747 2016-06-30 11:26:49 +00:00
Vitaliy Lyudvichenko c3dc7266d1 Fixing of AutoBuffer::allocate(nsz) method
AutoBuffer::allocate(nsz) didn't work properly when
(sz < nsz < fixed_size). In this case sz remained unchanged.
2016-06-30 13:10:53 +03:00
Tomi 9564531ec8 features2d: Added missing SimpleBlob parameters
Added missing SimpleBlobDetector parameters to features2d_init.cpp.
2016-06-30 10:41:03 +03:00
Alexander Alekhin 54f190cba3 Merge pull request #6692 from ilya-lavrenov:lintian 2016-06-17 09:44:20 +00:00
Ilya Lavrenov 6677f81779 fixed lintian warnings 2016-06-17 11:00:36 +03:00
Alexander Alekhin dafb4b81da Merge pull request #6691 from alalek:cmake_fix_android_samples_2.4 2016-06-16 15:56:33 +00:00
Alexander Alekhin c6be51eecd cmake: fix JNI configuration problem for Android samples
Some CMake 3.x (2.8.12.2 is fine) provides broken build configurations
with following build error message:
    ld: fatal error: -soname: must take a non-empty argument

Linker command line sample contains this:
"-shared -Wl,-soname, -o"
2016-06-16 16:08:35 +03:00
Alexander Alekhin aa861520f6 Merge pull request #6689 from ilya-lavrenov:il/fix 2016-06-16 11:39:20 +00:00
Ilya Lavrenov e0d64df763 fixed -Wunused-result warning 2016-06-16 12:53:59 +03:00
S. Garrido e5d12502c5 Fix useExtrinsicGuess in solvePnP 2016-06-10 13:09:32 +01:00
Alexander Alekhin 77849d0033 Merge pull request #6654 from asmorkalov:gzip_timestamp 2016-06-08 14:32:45 +00:00
Alexander Smorkalov 9fee699693 Fixed package-contains-timestamped-gzip lintian warning for Debian packages. 2016-06-08 14:18:38 +03:00
Gilles Rochefort 2717ba735a Fixed BackgroundSubstractorMOG2 ocl implementation. 2016-06-03 22:17:22 +02:00
Gilles Rochefort 78de75397e Fixed BackgroundSubstractorMOG2 in opencv_video.
The number of gaussians involved in a mixture is supposed
to be dynamically adjusted. After being increased, the number
of gaussians can't be reduced anymore.

It seems to be a regression as the legacy code
located in modules/legacy/src/bgfg_gaussmix.cpp allows to reduce
such number of gaussians.
2016-05-29 17:25:02 +02:00
Alexander Alekhin 19e79d6727 Merge pull request #6596 from asmorkalov:g++5_abi 2016-05-27 12:44:38 +00:00
Alexander Smorkalov a8b2b4dba1 Packaging fixes for Ubuntu 16.04. 2016-05-27 13:46:12 +03:00
Maksim Shabunin 2124cb1192 Merge pull request #6545 from alalek:backport_6541 2016-05-18 09:39:48 +00:00
Maksim Shabunin fb598bb76a Disabled PCH support for gcc >= 6.0.0
Command line generation routine uses "-isystem" to include headers outside of "<opencv>/modules" folder, but GCC 6 does not work when passed "-isystem /usr/include" option.
2016-05-16 15:00:16 +03:00
Alexander Alekhin 59975db6a4 Merge pull request #6441 from asmorkalov:version++ 2016-04-20 14:21:19 +00:00
Alexander Alekhin ec2ff7f0c0 Merge branch '2.4.12.x-prep' into 2.4 2016-04-20 16:26:12 +03:00
Alexander Alekhin 5d038686b1 Merge pull request #6401 from StevenPuttemans:add_model_visualisation_tool_2.4 2016-04-20 13:24:25 +00:00
Alexander Smorkalov 6084901610 OpenCV version++. 2016-04-20 16:03:47 +03:00
Alexander Alekhin e58c28974b Merge pull request #6431 from StevenPuttemans:add_fixed_video_2.4 2016-04-19 14:19:41 +00:00
Alexander Alekhin 1b4bd6a905 Merge pull request #6432 from kevin-coder:bugfix_6317_Restore_2.4 2016-04-19 13:32:44 +00:00
StevenPuttemans 67fe57a0a3 add fixed video 2016-04-19 15:30:49 +02:00
Kevin, Hu db0ae2ca50 Restore 2.4 source branch for bug fix 6317. 2016-04-19 19:27:42 +08:00
Alexander Alekhin de164b0ccf Merge pull request #6421 from alalek:backport_6417 2016-04-18 15:12:17 +00:00
Suleyman TURKMEN 194f1beae8 fix for writing 16-bit jpeg2000 2016-04-18 14:51:55 +03:00
Maksim Shabunin 3bd6912e01 Merge pull request #6415 from mshabunin:fix-xcode-warnings-24 2016-04-16 06:39:00 +00:00
Maksim Shabunin 1a41ed2fda Updates for XCode 7.3 2016-04-15 21:56:50 +03:00
StevenPuttemans 9d71c19939 add visualisation tool for 2.4 branch 2016-04-14 11:33:37 +02:00
Alexander Alekhin 5b73f3a316 Merge pull request #6373 from terfendail:vt/stereobm_valgrind 2016-04-13 13:38:53 +00:00
Maksim Shabunin 96d747f030 Merge pull request #6384 from StevenPuttemans:update_annotation_tool_2.4 2016-04-13 10:02:56 +00:00
StevenPuttemans 5164c4ba31 vectorize process + enable early quitting/storage + enable delete annotation option 2016-04-13 09:10:24 +02:00
Vitaly Tuzov 13858cd561 Cost estimation boundaries description updated 2016-04-12 17:31:12 +03:00
Vitaly Tuzov 772d9689e9 Backport of StereoBM uninitialized memory access problem fix from master branch 2016-04-12 17:27:16 +03:00
Maksim Shabunin ff3bb9f4e6 Merge pull request #6383 from alalek:backport_6381 2016-04-12 08:40:01 +00:00
Maksim Shabunin e90b697cb0 Merge pull request #6386 from mshabunin:fix-python-test-issue 2016-04-12 08:29:44 +00:00
Maksim Shabunin 70bc268c1a Fixed problem with nonfree python test: could not find local test images 2016-04-11 18:45:14 +03:00
Philipp Hasper b6d8c9d990 operator<< handles keys starting with underscore 2016-04-11 12:43:58 +03:00
Vitaly Tuzov a7ce9a176b Fixed uninitialized memory errors in stereoBM 2016-04-07 23:58:17 +03:00
Alexander Alekhin 52ba3778e3 Merge pull request #6363 from alalek:ffmpeg_fix_timeout_24 2016-04-05 16:29:15 +00:00
Alexander Alekhin c7b6353a3c Merge pull request #6365 from terfendail:vt/nonlocal_testdata 2016-04-05 15:25:15 +00:00
Vitaly Tuzov 34b3d31f54 Fix for nonlocal data requirement in test2.py 2016-04-05 16:47:29 +03:00
Alexander Alekhin 6f139b4f8e ffmpeg: interrupt callback fix
backport from master
2016-04-05 14:19:44 +03:00
Alexander Alekhin 86a725933a Merge pull request #6343 from terfendail:vt/python_rng_seed_backport 2016-03-29 16:06:27 +00:00
Vitaly Tuzov 64f02aa72d Backport of setRNGSeed implementation and python test randomness fix 2016-03-29 18:05:28 +03:00
Alexander Alekhin 12a8f5486d Merge pull request #6341 from SpecLad:destroy-leak 2016-03-29 12:36:51 +00:00
Roman Donchenko 97ac59cb73 Fix a memory leak indirectly caused by cvDestroyWindow 2016-03-29 14:06:05 +03:00
Alexander Smorkalov 762965897a Merge pull request #6320 from terfendail:vt/pytestarm64 2016-03-24 17:16:52 +00:00
Vitaly Tuzov ea3746bd15 Made texture flow python test less strict to fix it on AARCH64 2016-03-23 20:07:42 +03:00
Alexander Smorkalov ef2a376baf Merge pull request #6297 from terfendail:vt/pytestarm 2016-03-21 15:01:04 +00:00
Maksim Shabunin dc8bb23a7d Merge pull request #6287 from StevenPuttemans:add_num_features_info_2.4 2016-03-21 14:09:21 +00:00
Vitaly Tuzov 24361733e4 Fixed face detection python test 2016-03-18 17:44:45 +03:00
StevenPuttemans b5fbb2b1c8 add cascade classifier info - total number of unique features passed to boosting process 2016-03-17 13:33:11 +01:00
Alexander Smorkalov b8ce65bec8 Merge pull request #6279 from terfendail:vt/pythontest_data 2016-03-17 12:27:12 +00:00
Vitaly Tuzov 96903dc4ad Test data necessary for python samples added to test package.
Test launch script updated to run new tests as well.
2016-03-17 11:38:40 +03:00
Alexander Smorkalov da669569e1 Merge pull request #6281 from SpecLad:videowriter-oob 2016-03-17 08:09:13 +00:00
Roman Donchenko eb40afa26a Add a workaround for FFmpeg's color conversion accessing past the end of the buffer
I delete the LIBAVFORMAT_BUILD < 5231 branch, because I couldn't even find FFmpeg with
such a small build number, let alone test with it.
2016-03-16 20:04:33 +03:00
Roman Donchenko 421fcf9e35 Rearrange CvVideoWriter_FFMPEG::writeFrame for better readability 2016-03-16 16:28:59 +03:00
Alexander Smorkalov d142c05d61 Merge pull request #6276 from SpecLad:bp-3813 2016-03-16 11:41:27 +00:00
Roman Donchenko 9a5d7f1a0b Backport PR #3813 to 2.4
It has already been partially backported by #6199; this commit completes
the backport.
2016-03-16 12:34:41 +03:00
Alexander Alekhin 9d49cef29e Merge pull request #6245 from delftswa2016:fix-for-issue-4375 2016-03-14 11:26:33 +00:00
shruthikashyap 1fbc6ab05d Adding the syntax and usage for cv2.undistortPoints(). 2016-03-13 13:32:24 +01:00
Vadim Pisarevsky 93c4dfb16d Merge pull request #6236 from alalek:backport_6232 2016-03-12 16:38:56 +00:00
Alexander Alekhin 52b9207105 Merge pull request #6237 from mshabunin:fix-vtk-on-2.4 2016-03-11 14:20:16 +00:00
Maksim Shabunin d2e451e877 Ported VTK cmake detection from master branch 2016-03-11 16:25:47 +03:00
Piotr Semenov 00e91fd3d0 Fix that corrects the OpenCV's random access iterator distance: d(x,y) = -d(y,x) 2016-03-11 15:20:36 +03:00
Alexander Alekhin afc62f076a Merge pull request #6234 from asmorkalov:as/deb_version_check 2016-03-11 10:06:25 +00:00
Alexander Smorkalov 9c4204b89e Added check if debian package version matches version from version.hpp 2016-03-11 11:59:15 +03:00
Maksim Shabunin 3afb5a6006 Merge pull request #6171 from terfendail:vt/new_python_tests_backport 2016-03-10 09:09:32 +00:00
Maksim Shabunin 7e44faf635 Merge pull request #6228 from wangguoqin1001:2.4 2016-03-10 08:10:19 +00:00
WANG Guoqin 8cfc87cf01 MacOSX / QTKit capture: trying to fix invalid timer call 2016-03-10 02:49:10 +08:00
Alexander Alekhin ea049e147d Merge pull request #6199 from alalek:ffmpeg_backport 2016-03-03 17:25:33 +00:00
Alexander Alekhin 60f73eee7e Merge pull request #6204 from alalek:minor_fix_break 2016-03-03 12:07:16 +00:00
Alexander Alekhin c1f3c41bab apps: add missed 'break' 2016-03-03 14:23:59 +03:00
Vitaly Tuzov d29eb2938c Calibration test temporary disabled 2016-03-03 13:38:08 +03:00
Alexander Alekhin a61b19b524 backport ffmpeg fixes 2016-03-02 18:42:53 +03:00
Vitaly Tuzov 25b4d8a1b5 Added images necessary for tests 2016-02-26 12:42:35 +03:00
Vitaly Tuzov aaa30dc5b6 Make some tests less strict due to improvement of related algorithms in master branch 2016-02-26 12:42:35 +03:00
Vitaly Tuzov e0f426f78b Backport of new python tests from master branch(PR https://github.com/Itseez/opencv/pull/6025).
At the moment tests requre samples/data copied to source location from master branch.
2016-02-26 12:42:18 +03:00
Alexander Alekhin 8a09d95eab Merge pull request #6106 from ilya-lavrenov:compilation-warning 2016-02-15 15:12:49 +00:00
Ilya Lavrenov 068769263e fixed compilation warning 2016-02-12 18:12:20 +03:00
Maksim Shabunin 21e9edd1a3 Merge pull request #6083 from alekcac:alekcac-removed-gittip-link-in-2.4 2016-02-08 15:32:41 +00:00
Alexander Shishkov 544824ffc1 Removed gittip link
This project is dead from the 1st September last year
2016-02-08 11:07:58 +03:00
Alexander Alekhin d6e2097435 Merge pull request #6037 from atinfinity:pullreq/160130-enable-nvcuvid-2.4 2016-02-02 07:09:20 +00:00
atinfinity cf43790a27 added cmakedefine to cmake/templates/cvconfig.h.in 2016-02-01 21:15:28 +09:00
atinfinity 69eaa89e22 fixed to use NVCUVID in 'cudacodec' module. 2016-01-31 01:56:45 +09:00
Alexander Alekhin e835878661 Merge pull request #6006 from mleotta:fix-install-name-dir 2016-01-23 06:41:51 +00:00
Matt Leotta 912592de4c Remove "INSTALL_NAME_DIR lib" target property
The INSTALL_NAME_DIR property of a target specifies how a dynamic library should
be found on OS X.  If INSTALL_NAME_DIR is not specified the loader will search
relative to the standard search paths.  If specified it should either be
an absolute path or relative path prefixed with either @executable_path,
@load_path, or @rpath.  Specifying "lib" does not make sense here and
causes linking error as documented here:

http://answers.opencv.org/question/4134/cmake-install_name_tool-absolute-path-for-library-on-mac-osx/

and here

http://stackoverflow.com/questions/26978806/dyld-library-not-loaded-lib-libopencv-core-3-0-dylib-reason-image-not-found

This patch removes INSTALL_NAME_DIR everywhere it is set to "lib".
An alternate solution would be to set an absolute path like
"${CMAKE_INSTALL_PREFIX}/lib" or relative path like
"@executable_path/../lib".  However, if there is not specific need for
specifying a path, it is probably best left unset.
2016-01-21 16:07:56 -05:00
Alexander Alekhin 85793d0138 Merge pull request #6001 from terfendail:pyrsegmentation_valgrind 2016-01-21 15:03:46 +00:00
Alexander Alekhin a57b03c356 Merge pull request #5993 from asmorkalov:linitian_signed_packages 2016-01-21 15:03:31 +00:00
Alexander Smorkalov 5a5378b3bf Added lintian overrides for package signature entry. 2016-01-21 17:04:28 +03:00
Vitaly Tuzov f01f1bc5e6 Fixed "Conditional jump or move depends on uninitialised value(s)" valgrind issue due to wrong pointer recalculation for zero level of pyramid. 2016-01-21 12:54:08 +03:00
Alexander Alekhin 85c7190e41 Merge pull request #5995 from alalek:fix_include_opencv_24 2016-01-21 05:16:37 +00:00
Alexander Alekhin f2e4bec925 Merge pull request #5996 from ElenaGvozdeva:pyrUp_fix 2016-01-20 15:50:59 +00:00
Alexander Alekhin 4a8d1147c2 include available modules only 2016-01-20 13:14:20 +03:00
Elena Gvozdeva bb1c2d71a8 fix bug on border at pyrUp 2016-01-20 13:07:07 +03:00
Vadim Pisarevsky be565c2235 Merge pull request #5984 from terfendail:2.4 2016-01-19 10:49:56 +00:00
Vitaly Tuzov 389f176a67 Removed ioctl calls to query for VIDIOC_G_INPUT and VIDIOC_ENUMINPUT since information returned by the calls is never used.
Fixed icvCaptureFromCAM_V4L return value in case of V4L2 camera initialization failure.
2016-01-18 12:54:53 +03:00
Alexander Alekhin 5c21ca2697 Merge pull request #5975 from terfendail:2.4 2016-01-15 11:45:10 +00:00
Vitaly Tuzov 4f5d585184 Update call to Tegra optimized morphology filtering 2016-01-15 11:48:29 +03:00
Alexander Alekhin c01fd16291 Merge pull request #5946 from takacsd:patch-1 2016-01-12 08:08:58 +00:00
takacsd 537d1322b4 Add missing implementation to one of the Mat_<_Tp> constructor. (#5945) 2016-01-11 16:05:22 +01:00
Alexander Alekhin 8a803865cf Merge pull request #5942 from akarsakov:fix_memcpy_empty_vector 2016-01-11 11:12:31 +00:00
Alexander Karsakov 6e22020dad Fixed pnpTask: don't copy inliers vector in case it's empty. 2016-01-11 11:39:18 +03:00
Alexander Alekhin f91ada572a Merge pull request #5858 from mshabunin:fix-arm-cross-warnings 2015-12-24 09:07:29 +00:00
Alexander Alekhin f7c8f74ac1 Merge pull request #5869 from atinfinity:pullreq/151223-FindTBB-VS2015-2.4 2015-12-23 16:16:57 +00:00
atinfinity c4e80952ce changed to find TBB library(VS2015) 2015-12-23 23:43:01 +09:00
Alexander Alekhin 178ed63e1a Merge pull request #5846 from mshabunin:backports-3 2015-12-22 17:31:20 +00:00
Maksim Shabunin 46edb54ac3 Fixed PCH warning during ARM crosscompilation 2015-12-22 15:58:39 +03:00
Maksim Shabunin 7cb78451d1 Backported several changes from master branch:
- #3771 - inline round on ARM
- #5633 - documentation for MSER
- #5666 - run.py fixes
2015-12-21 18:20:37 +03:00
Alexander Smorkalov 2897da037e Merge pull request #5763 from ilya-lavrenov:lintian 2015-12-16 11:27:59 +00:00
Ilya Lavrenov 4fa14f75b8 suppress lintian warning in opencv.pc 2015-12-09 13:47:09 +03:00
Vadim Pisarevsky 0886f6fe62 Merge pull request #5733 from teng88:patch-3 2015-12-07 10:08:23 +00:00
Maksim Shabunin 681df84036 Merge pull request #5720 from asmorkalov:as/cuda_qnx 2015-12-03 07:41:23 +00:00
Teng Cao 07a58c47cb Update cascadeclassifier.cpp
minor fix since predict() returun int
2015-12-02 17:31:17 +08:00
Alexander Smorkalov 53ed1a8c03 Build fix for QNX 6.6 neitrino. 2015-11-30 10:28:04 +03:00
Alexander Smorkalov 4d598719da Merge pull request #5713 from ilya-lavrenov:lintian 2015-11-26 08:20:12 +00:00
Ilya Lavrenov 130d4b1bdf added suppression for python-script-but-no-python-dep 2015-11-25 23:38:44 +03:00
Vadim Pisarevsky 42001234ab Merge pull request #5390 from StevenPuttemans:add_markers_2.4 2015-11-23 13:40:00 +00:00
Vadim Pisarevsky 6e885e5775 Merge pull request #5682 from ilya-lavrenov:lintian-overrides 2015-11-23 13:38:38 +00:00
Maksim Shabunin 5c0cdd4d2d Merge pull request #5650 from hoangviet1985:fix_bug_5623 2015-11-20 16:15:47 +00:00
Ilya Lavrenov 969f0c4456 added lintian overrides for debian packages 2015-11-19 17:10:09 +03:00
Maksim Shabunin 739d7caa32 Merge pull request #5659 from jet47:cuda-wrap-stream-2.4 2015-11-19 09:25:36 +00:00
Maksim Shabunin 6148c3525e Merge pull request #5672 from ilya-lavrenov:npp-graphcut 2015-11-19 09:18:23 +00:00
Vadim Pisarevsky df55aaec1e Merge pull request #5674 from mshabunin:mac-fix-2.4 2015-11-17 17:30:08 +00:00
Maksim Shabunin eebd4cad66 Fix compilation problems with XCode 7.1.1 and cmake 3.3.2 2015-11-17 18:52:55 +03:00
Ilya Lavrenov 0050df8750 GraphCut deprecated in 7.5 and removed in 8.0 2015-11-15 00:56:56 +03:00
Maksim Shabunin 01b5971c94 Merge pull request #5640 from mshabunin:restore-ts-gpu 2015-11-13 15:47:17 +00:00
Vladislav Vinogradov 8d3850ac02 add cv::gpu::StreamAccessor::wrapStream method
it allows to import existed CUDA stream to OpenCV
2015-11-12 13:07:30 +03:00
Alexander Alekhin 1862d1995f Merge pull request #5652 from jet47:core-test-math-warning-fix 2015-11-12 03:10:46 +00:00
Alexander Alekhin fc1694c97c Merge pull request #5655 from janstarzy:2.4-canny-fix 2015-11-12 03:10:11 +00:00
Jan Starzynski 2799829bc9 fix potential buffer overflow as in 3.0 2015-11-11 16:19:20 +01:00
Vladislav Vinogradov d5e6503fe5 fix signed/unsigned comparison warning in core/test/test_math.cpp 2015-11-11 11:53:39 +03:00
hoangviet1985 6441620f45 The right signs give the right results 2015-11-10 16:18:07 -05:00
Vadim Pisarevsky 0f288d1082 Merge pull request #5605 from hoangviet1985:fix_bug_5599 2015-11-10 16:13:26 +00:00
Vadim Pisarevsky 82c1c68560 Merge pull request #5622 from LorenaGdL:hitAndMiss2.4 2015-11-10 16:03:48 +00:00
Vadim Pisarevsky 780b713016 Merge pull request #5638 from hoangviet1985:fix_bug_5623 2015-11-10 16:01:48 +00:00
Alexander Alekhin 1b6dd03fd7 Merge pull request #5641 from alalek:backport_5320 2015-11-07 05:21:31 +00:00
berak 28974e7290 remove usage of obsolete _dataAsRows flag 2015-11-06 19:59:25 +03:00
Maksim Shabunin ffb9e877e9 Restore ts/gpu_perf.hpp, trying to compile with VS 2015 2015-11-06 13:26:58 +03:00
Viet Dinh 1e879e1ab1 clean up 2015-11-06 00:29:44 -05:00
Viet Dinh 57829d81ea mac compile error 2015-11-05 23:31:30 -05:00
Viet Dinh a20a273982 Merge remote-tracking branch 'Itseez/2.4' into fix_bug_5599 2015-11-05 23:20:04 -05:00
Viet Dinh e9b31a70bf mac osx compile errors 2015-11-05 21:44:36 -05:00
Viet Dinh a1532582a6 optimize code 2015-11-05 19:38:24 -05:00
Viet Dinh 68bcff26fb fix solveCubic
The original solution did not handle correctly when delta = 0,
resulting as nan errors. I also wrote a test case to test solving
equation x^3 = 0 after fixing.
2015-11-05 19:19:56 -05:00
Viet Dinh 433bc81b30 std::cbrt could not be found 2015-11-03 21:40:52 -05:00
Viet Dinh c8bf176558 casting warning 2015-11-03 21:10:38 -05:00
Viet Dinh cfd5caf29d deal with type casting issues 2015-11-03 16:19:41 -05:00
Viet Dinh f461d0cb7a fix compile errors
some functions were not found in namespace std
2015-11-03 15:37:25 -05:00
Viet Dinh 09b0193186 even more correct
calculates cube root of complex number to give more correct results.
2015-11-03 15:17:49 -05:00
Lorena García 252feb4774 Hit and Miss morphological op 2015-11-03 19:42:22 +01:00
Viet Dinh 537a978dcf update test_math.cpp 2015-11-03 12:52:49 -05:00
Vadim Pisarevsky 33dc41056f Merge pull request #5392 from elenash:fisheye_fix 2015-11-03 10:57:36 +00:00
Viet Dinh b6e8a47fca fix whitespace errors 2015-11-02 09:28:37 -05:00
Viet Dinh ed0065266e update fixing bug #5599 2015-11-02 08:38:05 -05:00
Vadim Pisarevsky c21ed69731 Merge pull request #5586 from mshabunin:run-py-changes-2.4 2015-11-02 12:05:00 +00:00
Viet Dinh 03e7b71707 fix whitespace errors 2015-11-02 00:50:05 -05:00
Viet Dinh e06c696b3c fix whitespace errors 2015-11-02 00:20:13 -05:00
Viet Dinh 40ce9f97d6 fix whitespace errors 2015-11-02 00:04:51 -05:00
Viet Dinh 0bc44376a5 fix bug #5599
solves equations more correctly, eliminates “nan” error.
2015-11-01 23:30:28 -05:00
Viet Dinh fdf549b921 fix bug #5599 2015-11-01 11:08:01 -05:00
Maksim Shabunin 021ff0efa6 Merge pull request #5575 from mshabunin:fix-vs2015-2.4 2015-10-30 13:47:18 +00:00
Maksim Shabunin 1e869c5e49 ts: refactor run.py script
Conflicts:
	modules/ts/misc/run.py
2015-10-29 13:04:05 +03:00
Maksim Shabunin f49936a849 Fixed cmake and build issues when using Visual Studio 2015 2015-10-29 11:50:48 +03:00
Alexander Alekhin 4552ca98c4 Merge pull request #5574 from ilya-lavrenov:image-sequence-videocapture 2015-10-27 15:41:59 +00:00
Ilya Lavrenov 9e2395e7e0 return false in grabFrame failed in open method 2015-10-27 16:56:31 +03:00
Ilya Lavrenov 05945bf00e fixed case when grabbing failed 2015-10-27 16:26:24 +03:00
Ilya Lavrenov 9d78a1ea9f allow to retrieve videocapture properties before first frame reading 2015-10-26 14:37:38 +03:00
Alexander Smorkalov 8e40becab1 Debian packages with legacy C headers added to list of conflicts, relpaces, etc.
(cherry picked from commit e245aed6bb)
2015-10-26 10:56:34 +03:00
Alexander Alekhin 60eda6f25c export simple libs from OPENCV_LINKER_LIBS (fix #5541)
(cherry picked from commit 937a096bf1)
2015-10-26 10:55:38 +03:00
Alexander Smorkalov 2e78a3e5e9 Fixed samples build with nonfree.
(cherry picked from commit 341e7b3be2)
2015-10-26 10:55:24 +03:00
Alexander Smorkalov 966d35a9fb Made samples build independent from nonfree module.
(cherry picked from commit bba8c0beac)
2015-10-26 10:55:14 +03:00
Alexander Smorkalov 42447a7610 Set of lintain warning fixes for -samples debian package.
(cherry picked from commit ff00220302)
2015-10-26 10:55:00 +03:00
Aaron Simmons ca50969c2b brining over fix in master (#4140) for libz import on 64-bit android
(cherry picked from commit 55a9fdf051)
2015-10-26 10:54:44 +03:00
a-andre 2d3e170370 install opencv2/highgui.hpp header
(cherry picked from commit d16fb30512)
2015-10-26 10:54:29 +03:00
Alexander Smorkalov 8a37fc8223 Added missing copyright headers.
(cherry picked from commit 408107ce6d)
2015-10-26 10:53:52 +03:00
Alexander Smorkalov a5c20f8592 Debian formatted copyright file added to all debian packages.
(cherry picked from commit 9d24b3c3b0)
2015-10-26 10:53:38 +03:00
Ilya Lavrenov 96a2edb375 delete video readers
(cherry picked from commit 0d5b739d35)
2015-10-26 10:53:23 +03:00
Ilya Lavrenov 15b313ce4b fixed memory leak in findHomography tests
(cherry picked from commit ec5244a73a)
2015-10-26 10:52:57 +03:00
Alexander Smorkalov 1ea6568951 Fixed wrong-name-for-changelog-of-native-package warning for deb packages.
(cherry picked from commit cb1dc7cb6e)
2015-10-26 10:51:22 +03:00
Ilya Lavrenov 56654ae360 added some property setting and getting
(cherry picked from commit 75fcedf0ed)
2015-10-26 10:50:00 +03:00
Ilya Lavrenov 9a3e53e738 repaired GStreamer 0.10 version
(cherry picked from commit c19ed39a78)
2015-10-26 10:49:43 +03:00
Ilya Lavrenov 2243bfa181 repaired gstreamer camera capture:
1. Enabled property retrieval: height, width, FPS
2. Fixed issue when isOpened returns always true even for non-existing devices
3. Ability to work with non-0 device. Camera capture index is taken into account

(cherry picked from commit dbd7912b88)
2015-10-26 10:49:32 +03:00
robertxwu 33cd7f38a8 re-submit
(cherry picked from commit 4a68cc1675)
2015-10-26 10:49:02 +03:00
Hajo Nils Krabbenhöft 2fc0ce5c24 buffer_size should be in bytes, not bits
(cherry picked from commit 7825cbeb7d)
2015-10-26 10:46:33 +03:00
Hajo Nils Krabbenhöft c5d009d6c4 fix crash for large BW tif images
(cherry picked from commit d38fee7599)
2015-10-26 10:46:23 +03:00
Roman Donchenko 7d28541bbe test2.py: fail if a downloaded image can't be decoded
(cherry picked from commit 56f17e4921)
2015-10-26 10:45:22 +03:00
Alexander Alekhin 95d6002f16 Merge pull request #5568 from asmorkalov:as/legacy_c_deb_pack_dep 2015-10-23 15:37:26 +00:00
Alexander Smorkalov e245aed6bb Debian packages with legacy C headers added to list of conflicts, relpaces, etc. 2015-10-23 16:09:04 +03:00
Maksim Shabunin 497d92e7d1 Merge pull request #5533 from sturkmen72:patch-12 2015-10-22 12:30:38 +00:00
Maksim Shabunin 1cb0dfa669 Merge pull request #5500 from StevenPuttemans:fix_mask_notice_copyTo_2.4 2015-10-22 12:28:54 +00:00
Alexander Alekhin 4dc2313527 Merge pull request #5552 from hyunkim9123:camshift-2.4 2015-10-21 06:13:38 +00:00
Alexander Alekhin 938d42a89f Merge pull request #5545 from alalek:fix_linker_libs 2015-10-19 15:29:02 +00:00
Alexander Alekhin 937a096bf1 export simple libs from OPENCV_LINKER_LIBS (fix #5541) 2015-10-19 13:49:41 +03:00
paul.kim 78a566611d Fix the issue in mouse click event 2015-10-17 10:42:48 +09:00
Suleyman TURKMEN 73240b736b Update camera_calibration_and_3d_reconstruction.rst 2015-10-16 22:30:00 +03:00
Alexander Smorkalov bf41e791ff Merge pull request #5514 from asmorkalov:as/nonfree-independent-samples 2015-10-15 10:56:23 +00:00
Alexander Smorkalov bac151675a Merge pull request #5501 from asmorkalov:as/samples_lintian_fixes 2015-10-15 10:52:46 +00:00
Alexander Smorkalov 341e7b3be2 Fixed samples build with nonfree. 2015-10-14 16:19:37 +03:00
Alexander Alekhin 98c26d95e5 Merge pull request #5511 from paleozogt:android-64-bit 2015-10-14 11:35:05 +00:00
Alexander Smorkalov bba8c0beac Made samples build independent from nonfree module. 2015-10-14 12:56:58 +03:00
Alexander Alekhin bd34f6dd98 Merge pull request #5505 from a-andre:highguiheader 2015-10-14 09:11:21 +00:00
Aaron Simmons 55a9fdf051 brining over fix in master (#4140) for libz import on 64-bit android 2015-10-13 17:42:40 -06:00
a-andre d16fb30512 install opencv2/highgui.hpp header 2015-10-13 18:16:14 +02:00
Alexander Alekhin 8b23d1ec64 Merge pull request #5498 from asmorkalov:as/copyright_headers 2015-10-13 14:22:57 +00:00
Alexander Smorkalov ff00220302 Set of lintain warning fixes for -samples debian package. 2015-10-13 16:32:53 +03:00
StevenPuttemans 8ed25ad75f adding extra explanation for mask parameter 2015-10-13 15:21:35 +02:00
Alexander Smorkalov 408107ce6d Added missing copyright headers. 2015-10-13 15:02:38 +03:00
Alexander Alekhin 3558da9ab7 Merge pull request #5494 from asmorkalov:as/deb_copyright 2015-10-13 08:54:20 +00:00
Alexander Smorkalov 9d24b3c3b0 Debian formatted copyright file added to all debian packages. 2015-10-13 09:09:07 +03:00
Alexander Alekhin 779dad12fb Merge pull request #5491 from ilya-lavrenov:video-writers-delete 2015-10-12 10:48:16 +00:00
Alexander Alekhin 297a92cd94 Merge pull request #5490 from ilya-lavrenov:mem-leak-calib3d 2015-10-12 10:47:50 +00:00
Ilya Lavrenov 0d5b739d35 delete video readers 2015-10-12 00:40:23 +03:00
Ilya Lavrenov ec5244a73a fixed memory leak in findHomography tests 2015-10-12 00:11:45 +03:00
Alexander Alekhin 454e5e5fa4 Merge pull request #5461 from berak:fix_putText_24 2015-10-06 17:12:25 +00:00
berak bb9bd3132a fix zero length std::string in putText() 2015-10-06 18:31:00 +02:00
Elena Shipunova e539a9632d Fix in fisheye calibrate function: #5389 2015-10-01 19:03:26 +03:00
StevenPuttemans 406cfc48c9 adding markers to OpenCV for 2.4 branch 2015-10-01 16:08:25 +02:00
Alexander Alekhin 59082c8ee8 Merge pull request #5398 from asmorkalov:as/wrong-name-for-changelog-of-native-package 2015-09-28 13:41:46 +00:00
Alexander Smorkalov cb1dc7cb6e Fixed wrong-name-for-changelog-of-native-package warning for deb packages. 2015-09-28 12:30:26 +03:00
Alexander Alekhin 58a11ac079 Merge pull request #5403 from sturkmen72:patch-9 2015-09-25 12:08:13 +00:00
Suleyman TURKMEN 69d84c8f3e Update how_to_scan_images.cpp 2015-09-25 14:32:58 +03:00
Maksim Shabunin 79ab6567ee Merge pull request #5395 from enesates:patch-2 2015-09-25 07:35:14 +00:00
Alexander Alekhin 60a689d27c Merge pull request #5202 from ilya-lavrenov:gstreamer-v4l2 2015-09-24 14:46:23 +00:00
Enes Ateş 5df2713b16 XML file path correction
in documentation exact path is images/CameraCalibration/VID5

see also PR #5393
2015-09-24 10:34:42 +02:00
Alexander Alekhin 134a3f165d Merge pull request #5381 from robertxwu:Bugfix_for_issue_#_of_5145 2015-09-23 09:58:24 +00:00
robertxwu 4a68cc1675 re-submit 2015-09-21 13:57:25 -07:00
Vadim Pisarevsky f838a832b2 Merge pull request #5357 from fxtentacle:ha-2.4.11 2015-09-21 14:31:13 +00:00
Vadim Pisarevsky 6f2fb383e6 Merge pull request #5359 from StevenPuttemans:contributing_guidelines_2.4 2015-09-21 11:53:06 +00:00
Alexander Alekhin e1b0d341e4 Merge pull request #5360 from SpecLad:test2-fail-on-failed-download 2015-09-18 12:10:52 +00:00
Roman Donchenko 08ad3b500b test2.py: switch from urllib to urllib2
urllib2 raises an exception if an HTTP request produces an error code,
making the test fail earlier.
2015-09-17 18:24:30 +03:00
Roman Donchenko 56f17e4921 test2.py: fail if a downloaded image can't be decoded 2015-09-17 18:17:06 +03:00
Roman Donchenko 293ea03dcc test2.py: remove unused imports 2015-09-17 18:14:49 +03:00
StevenPuttemans bef1b5322e add link to contributing guidelines 2015-09-17 14:14:21 +02:00
Alexander Smorkalov e6f3f3c029 OpenCV version++. 2015-09-17 14:02:36 +03:00
Ilya Lavrenov 7746d9b7cc fix for corrent modules dependencies
(cherry picked from commit 1c3d83df54)
2015-09-17 13:45:08 +03:00
Vladislav Vinogradov 3494d640df add extra checks to data_step_down to prevent out-of-border access
(cherry picked from commit 3ef067cc65)
2015-09-17 13:44:56 +03:00
Vladislav Vinogradov c22cc67ba8 revert previous change in gpu::StereoBeliefPropogation
(cherry picked from commit f903192c17)
2015-09-17 13:44:33 +03:00
Vladislav Vinogradov 558054a53d fix for gpu::StereoBeliefPropogation:
use continuous memory for internal buffers

(cherry picked from commit e2a9df408f)
2015-09-17 13:44:17 +03:00
Elena Shipunova c7b471f10f do not proceed with removing zero-length slice
(cherry picked from commit 036c3b4e6d)
2015-09-17 13:43:54 +03:00
Ilya Lavrenov f4ffcae8d9 initialize padding of CvString with zeros
(cherry picked from commit 7b1eb3af7b)
2015-09-17 13:43:37 +03:00
Ilya Lavrenov 0422054aa1 fixed warnings in gpu module
(cherry picked from commit 6a05939e1c)
2015-09-17 13:41:51 +03:00
Ilya Lavrenov a81f0a5123 fixed uninitialized memory writing/reading in flann
(cherry picked from commit 3934d61de7)
2015-09-17 13:41:31 +03:00
Ilya Lavrenov c36582d2df fixed memory leak in flann index
(cherry picked from commit 32d7c1950a)
2015-09-17 13:41:16 +03:00
Ilya Lavrenov d50c07e303 fixed "Conditional jump or move depends on uninitialised value(s)" in GBD
(cherry picked from commit 887736bcd4)
2015-09-17 13:41:03 +03:00
Ilya Lavrenov 54693b3fa7 fixed memory leak in GBTrees
(cherry picked from commit 1b8c2589c0)
2015-09-17 13:40:50 +03:00
Ilya Lavrenov 3c3bc123fc release filestorage before exception
(cherry picked from commit 3a1bb93340)
2015-09-17 13:40:36 +03:00
Ilya Lavrenov ac33cd688c fixed memory leak in ANN
(cherry picked from commit dfb49097e3)
2015-09-17 13:40:14 +03:00
Ilya Lavrenov b5e42d8cc1 fixed memory leak in ml module
(cherry picked from commit d7bb1025f3)
2015-09-17 13:40:02 +03:00
Ilya Lavrenov 7e4e8921bc fixed memory leak in descriptor regression tests 2015-09-17 13:39:44 +03:00
Ilya Lavrenov 6dcd455ac4 fixed memory leaks in modules/features2d/test/test_nearestneighbors.cpp 2015-09-17 13:39:34 +03:00
Vladislav Vinogradov 1d58e1a14a fix potential out-of-border access in gpu StereoBeliefPropagation 2015-09-17 13:39:17 +03:00
Roman Donchenko d122510c4f Only conflict with packages corresponding to modules that are built 2015-09-17 13:39:03 +03:00
Roman Donchenko 6613d14261 Add missing packages to the Debian conflict list
And refactor the code to make sure that the dev and runtime package lists are
in sync.
2015-09-17 13:38:52 +03:00
a-andre a14e524b32 fix documentation builder warnings 2015-09-17 13:38:25 +03:00
a-andre 226ff93917 install new headers like "opencv2/core.hpp" 2015-09-17 13:38:11 +03:00
Ilya Lavrenov d28e6c9b36 fixed memory leak caused by illegal memory access
(cherry picked from commit 4722b2d0e5)
2015-09-17 13:37:52 +03:00
Ilya Lavrenov c16f465ff5 fixed "Conditional jump or move depends on uninitialised value" warning
(cherry picked from commit f100cdb6d4)
2015-09-17 13:37:38 +03:00
Roman Donchenko 3231c2f995 NearestNeighborTest: use ts->get_rng() instead of (implicit) theRNG()
This ensures that test data is not dependent on the order the tests are
executed in.

(cherry picked from commit 1245cd1752)
2015-09-17 13:37:26 +03:00
Ilya Lavrenov 16bcc30e42 typo
(cherry picked from commit 793bdaada7)
2015-09-17 13:37:12 +03:00
Ilya Lavrenov 69c50e0181 fixed typo
(cherry picked from commit 370d1ff21a)
2015-09-17 13:37:02 +03:00
Ilya Lavrenov 486c40f578 fixed uninitialized values warning in bad arg test class
(cherry picked from commit 47cee8715b)
2015-09-17 13:36:51 +03:00
Ilya Lavrenov 08e38e9ff9 fixed memory leaks in warpAffine tests
(cherry picked from commit b70e27e076)
2015-09-17 13:36:35 +03:00
Ilya Lavrenov ba3b902da7 fixed memory leaks in floodfill tests
(cherry picked from commit d1b882ddcf)
2015-09-17 13:36:24 +03:00
Ilya Lavrenov bf94e6a91c fixed memory leaks in cvtyuv tests
(cherry picked from commit b2489d31d6)
2015-09-17 13:36:14 +03:00
Ilya Lavrenov ecc53dd7a4 fixed memory leak in core ds tests
(cherry picked from commit 7719da9552)
2015-09-17 13:35:51 +03:00
Ilya Lavrenov fc0e0239b8 fixed valgrind warning in polylines
(cherry picked from commit 855765986e)
2015-09-17 13:35:25 +03:00
Hajo Nils Krabbenhöft 7825cbeb7d buffer_size should be in bytes, not bits 2015-09-16 22:19:51 +02:00
Hajo Nils Krabbenhöft d38fee7599 fix crash for large BW tif images 2015-09-16 22:04:42 +02:00
Vadim Pisarevsky fb4b4cbf58 Merge pull request #5334 from UnaNancyOwen:fix2_LineAA 2015-09-14 11:49:48 +00:00
Tsukasa Sugiura b23e536894 Fix LineAA in case of 4 channel
Fix bug when enter 4 channel image to LineAA function.
2015-09-12 01:48:28 +09:00
Alexander Alekhin 8b33c6fa8f Merge pull request #5290 from ilya-lavrenov:cmake_bug 2015-09-11 09:49:42 +00:00
Ilya Lavrenov 1c3d83df54 fix for corrent modules dependencies 2015-09-11 11:30:10 +03:00
Alexander Alekhin b29cde552a Merge pull request #5325 from jet47:gpu-stereobp-fix 2015-09-10 14:40:05 +00:00
Vladislav Vinogradov 3ef067cc65 add extra checks to data_step_down to prevent out-of-border access 2015-09-10 10:05:25 +03:00
Vladislav Vinogradov f903192c17 revert previous change in gpu::StereoBeliefPropogation 2015-09-10 10:05:04 +03:00
Vladislav Vinogradov e2a9df408f fix for gpu::StereoBeliefPropogation:
use continuous memory for internal buffers
2015-09-10 09:55:46 +03:00
Vadim Pisarevsky cba401fe53 Merge pull request #5313 from sturkmen72:patch-5 2015-09-09 10:39:25 +00:00
Vadim Pisarevsky f3af90c6c7 Merge pull request #5315 from elenash:core_remove_slice 2015-09-09 10:25:45 +00:00
Elena Shipunova 036c3b4e6d do not proceed with removing zero-length slice 2015-09-07 13:50:30 +03:00
Suleyman TURKMEN 9df5400200 Update drawing.cpp
https://github.com/Itseez/opencv/issues/4791
2015-09-07 11:33:29 +03:00
Alexander Alekhin 6fefc53e56 Merge pull request #5299 from ilya-lavrenov:core_hog 2015-09-04 14:30:17 +00:00
Alexander Alekhin 76235cbb70 Merge pull request #5300 from ilya-lavrenov:cuda_warnings 2015-09-04 10:21:44 +00:00
Alexander Alekhin 9d006f6a1d Merge pull request #5297 from ilya-lavrenov:flann 2015-09-04 10:21:00 +00:00
Ilya Lavrenov 6a05939e1c fixed warnings in gpu module 2015-09-03 19:13:00 +03:00
Ilya Lavrenov 7b1eb3af7b initialize padding of CvString with zeros 2015-09-03 18:33:15 +03:00
Ilya Lavrenov 3934d61de7 fixed uninitialized memory writing/reading in flann 2015-09-03 13:25:29 +03:00
Alexander Alekhin a98ee0d3b2 Merge pull request #5289 from ilya-lavrenov:flann 2015-09-02 11:41:03 +00:00
Alexander Alekhin 73a8e65cbd Merge pull request #5285 from ilya-lavrenov:ml5 2015-09-02 11:39:07 +00:00
Alexander Alekhin ae0d428b62 Merge pull request #5281 from ilya-lavrenov:ml2 2015-09-02 11:38:45 +00:00
Ilya Lavrenov 32d7c1950a fixed memory leak in flann index 2015-09-01 16:58:35 +03:00
Vadim Pisarevsky 5603617b7c Merge pull request #5284 from ilya-lavrenov:ml4 2015-09-01 12:31:46 +00:00
Vadim Pisarevsky 43aae3fee8 Merge pull request #5283 from ilya-lavrenov:ml3 2015-09-01 12:31:05 +00:00
Vadim Pisarevsky a7a4a2ae30 Merge pull request #5280 from ilya-lavrenov:ml 2015-09-01 12:30:36 +00:00
Ilya Lavrenov 1b8c2589c0 fixed memory leak in GBTrees 2015-09-01 14:38:11 +03:00
Ilya Lavrenov 887736bcd4 fixed "Conditional jump or move depends on uninitialised value(s)" in GBD 2015-09-01 13:22:49 +03:00
Alexander Alekhin 5b1967f80c Merge pull request #5274 from ilya-lavrenov:features2d 2015-09-01 10:14:29 +00:00
Ilya Lavrenov 3a1bb93340 release filestorage before exception 2015-09-01 13:04:33 +03:00
Ilya Lavrenov dfb49097e3 fixed memory leak in ANN 2015-09-01 12:29:52 +03:00
Ilya Lavrenov d7bb1025f3 fixed memory leak in ml module 2015-09-01 11:26:25 +03:00
Ilya Lavrenov dc441f50cd fixed memory leak in descriptor regression tests 2015-08-31 17:30:42 +03:00
Ilya Lavrenov be499b42d9 fixed memory leaks in modules/features2d/test/test_nearestneighbors.cpp 2015-08-31 17:21:55 +03:00
Alexander Alekhin 74f5eaf70c Merge pull request #5262 from jet47:gpu-stereobp-fix 2015-08-28 10:05:19 +00:00
Vladislav Vinogradov 7ddc0bdd37 fix potential out-of-border access in gpu StereoBeliefPropagation 2015-08-27 16:09:37 +03:00
Alexander Alekhin 94cf5430d0 Merge pull request #5250 from SpecLad:missing-conflicts 2015-08-26 16:39:13 +00:00
Roman Donchenko 4ab2771957 Only conflict with packages corresponding to modules that are built 2015-08-26 13:42:21 +03:00
Roman Donchenko bef2b27155 Add missing packages to the Debian conflict list
And refactor the code to make sure that the dev and runtime package lists are
in sync.
2015-08-25 18:50:06 +03:00
Vadim Pisarevsky 702afcd760 Merge pull request #5143 from alankarkotwal:2.4 2015-08-24 11:06:30 +00:00
Maksim Shabunin 9734abdc1a Merge pull request #5114 from a-andre:missingHeader 2015-08-20 15:45:52 +00:00
Alexander Alekhin 3b97549bb1 Merge pull request #5226 from ilya-lavrenov:valgrind_memory_leak 2015-08-20 13:14:29 +00:00
Alexander Alekhin fc0b997064 Merge pull request #5223 from ilya-lavrenov:warpaffine_valgrind 2015-08-20 12:36:24 +00:00
Ilya Lavrenov 4722b2d0e5 fixed memory leak caused by illegal memory access 2015-08-20 13:28:10 +03:00
Ilya Lavrenov f100cdb6d4 fixed "Conditional jump or move depends on uninitialised value" warning 2015-08-20 12:20:38 +03:00
Alexander Alekhin a00b37d209 Merge pull request #5094 from SpecLad:f2d-ts-rng 2015-08-19 00:45:04 +00:00
a-andre b757359ff8 fix documentation builder warnings 2015-08-18 18:48:32 +02:00
Alexander Alekhin 3172e6d54b Merge pull request #5203 from ilya-lavrenov:valgrind_error 2015-08-17 17:18:07 +00:00
Ilya Lavrenov 75fcedf0ed added some property setting and getting 2015-08-16 21:25:36 +03:00
Ilya Lavrenov c19ed39a78 repaired GStreamer 0.10 version 2015-08-16 21:01:22 +03:00
Ilya Lavrenov 793bdaada7 typo 2015-08-16 11:46:48 +03:00
Ilya Lavrenov dbd7912b88 repaired gstreamer camera capture:
1. Enabled property retrieval: height, width, FPS
2. Fixed issue when isOpened returns always true even for non-existing devices
3. Ability to work with non-0 device. Camera capture index is taken into account
2015-08-16 11:16:25 +03:00
Ilya Lavrenov 370d1ff21a fixed typo 2015-08-15 16:25:25 +03:00
Ilya Lavrenov 47cee8715b fixed uninitialized values warning in bad arg test class 2015-08-15 14:30:27 +03:00
Ilya Lavrenov b70e27e076 fixed memory leaks in warpAffine tests 2015-08-15 10:11:52 +03:00
Ilya Lavrenov d1b882ddcf fixed memory leaks in floodfill tests 2015-08-15 10:09:31 +03:00
Ilya Lavrenov b2489d31d6 fixed memory leaks in cvtyuv tests 2015-08-15 10:06:09 +03:00
Ilya Lavrenov 7719da9552 fixed memory leak in core ds tests 2015-08-15 09:53:30 +03:00
Alexander Alekhin 8d264d9f64 Merge pull request #5193 from ilya-lavrenov:valgrind_error 2015-08-14 15:32:16 +00:00
Ilya Lavrenov 855765986e fixed valgrind warning in polylines 2015-08-14 17:57:54 +03:00
Alexander Smorkalov d0210f510e OpenCV version++. 2015-08-14 16:43:10 +03:00
Maksim Shabunin 34aa4e4578 Merge pull request #5151 from mshabunin:fix-training-data-corruption 2015-08-12 14:40:51 +00:00
Maksim Shabunin 447b8bf58a Fixing possible corruption for big training data sizes 2015-08-10 12:36:27 +03:00
Alexander Alekhin e9539061db Merge pull request #5124 from StevenPuttemans:fix_annotation_tool_2.4 2015-08-08 16:51:51 +00:00
Alankar Kotwal 98078c231e Merge pull request #1 from alankarkotwal/bugfix
Correct missing braces in operations_in_arrays.rst
2015-08-06 22:15:04 +05:30
Alankar Kotwal 1d92a73a55 Correct missing braces in operations_in_arrays.rst 2015-08-06 22:09:23 +05:30
StevenPuttemans ba7bf1ef68 add checks on input parameters for valid path and folder
opening a folder is system specific - made system specific code
added license
2015-08-06 10:23:41 +02:00
Alexander Alekhin 5a53f41622 Merge branch '2.4.10.x-prep' into 2.4 2015-08-05 16:20:12 +03:00
Alexander Alekhin 80844fd554 Merge pull request #5096 from terfendail:2.4 2015-08-03 12:46:45 +00:00
a-andre 5262371660 install new headers like "opencv2/core.hpp" 2015-08-02 13:13:58 +02:00
Vitaly Tuzov a96a6bf149 Resize area result verification moved to the separate function 2015-07-31 15:01:33 +03:00
Vitaly Tuzov b7c9aaa471 Added more resize_area tests to ensure right rounding behavior for half and quarter downscaling 2015-07-30 18:48:06 +03:00
Roman Donchenko 1245cd1752 NearestNeighborTest: use ts->get_rng() instead of (implicit) theRNG()
This ensures that test data is not dependent on the order the tests are
executed in.
2015-07-30 18:03:48 +03:00
Alexander Smorkalov 1f5fd865aa Merge pull request #5092 from etalanin:update-branch-to-2-4-12 2015-07-29 18:57:02 +00:00
Evgeny Talanin 9a3dccab20 Increase Android Manager version 2015-07-29 21:16:21 +03:00
Evgeny Talanin ac6ca660f4 Increase version to 2.4.12 2015-07-29 20:34:47 +03:00
Alexander Alekhin 6f47c26acf Merge pull request #5091 from jet47:gpu-sanity-epsilon 2015-07-29 16:29:37 +00:00
Vladislav Vinogradov 945663bc9b increase epsilon for some GPU sanity tests 2015-07-29 18:57:14 +03:00
Alexander Alekhin 0263b49298 Merge pull request #5090 from SpecLad:autotune-crash 2015-07-29 15:47:20 +00:00
Roman Donchenko c2f59a0f73 flann: fix AutotunedIndex crashing if a KDTree index is selected
Backport of mariusmuja/flann@f8ca6df3.
2015-07-29 18:03:48 +03:00
Maksim Shabunin 9eda260495 Merge pull request #4211 from alalek:fix_python_2_4 2015-07-24 13:33:51 +00:00
Maksim Shabunin 3ed54b9008 Merge pull request #4220 from alalek:fix_gcc_warnings_2_4 2015-07-24 13:09:44 +00:00
Alexander Alekhin 6b954cd24e Merge pull request #4219 from SpecLad:freak-missing-init 2015-07-22 12:52:36 +00:00
Alexander Alekhin 42ba5c7d16 fix GCC 4.9 warnings 2015-07-22 14:17:54 +03:00
Roman Donchenko 72ddeea479 FREAK: add missing field initialization 2015-07-22 14:06:39 +03:00
Vadim Pisarevsky 869dda4117 Merge pull request #4204 from gladilov-gleb:minMaxLocBugFix 2015-07-22 10:52:16 +00:00
Gleb Gladilov 07de67c32f Added test of minMaxLoc on filling with maximums of int 2015-07-22 11:43:35 +03:00
Gleb Gladilov c467d0d553 Fixed minMaxLoc and test functions 2015-07-21 17:17:23 +03:00
Alexander Alekhin 0906744788 fix python cross-compilation 2015-07-21 12:41:57 +03:00
Alexander Smorkalov 67158b12cd Merge pull request #4191 from SpecLad:irc-workaround 2015-07-16 08:17:45 +00:00
Roman Donchenko 9e50cf5375 Refactor a section of icvRotatingCalipers to work around a GCC bug
https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1474304
2015-07-14 13:26:47 +03:00
Alexander Alekhin 4bf82e50d0 Merge pull request #4187 from SpecLad:chessboard-png 2015-07-13 15:52:46 +00:00
Roman Donchenko 2e86d46cf2 CV_ChessboardDetectorTimingTest: don't ignore missing test data 2015-07-09 17:32:08 +03:00
Vadim Pisarevsky 707d10f115 Merge pull request #4137 from asmorkalov:as/ros_conflict 2015-06-22 11:52:05 +00:00
Alexander Alekhin 83a4ad5f51 Merge branch '2.4.9.x-prep' into 2.4 2015-06-19 14:55:38 +03:00
Alexander Alekhin e7b82a8561 Merge branch '2.4.8.x-prep' into 2.4 2015-06-19 14:54:18 +03:00
Alexander Smorkalov 546e68dc65 Merge pull request #4034 from jet47:opencv_run_all_tests_unix 2015-06-17 08:19:47 +00:00
Vadim Pisarevsky b7c2a46830 Merge pull request #4107 from SpecLad:libav-compat 2015-06-16 13:22:40 +00:00
Vadim Pisarevsky 719099ad6d Merge pull request #4104 from SpecLad:arm64-packaging 2015-06-16 13:19:11 +00:00
Vadim Pisarevsky 2e9004813e Merge pull request #4088 from howtobeahacker:2.4 2015-06-16 12:31:13 +00:00
Vincent Rabaud 50842b9036 get code to compile on Ubuntu Saucy
A define was forgotten for the codecs and there was a typo for
another.

(cherry picked from commit f052b0bc4d)

Conflicts:
	modules/videoio/src/ffmpeg_codecs.hpp
2015-06-09 15:53:08 +03:00
Vadim Pisarevsky 3d6413cfc6 fixed compile warnings; hopefully fixed test failures
(cherry picked from commit 30912b49f3)

Conflicts:
	modules/videoio/src/cap_ffmpeg_impl.hpp
	modules/videoio/src/ffmpeg_codecs.hpp
2015-06-09 15:53:08 +03:00
Vadim Pisarevsky 799622affd make sure opencv builds fine with the recent versions of libav (e.g. from Ubuntu 14.10)
(cherry picked from commit 2b2e3ee93c)

Conflicts:
	cmake/OpenCVFindLibsVideo.cmake
	modules/videoio/src/cap.cpp
	modules/videoio/src/cap_ffmpeg_impl.hpp
	modules/videoio/src/ffmpeg_codecs.hpp
	modules/videoio/test/test_ffmpeg.cpp
2015-06-09 15:53:08 +03:00
Alexander Smorkalov 57ab0d4d17 Debian packages header update to fix conflict with OpenCV from deb repo. 2015-06-09 14:59:12 +03:00
Roman Donchenko 02f8b85dd9 Add ARM64 packaging support 2015-06-08 18:03:08 +03:00
Roman Donchenko 1fbdca0c9b Set CPACK_DEBIAN_PACKAGE_ARCHITECTURE instead of CPACK_DEBIAN_ARCHITECTURE
Because that's the variable actually used by CPack.
2015-06-08 18:03:07 +03:00
howtobeahacker 9eaac6105f correct covariation matrix formula in Harris corner detector 2015-06-03 17:33:40 +08:00
Vadim Pisarevsky 83ace8d580 Merge pull request #4085 from berak:patch-3 2015-06-03 07:25:17 +00:00
berak 851ce27240 http://code.opencv.org/issues/4359 2.4 branch 2015-06-03 07:48:29 +02:00
Vadim Pisarevsky 70f8d807c8 Merge pull request #4003 from uwinsoftware:2.4 2015-05-29 18:55:55 +00:00
Vadim Pisarevsky daa21a4385 Merge pull request #4057 from apavlenko:24_java_memory_release 2015-05-28 14:59:46 +00:00
Vadim Pisarevsky 13cef0cdfc Merge pull request #4061 from ilya-lavrenov:android 2015-05-26 17:24:05 +00:00
Ilya Lavrenov 083aced3b4 fixed OS names 2015-05-26 17:41:23 +03:00
Andrey Pavlenko 72ec9c159e releasing native memory of temp Mat objects in generated Java code 2015-05-26 13:58:54 +03:00
Andrey Pavlenko 5b00d9da49 releasing native memory in Java converters 2015-05-26 13:58:35 +03:00
Vadim Pisarevsky 74bb0beeb0 Merge pull request #4008 from cr333:triangulation_fix_2.4 2015-05-23 10:18:08 +00:00
Vadim Pisarevsky 08714c510f Merge pull request #4042 from ilya-lavrenov:android_mk 2015-05-21 13:17:46 +00:00
Vadim Pisarevsky acfbed8654 Merge pull request #4037 from Lectem:patch-1 2015-05-21 12:33:42 +00:00
Vadim Pisarevsky 6212084046 Merge pull request #4041 from ilya-lavrenov:warning_fix 2015-05-21 12:24:46 +00:00
Ilya Lavrenov d89b6226a3 fixed Android mk generation for arm64-v8a 2015-05-21 15:00:46 +03:00
Ilya Lavrenov 11d1909e6b fixed warning 2015-05-21 11:49:06 +03:00
Lectem 3c6fe75149 fix mutex for uclibc
The uClibc doesn't have pthread_spin_* implemented on their 'old' linux threads.
Since it is on linux, we have to check if uclibc is using this implementation or not.
2015-05-20 12:18:28 +02:00
Alexander Smorkalov 00d9f690f6 Version++. 2015-05-20 11:21:28 +03:00
Vladislav Vinogradov ae79fe10dc do not loose logs from nvidia tests
(cherry picked from commit d58d277707)
2015-05-20 08:16:44 +03:00
Vladislav Vinogradov 62fc342d35 use fixed seed for RNG in gpu SolvePnPRansac test
(cherry picked from commit 95eed59f2d)
2015-05-20 08:16:22 +03:00
Vladislav Vinogradov 36924d6dbb use cv::theRNG() instead of ::rand() in gpu::solvePnPRansac
(cherry picked from commit 62bc647731)
2015-05-20 08:16:05 +03:00
Alexander Smorkalov ede4943d7e Merge pull request #4030 from asmorkalov:as/accurate_cuda_arch_aarch64 2015-05-20 05:12:43 +00:00
Alexander Smorkalov 9d148c76ca Merge pull request #4033 from jet47:gpu-tests-fix 2015-05-20 05:12:24 +00:00
Vladislav Vinogradov 21d8b588a2 exclude dates from report names 2015-05-19 18:26:13 +03:00
Vladislav Vinogradov 5d66b1130b save tests console output to separate log files 2015-05-19 18:26:13 +03:00
Vladislav Vinogradov 0550b2c1fe check that current directory has write access 2015-05-19 18:26:04 +03:00
Vladislav Vinogradov d58d277707 do not loose logs from nvidia tests 2015-05-19 17:28:43 +03:00
Vladislav Vinogradov 95eed59f2d use fixed seed for RNG in gpu SolvePnPRansac test 2015-05-19 17:27:50 +03:00
Vladislav Vinogradov 62bc647731 use cv::theRNG() instead of ::rand() in gpu::solvePnPRansac 2015-05-19 17:27:23 +03:00
Alexander Smorkalov 7f63776395 Precise default CUDA version for Tegra X1 chips. 2015-05-19 13:24:17 +03:00
Vadim Pisarevsky b9792fdc14 Merge pull request #3829 from ippei-i:2.4-flann-lsh-addable-index 2015-05-18 15:38:21 +00:00
Alexander Smorkalov 0410fe6978 Merge pull request #3785 from jet47:tiny-gpu-module 2015-05-18 08:00:12 +00:00
Christian Richardt 242e64c08d Fixed triangulation bug http://code.opencv.org/issues/4334. 2015-05-13 15:47:00 +02:00
Vadim Pisarevsky cc94b393c5 Merge pull request #3975 from StevenPuttemans:RGB_doc_fixing_2.4 2015-05-12 15:12:04 +00:00
Nguyen Nguyen 58dd70e8dc Revert support for audio 2015-05-08 12:06:03 -04:00
Nguyen Nguyen 53ff537f1c temporary fixes 2015-05-08 11:33:11 -04:00
Nguyen Nguyen a5814871d9 Adding audio to opencv 2015-05-06 17:01:38 -04:00
Vadim Pisarevsky 1aa03cecf1 Merge pull request #3981 from patrikhuber:vs2015-support 2015-05-06 15:35:36 +00:00
Vladislav Vinogradov f10537cdd6 fix tests compilation issue on Windows 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov 9d294cbcf5 fix performance tests in tiny mode 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov f1bec940b1 fix accuracy tests in tiny mode 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov dd93d48be4 turn on stereob instantiates that required for tests 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov ad3123adfd turn on some instantiates that required for other primitives 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov f939d80f4c fixed seg faults 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov ee316758ca reduce color instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov 6d7a61cbdc reduce copy_make_border instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov b44b1ab47b reduce matrix_reductions instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov 2e47a1a61b reduce pyramids instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov 72685cf01c reduce resize instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov 612888c066 reduce remap instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov e7b55f4982 reduce warp instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov 3004f5fa30 reduce stereobm instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov 9682d2afff reduce element_operations instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov 87d655325c reduce add_weighted instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov db25e44a17 reduce brute_force_matcher instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov b7a9e672c5 reduce bilateral filter instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov 8e49ab1d3b reduce filter2d instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov 00c36e88ef reduce separable filter instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov cde697dd14 introduce BUILD_TINY_GPU_MODULE CMake option
it adds OPENCV_TINY_GPU_MODULE definition, that will allow
to build tiny version of gpu module (with limited image format support)
2015-05-06 17:13:59 +03:00
Alexander Smorkalov e49e75da06 OpenCV patch verison++. 2015-05-06 16:29:51 +03:00
Vladislav Vinogradov 1d40946959 Bug #4315 : fix CUDA bitwise operations with mask
(cherry picked from commit d87c30dc84)
2015-05-06 16:27:12 +03:00
Alexander Smorkalov 2598392295 Added explicit deb package dependency from libtbb-dev if TBB is enabled.
(cherry picked from commit 63d6cc5ca6)
2015-05-06 16:26:50 +03:00
lujia 17cc5e2c40 bugfix_for_hog_detectMultiScale_with_weights
(cherry picked from commit 7ce116695d)
2015-05-06 16:24:39 +03:00
Vladislav Vinogradov 4b14400976 disable several heavy performance tests
(cherry picked from commit cbdddb473c)
2015-05-06 16:24:07 +03:00
Vladislav Vinogradov 4704a254f7 disable Video_PyrLKOpticalFlowDense performance test
sanity fails on Maxwell and CUDA 7.0 due to unknow reason
(cherry picked from commit b4c2891ef3)
2015-05-06 16:23:41 +03:00
Vladislav Vinogradov 7708e9882e use border extrapolation for central pixel in pyrDown
in case if image has odd dimension

(cherry picked from commit 1325213303)
2015-05-06 16:23:28 +03:00
Vladislav Vinogradov fe1bd0cc2f fix racecheck warning in scanRows kernel
(cherry picked from commit fb15bdfb21)
2015-05-06 16:23:09 +03:00
Vladislav Vinogradov a752f25944 increase epsilon for solvePnPRansac function
(cherry picked from commit 9d2d173485)
2015-05-06 16:22:57 +03:00
Alexander Smorkalov bb44316028 Merge pull request #3990 from jet47:cuda-bitwise-mask 2015-05-06 12:50:08 +00:00
Alexander Smorkalov 0b2cfcfda2 Merge pull request #3976 from SpecLad:rm-insertIframe 2015-05-06 12:47:59 +00:00
Alexander Smorkalov 9c02caf392 Merge pull request #3989 from asmorkalov:as/tbb_dep 2015-05-06 12:47:41 +00:00
Vladislav Vinogradov d87c30dc84 Bug #4315 : fix CUDA bitwise operations with mask 2015-05-06 13:28:08 +03:00
Alexander Smorkalov 63d6cc5ca6 Added explicit deb package dependency from libtbb-dev if TBB is enabled. 2015-05-06 13:10:39 +03:00
Nguyen Nguyen 9682430a69 Adding code to deal with audio output 2015-05-05 13:14:26 -04:00
Nguyen Nguyen b69ffe6376 Fixed memory leak when recording video in iOS 2015-05-04 16:21:25 -04:00
Nguyen Nguyen 1f72815637 Exporting videoFileString to outside world 2015-05-04 12:38:55 -04:00
Maksim Shabunin 90c3d7d361 Merge pull request #3969 from Dikay900:master_to_2_4 2015-05-04 10:13:45 +00:00
StevenPuttemans f4eebc46b2 Fixing all wrong uses of RGB channels instead of the OpenCV BGR standard 2015-05-04 09:23:15 +02:00
Patrik Huber 2b1103c1d3 Add support for VS2015
Without the fix, OpenCV will compile and silently copy the compiled libs/executables to a location not prefixed with arch/vc14, and OpenCV won't be picked up by find_package and OpenCVConfig.cmake.
2015-05-02 13:31:43 +01:00
Roman Donchenko 007a3ef8b6 Remove insertIframe.js
It hasn't been used since f82c04f. Also, the line adding the script had
an unneeded pathto call, so the script was being loaded from the wrong path
anyway.
2015-04-30 15:42:15 +03:00
Belev 83eb1d3608 Fix typo
Fixed difference in the given arguments to the ellipse function and the description after that

Fixed two more typos

Replaced unnecessary the with to

Conflicts:
	doc/tutorials/core/adding_images/adding_images.markdown
	doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown
	doc/tutorials/core/random_generator_and_text/random_generator_and_text.markdown
	modules/imgproc/include/opencv2/imgproc.hpp
2015-04-30 09:14:36 +02:00
Andrey Pavlenko 5c12c92243 Merge pull request #3961 from apavlenko:2.4_fix_polylines_empty 2015-04-28 16:22:31 +00:00
Martin Ueding 9e29762838 Add example data types for calibrateCamera call
It took me a while to figure out what was meant with

    OpenCV Error: Assertion failed (i < 0) in getMat

While searching for this error message I found [a list of error
messages](https://adventuresandwhathaveyou.wordpress.com/2014/03/14/opencv-error-messages-suck/)
which also explained what the problem was: The data type for `rvecs` was
not a simple `cv::Mat` but a `std::vector<cv::Mat>`.

After I fixed that, I got the next error message:

    OpenCV Error: Assertion failed (ni > 0 && ni == ni1) in
    collectCalibrationData, file
    /build/buildd/opencv-2.4.9+dfsg/modules/calib3d/src/calibration.cpp,
    line 3193

The problem here was that my data type for the `objectPoints` was just
`vector<Vec3f>` and not `vector<vector<Vec3f>>`.

In order to save other people the time looking for this, I added
explicit examples of the needed data types into the documentation of the
function. I had to re-read the current version a couple of times until I
can read the needed levels of `vector<>`. Having this example would have
really helped me there.

Conflicts:
	modules/calib3d/include/opencv2/calib3d.hpp
2015-04-28 17:24:37 +02:00
Vadim Pisarevsky da229cce9a Merge pull request #3946 from zjulujia:bugfix_for_hog_detectMultiScale_with_weights 2015-04-28 10:54:45 +00:00
Vadim Pisarevsky 36af97d00c Merge pull request #3959 from jet47:gpu-fixes 2015-04-28 10:49:06 +00:00
Vadim Pisarevsky d705c651f2 Merge pull request #3960 from ilya-lavrenov:aarch64_test_fixes 2015-04-28 10:48:33 +00:00
Vadim Pisarevsky 08848c56b7 Merge pull request #3965 from Dikay900:2_4_diff_to_master_2 2015-04-28 10:47:05 +00:00
Vadim Pisarevsky ebe979090e Merge pull request #3963 from Dikay900:2_4_diff_to_master 2015-04-28 10:41:42 +00:00
Pierre Moulon 901d4995e3 Fix a typo error
Fix a typo error
Conflicts:
	modules/features2d/include/opencv2/features2d.hpp
2015-04-25 15:07:17 +02:00
Adi Shavit aad95c7d8c Added call to clone() to avoid unexpected change to external data.
- Fix both stitching_detailed.cpp sample and cv::Stitcher.
2015-04-25 14:54:35 +02:00
Dikay900 d9b7b300b4 fix qt example on 2.4 with vs2010 and higher 2015-04-25 14:46:17 +02:00
Brian Park 044de4105e add input paramter checking that verifies the existance of the input files to stero_match example
remove the unnecessary header file

check input paramter by checking the image size
2015-04-25 14:46:17 +02:00
Chris Mayo 7a5aa06b9e Act on INSTALL_PYTHON_EXAMPLES
Conflicts:
	samples/CMakeLists.txt
2015-04-25 14:46:16 +02:00
Ben Hagen a21fb63c28 store user-provided data in PlaneTracker class 2015-04-25 11:22:18 +02:00
Yang Fan eaa9b78121 ENH: explicitly declared outputFilename to surpress error C2668
Conflicts:
	samples/gpu/video_writer.cpp
2015-04-25 10:58:01 +02:00
Abhijit Kundu fd4df0f67d Added suuport for finding Intel TBB for Visual Studio 2013 2015-04-25 10:23:34 +02:00
Simon Heinen 6decc2596d squashed #3729
Update android+AsyncServiceHelper.java

Update android+AsyncServiceHelper.java

changed tabs in last commit to spaces

Update android+AsyncServiceHelper.java

small formatting fixes
2015-04-24 23:02:10 +02:00
Eric Sommerlade 41b920344d added support for uncompressed parameters to tiff image format as described here: expertland.net/question/b6o3n6p9a72341db823b48nl98m91dx8n1/detail.html
Conflicts:
	modules/imgcodecs/src/grfmt_tiff.cpp
2015-04-24 22:59:08 +02:00
Ying Xiong 82668e06d4 Silence cmake 3.0+ warnings about MACOSX_RPATH 2015-04-24 22:39:49 +02:00
ttagu99 a81374c1d7 findcontour_example check image empty 2015-04-24 21:58:31 +02:00
侯骥 66fc6126d2 Update MatchTemplate_Demo.cpp 2015-04-24 21:58:31 +02:00
Jay Bosamiya 8b58b59df4 Fix typo 2015-04-24 21:58:30 +02:00
RafaRuiz f0595b8254 Update lkdemo.cpp because of memory leak
In MacOSx x64 it was getting a memory leak even without initializing points:
http://code.opencv.org/issues/4250
2015-04-24 21:58:29 +02:00
Pastafarianist 1e01441767 Fixed typo 2015-04-24 21:58:29 +02:00
Dikay900 c797746b6e use constant instead of value backported from #785 2015-04-24 21:58:28 +02:00
Dikay900 1bf4427a5c filename correction from #3217 2015-04-24 21:58:28 +02:00
Kevin Hughes ac3ec0d96d squashed #823
removed separate example for reading image sequences and modified starter_video.cpp to better explain the functionality of VideoCapture. I also added a bit more explanation in the documentation of the VideoCapture interface

Conflicts:
	modules/highgui/doc/reading_and_writing_images_and_video.rst
	samples/cpp/starter_video.cpp

starter_video.cpp changed CV WINDOW KEEPRATIO to just WINDOW KEEPTATIO to fix build error

starter_video.cpp hid local functions
2015-04-24 21:58:14 +02:00
Maximilien Cuony 5c6c537044 Fix typo in error for extrinsic parameters 2015-04-24 18:39:34 +02:00
Dikay900 f8c82fc214 update openni sample comments referring #81 2015-04-24 18:25:23 +02:00
Andrey Pavlenko 40b762bceb adding test for polylines() call with empty Point-s vector and fix for crash in this case 2015-04-24 16:40:14 +03:00
Ilya Lavrenov 89e3c508d8 fixed tests for aarch64 2015-04-24 13:56:20 +03:00
Vladislav Vinogradov cbdddb473c disable several heavy performance tests 2015-04-23 19:09:03 +03:00
Vladislav Vinogradov b4c2891ef3 disable Video_PyrLKOpticalFlowDense performance test
sanity fails on Maxwell and CUDA 7.0 due to unknow reason
2015-04-23 19:08:40 +03:00
Vladislav Vinogradov 1325213303 use border extrapolation for central pixel in pyrDown
in case if image has odd dimension
2015-04-23 17:21:42 +03:00
Vladislav Vinogradov fb15bdfb21 fix racecheck warning in scanRows kernel 2015-04-23 17:21:42 +03:00
Vladislav Vinogradov 9d2d173485 increase epsilon for solvePnPRansac function 2015-04-23 17:21:42 +03:00
Vadim Pisarevsky 26e3bcb9de Merge pull request #3956 from ilya-lavrenov:cuda_aarch64 2015-04-23 13:49:33 +00:00
Vadim Pisarevsky 960dee8ab8 Merge pull request #3953 from ilya-lavrenov:cuda_unused 2015-04-23 12:26:07 +00:00
Ilya Lavrenov 847976de4e fixed find cuda for aarch64 2015-04-23 14:49:12 +03:00
Ilya Lavrenov ceec0eb33a rmeoved unused functions 2015-04-23 12:48:50 +03:00
Vadim Pisarevsky 4840c4ae6f Merge pull request #3949 from ilya-lavrenov:clobbered_warning 2015-04-22 19:07:46 +00:00
Ilya Lavrenov 02e29fc99c suppress -Wclobbered warning 2015-04-22 16:42:03 +03:00
lujia 7ce116695d bugfix_for_hog_detectMultiScale_with_weights 2015-04-21 02:32:27 -04:00
Vadim Pisarevsky c879b1ab09 Merge pull request #3940 from sergarrido:fix-gen_pattern.py-2.4 2015-04-20 19:47:55 +00:00
Vladislav Vinogradov a984da911b increase epsilons for some sanity tests
(cherry picked from commit 6a6619ec1e)
2015-04-19 14:06:47 +03:00
Vladislav Vinogradov df55be3c3d fix BruteForceMatcher resource distribution
added launch bounds attributes for all CUDA kernels
(cherry picked from commit d22516872c)
2015-04-19 14:06:36 +03:00
Vladislav Vinogradov 55339de684 make NVIDIA tests verbose by default
(cherry picked from commit 17608f7ade)
2015-04-19 14:06:25 +03:00
Vladislav Vinogradov f08dd510fa fixed a bug in scanRows CUDA kernel (part of nppStIntegral)
uninitialized value
(cherry picked from commit 81ebe28c24)
2015-04-19 14:06:11 +03:00
Alexander Smorkalov de8d8720a2 Merge pull request #3924 from jet47:gpu-fixes 2015-04-19 11:04:55 +00:00
Vladislav Vinogradov d308ed3712 fix GPU WARP border mode in CUDA 7.0 and Maxwell architecture
(cherry picked from commit 27302c367c)
2015-04-19 14:02:54 +03:00
Vladislav Vinogradov 6d0f8aa893 fix tests for gpu HOG
initialize HOG after CUDA device switch
(cherry picked from commit c849492dfa)
2015-04-19 14:01:16 +03:00
Vladimir Kolesnikov bea98bd22a Not block PDB file in multithreaded build on Windows.
If used cl compiler, but generator is not Visual Studio e.g. Ninja,
enable FS option to prevent blocking PDB file in multithreaded build.

(cherry picked from commit 58c9135626)
2015-04-19 14:00:24 +03:00
Vladislav Vinogradov 4539607ab1 fix gpu HOG implementation:
move hog::set_up_constants from constructor to compute method

if user changed CUDA device between constructor and computation,
some variables were uninitialized
(cherry picked from commit 21bbed7baf)
2015-04-19 13:57:37 +03:00
Vladislav Vinogradov b320138dba fix GpuMat::setTo implementation
previous implementation was not thread/stream safe, since it used constant
memory

new implementation doesn't use any global objects, so it is thread/stream safe
(cherry picked from commit 4f5d30a865)
2015-04-19 13:57:23 +03:00
Vladislav Vinogradov 95ea12588e set epsilon for gpu OpticalFlowBM to 1e-6, since it uses floating point arithmetic
(cherry picked from commit c147ab1e85)
2015-04-19 13:57:03 +03:00
Roman Donchenko bcd08b5d18 Mark the libs component required
Everything else depends on it, after all.

(cherry picked from commit cf54e3b97e)
2015-04-19 13:55:35 +03:00
Roman Donchenko 19298ae3cb Add component display names
(cherry picked from commit 6d52ea8984)
2015-04-19 13:55:22 +03:00
Roman Donchenko 5e06da3050 Update the CPack variables to match the changes in asmorkalov/CMake#1
Which also happens to align the non-Debian specific variables
with the ones used by upstream CMake.

(cherry picked from commit b8c60234c3)

Conflicts:
	cmake/OpenCVPackaging.cmake
2015-04-19 13:54:32 +03:00
Roman Donchenko 17ac18a7b9 Remove useless CPACK_*_COMPONENT_INSTALL variables
They don't actually do anything. And even if they did, all components are
enabled by default, anyway.

(cherry picked from commit 49fe496914)
2015-04-19 13:42:14 +03:00
Roman Donchenko c259590b26 Fix a memory leak in CvCapture_FFMPEG::close
FFmpeg now requires that frames allocated with avcodec_alloc_frame are
freed with avcodec_free_frame.

(cherry picked from commit 77578d415f)
2015-04-19 13:41:22 +03:00
Roman Donchenko 3f3ca85103 Don't use ${CMAKE_INSTALL_PREFIX} as an install destination
Absolute destinations are not necessary, and prevent CPack from working.

(cherry picked from commit 0387f8ad56)
2015-04-19 13:39:55 +03:00
Alexander Smorkalov 05ddc16eaa Added Debian changelog to -tests package.
(cherry picked from commit a87ccb9ac0)
2015-04-19 13:39:01 +03:00
Alexander Smorkalov 2ba77614aa Debian package names replaced by lower case version to satisfy lintian.
(cherry picked from commit e6ac64008b)
2015-04-19 13:38:46 +03:00
Vladislav Vinogradov ef347aa6a4 disable gpu::matchTemplate tests
(cherry picked from commit 7bb8c50080)
2015-04-19 13:38:20 +03:00
Alexander Smorkalov b1cdb91139 Fixed samples install permissions for Debian packaging.
(cherry picked from commit cf852972d1)
2015-04-19 13:37:50 +03:00
Alexander Smorkalov a09ad35d98 opencv_testing.sh script installation is removed as run tests script does the same thing.
(cherry picked from commit 9206ec30a2)
2015-04-19 13:37:29 +03:00
Alexander Smorkalov 1b5835cd35 Added dependency from numpy to debian package with python bindings.
(cherry picked from commit be6b847675)
2015-04-19 13:37:04 +03:00
Alexander Smorkalov 9932bbad3a Added Debian changelog installation step for Debian package generation.
(cherry picked from commit ddc1b965b6)
2015-04-19 13:36:47 +03:00
Vijay Pradeep 39ac84ff04 Fixing race condition by expanding resultsMutex lock section
(cherry picked from commit 042ff210d5)
2015-04-19 13:36:17 +03:00
Vladislav Vinogradov fcbefaff86 fix tests for gpu::matchTemplate:
use ASSERT_FLOAT_EQ to compare float values, it is more robust for
large values
(cherry picked from commit d00f36ec75)
2015-04-19 13:32:24 +03:00
Roman Donchenko bf2256fb89 cvOpenFileStorage: reduce the scope of xml_buf and make sure it's freed...
... before any exceptions occur.

(cherry picked from commit 08da247a87)
2015-04-19 13:31:52 +03:00
Vladislav Vinogradov b0b2fc9e3f get rid of cuda.h usage
(cherry picked from commit eeb997261d)
2015-04-19 13:29:45 +03:00
Roman Donchenko 1ccd64e102 Fix uninitialized memory reads and memory leaks in StereoGC
(cherry picked from commit 7d8e5f623a)
2015-04-19 13:27:55 +03:00
Vicente Olivert Riera 23bf3e337a superres: Fix return value VideoFrameSource_GPU
superres module fails to compile with the following error messages:

[100%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/super_resolution.cpp.o
/opencv-2.4.10/modules/superres/src/frame_source.cpp: In function 'cv::Ptr<cv::superres::FrameSource> cv::superres::createFrameSource_Video_GPU(const string&)':
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected type-specifier before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: could not convert '(int*)operator new(4ul)' from 'int*' to 'cv::Ptr<cv::superres::FrameSource>'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected ';' before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:41: error: 'VideoFrameSource' was not declared in this scope
/opencv-2.4.10/modules/superres/src/frame_source.cpp:264:1: error: control reaches end of non-void function [-Werror=return-type]
cc1plus: some warnings being treated as errors
make[3]: *** [modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....

This is caused because the return value of the createFrameSource_Video_GPU function should be a VideoFrameSource_GPU object.
(cherry picked from commit 2e393ab833)
2015-04-19 13:25:16 +03:00
Vladislav Vinogradov 3cf265992f fix installation layout for debian packages:
Install symlinks to shared libraries as a part of development package,
not runtime package.

It is default behavior for debian packages.
(cherry picked from commit f55c1cc0fb)
2015-04-19 13:23:47 +03:00
S. Garrido a855d230ec completing and fixing gen_pattern.py for 2.4 branch 2015-04-18 22:13:22 +02:00
Vladislav Vinogradov 6a6619ec1e increase epsilons for some sanity tests 2015-04-14 10:12:56 +03:00
Alexander Alekhin 8c2bde2af4 Merge pull request #3923 from ilya-lavrenov:typo 2015-04-13 16:57:13 +00:00
Vladislav Vinogradov d22516872c fix BruteForceMatcher resource distribution
added launch bounds attributes for all CUDA kernels
2015-04-13 17:12:04 +03:00
Vladislav Vinogradov 17608f7ade make NVIDIA tests verbose by default 2015-04-13 17:11:19 +03:00
Vladislav Vinogradov 81ebe28c24 fixed a bug in scanRows CUDA kernel (part of nppStIntegral)
uninitialized value
2015-04-13 17:09:59 +03:00
Vadim Pisarevsky f7792f0be2 Merge pull request #3908 from jet47:gpu-wrap-border-mode 2015-04-07 11:44:51 +00:00
Vladislav Vinogradov 27302c367c fix GPU WARP border mode in CUDA 7.0 and Maxwell architecture 2015-04-07 13:04:31 +03:00
Vadim Pisarevsky a153948a19 Merge pull request #3898 from greensea:2.4 2015-04-07 09:31:36 +00:00
Ilya Lavrenov 4273534c92 typo 2015-04-07 11:08:21 +03:00
greensea 7274e2ff1a Fix a segment fault issue in cascade classfier 2015-04-07 10:38:58 +08:00
Vadim Pisarevsky 0e8bfff386 Merge pull request #3904 from SeninAndrew:2.4 2015-04-05 18:00:30 +00:00
Andrew Senin 8c55d7be5e Ximea camera fix (see issue #4235) 2015-04-03 22:50:05 +03:00
Vadim Pisarevsky f6de017171 Merge pull request #3900 from apavlenko:doc_fix_imwrite 2015-04-03 13:26:00 +00:00
Vadim Pisarevsky cc63452f65 Merge pull request #3899 from StevenPuttemans:add_breakrule_traincascade_2.4 2015-04-03 11:44:55 +00:00
Andrey Pavlenko eeae81e903 fixing confusing variable naming in a sample code 2015-04-03 13:54:49 +03:00
StevenPuttemans e30139edc3 add the possibility to add traincascade accuracy 2015-04-03 12:47:09 +02:00
Vadim Pisarevsky f01b2413c3 Merge pull request #3770 from jet47:gpu-hog-tests 2015-04-03 10:32:59 +00:00
Alexander Smorkalov 772fcf4088 Merge pull request #3893 from SpecLad:cuda-imported-targets 2015-04-02 13:56:31 +00:00
ippei ito b8c00854fe instead of "using namespace cv" put all the tests into cv:: namespace. 2015-04-02 19:58:19 +09:00
Vadim Pisarevsky ba0a8dc723 Merge pull request #3783 from StevenPuttemans:fix_traincascade_getNegatives 2015-04-01 13:56:29 +00:00
Vadim Pisarevsky 100c2dd91c Merge pull request #3852 from renko:multithread_cl_not_studio_generator 2015-04-01 13:25:39 +00:00
Vladimir Kolesnikov 58c9135626 Not block PDB file in multithreaded build on Windows.
If used cl compiler, but generator is not Visual Studio e.g. Ninja,
enable FS option to prevent blocking PDB file in multithreaded build.
2015-04-01 13:52:07 +03:00
Roman Donchenko 6e121b2e29 Use imported targets for linking to CUDA
This retains the desirable quality of not including paths to CUDA libraries
from the build system into the config files, and has two major advantages:

* It removes the need to use link_directories, which doesn't guarantee that
  the libraries from the supplied directory will be used (there may be
  libraries with the same names earlier in the search path).

* It removes the need to put -L entries into OPENCV_LINKER_LIBS. This variable
  is used with target_link_libraries, where such entries are treated as linker
  flags, so doing this is unportable. I remove the support for -L entries
  from OpenCVGenPkgconfig.cmake, as well, to discourage adding them in the
  future.
2015-03-31 13:46:28 +03:00
Roman Donchenko e6619cf580 Move the CUDA searching code in OpenCVConfig.cmake.in out of the foreach loop
There's no reason to do it twice.
2015-03-30 15:04:27 +03:00
Roman Donchenko 122b9f8e17 Turn ocv_convert_to_lib_name into a function 2015-03-30 14:58:37 +03:00
Vadim Pisarevsky d948b2a235 Merge pull request #3886 from beahacker:2.4 2015-03-30 09:09:31 +00:00
howtobeahacker ebd7d08408 fix bug 4269 2015-03-30 00:01:20 +08:00
ippei ito 140051b18c Merge remote-tracking branch 'origin/2.4-flann-lsh-addable-index' into 2.4-flann-lsh-addable-index 2015-03-27 20:55:59 +09:00
ippei ito b7276359e9 Test accuracy for PR#3829 2015-03-27 20:54:05 +09:00
Vadim Pisarevsky 83d6d70a56 Merge pull request #3855 from polarfuchs99:2.4 2015-03-26 16:55:30 +00:00
Prof. Dr. Rudolf Haussmann a9d4e05346 Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

	modified:   highgui/include/opencv2/highgui/highgui_c.h
	modified:   highgui/src/cap_dshow.cpp
	modified:   java/generator/gen_java.py

The correction of the orthographic error in the enumeration constant
CAP_PROP_MONOCROME has been undone.
2015-03-25 15:45:20 +01:00
Prof. Dr. Rudolf Haussmann e5e6367223 Merge remote-tracking branch 'upstream/2.4' into 2.4 2015-03-25 13:38:49 +01:00
Vadim Pisarevsky 5678ba1227 Merge pull request #3805 from nitsch:fix-mingw-cmake-config 2015-03-25 09:53:35 +00:00
Vadim Pisarevsky b01f067614 Merge pull request #3865 from tdsmith:2.4-python-linkage 2015-03-25 09:52:52 +00:00
ippei ito 65b0ecfec5 Test accuracy for PR#3829.Fix WOrder warning on gcc 2015-03-25 18:24:52 +09:00
ippei ito d1902a1276 Test accuracy for PR#3829.Fix warning on gcc, comment out INIT_RANDOM_SEED for same result each ran. 2015-03-25 05:28:29 +09:00
ippei ito 56cae1b293 Test accuracy for PR#3829.Fix Some Error, Modify SLA. 2015-03-25 03:11:44 +09:00
ippei ito 7c740b6a31 Test accuracy for Pull Request # 3829 2015-03-25 02:38:01 +09:00
Alexander Nitsch d430664791 Remove local variables from CMAKE namespace 2015-03-24 14:42:55 +01:00
Tim D. Smith d057828ee3 Don't explicitly link Python on OS X
Explicitly linking to a Python framework on OS X prevents modules from
being built against one python (i.e. system python) and imported from
another (i.e. Homebrew python); the interpreter segfaults if there's a
linkage to a foreign python. Building the module with `-undefined
dynamic_lookup` instead of an explicit link allows the symbols to be
resolved at load time from a compatible python.
2015-03-23 23:13:48 -07:00
Vadim Pisarevsky c9bb18b9f7 Merge pull request #3850 from piponazo:2.4 2015-03-23 08:03:49 +00:00
Vadim Pisarevsky 297e2b6f1a Merge pull request #3834 from asmorkalov:retina_docs_fix 2015-03-20 10:14:29 +00:00
Vadim Pisarevsky 3853a18e0e Merge pull request #3792 from laomaiweng:cuda-pkg-config-Ldir 2015-03-20 10:13:46 +00:00
Vadim Pisarevsky 226b4e3ed5 Merge pull request #3839 from hyperscience:fix-free-space-check-in-grow-seq 2015-03-20 09:37:49 +00:00
Prof. Dr. Rudolf Haussmann 756c1a22d9 Merge remote-tracking branch 'upstream/2.4' into 2.4 2015-03-20 01:44:29 +01:00
Prof. Dr. Rudolf Haussmann a7bf1d53d8 Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

	modified:   modules/highgui/include/opencv2/highgui/highgui_c.h
	modified:   modules/highgui/src/cap_dshow.cpp
	modified:   modules/highgui/src/cap_pvapi.cpp
	modified:   modules/java/generator/gen_java.py

Änderungen in der PvAPI hinzugefügt.
2015-03-20 01:42:16 +01:00
Luis Díaz Más 7711cd284b Fix a bug that impede to set the trackbar pos using the Qt control panel 2015-03-19 21:25:10 +01:00
Boris Daskalov 8755ffbf31 Fix a bad free space check in icvGrowSeq.
A difference of two pointers was casted to unsigned which can lead to
overflow on 64-bit systems.
2015-03-19 17:32:32 +02:00
Vadim Pisarevsky 69344f175b Merge pull request #3843 from piponazo:BugFix4244 2015-03-19 12:15:41 +00:00
Luis Díaz Más d14a1de947 Fixing the bug #4244 that I just reported in code.opencv.org 2015-03-18 20:07:08 +01:00
Alexander Smorkalov 514b3b520c Documentation update after iOS warnings fix in contrib/retina header. 2015-03-17 19:25:05 +03:00
Vadim Pisarevsky 4a6b1805e0 Merge pull request #3824 from Milania1:tutorial_hough_lines_fix 2015-03-17 11:14:13 +00:00
Vadim Pisarevsky 4ab525c880 Merge pull request #3810 from StevenPuttemans:upgrade_traincascade_default_memory 2015-03-16 10:02:07 +00:00
ippei ito 7d665a4754 Fix warn conversion from 'size_t' to 'int'. add comment for doxygen 2015-03-14 09:35:53 +09:00
ippei ito f7d52c774e Fix compile error on linux change cv::InputArray& to cv::InputArray 2015-03-14 06:58:34 +09:00
ippei ito 8efdfd9dfc Fix unused-parameter Warning 2015-03-14 06:07:55 +09:00
ippei ito cd42e38013 FlannBasedMatcher(LshIndex) in the feature2d optimization for continuance additional train()
Current implementation of miniflann is releasing the trained index, and
rebuilding the index from the beginning.
But, some indexing algorithms like the LSH are able to add the indexing
data after that.
This branch is implementation of that optimization for LshIndex
FlannBasedMatcher in the feature2d.
2015-03-14 04:38:07 +09:00
Milania1 339e6aa782 fixed error in hough lines tutorial (the point (9,4) is not on the lines, but the point (4,9) is) 2015-03-12 16:46:25 +01:00
Vadim Pisarevsky 309eb3c122 Merge pull request #3815 from StevenPuttemans:add_camera_IP_regulations 2015-03-12 14:39:48 +00:00
Vadim Pisarevsky 2594e5e384 Merge pull request #3800 from StevenPuttemans:add_parameter_info_annotation 2015-03-12 14:29:04 +00:00
StevenPuttemans 3a7ea37090 extra camera specific information for IP settings 2015-03-10 10:16:13 +01:00
StevenPuttemans 9f0cd9ee10 upgrade traincascade default memory 2015-03-09 10:43:14 +01:00
Alexander Nitsch 13694c8ae8 Fix MinGW detection on x86
Make detection of x64 using the gcc's target triplet identical
to the one used in cmake/OpenCVDetectCXXCompiler.cmake.
Otherwise, MinGW-w64 setups will always be treated as x64 since
they contain "w64" as vendor key.
2015-03-07 15:49:48 +01:00
Alexander Nitsch dde7c22fad Fix MinGW architecture detection
Fix typo that would always lead to detection of x86 for MinGW
builds in the OpenCVConfig.cmake file.
2015-03-07 15:37:21 +01:00
Alexander Alekhin 29e7eb7719 Merge pull request #3789 from StevenPuttemans:fix_cmakelist_annotation 2015-03-06 14:53:43 +00:00
StevenPuttemans 3419c704a9 adding usage information 2015-03-06 13:52:52 +01:00
StevenPuttemans cdbb661eab update cmakelists of annotation tool 2015-03-06 12:51:28 +01:00
quentin afdf319f36 Add -L for CUDA libs path to pkg-config
Add all dirs from CUDA_LIBS_PATH as -L linker options to
OPENCV_LINKER_LIBS. These will end up in opencv.pc.
2015-03-05 14:37:21 +01:00
StevenPuttemans 488babf3b3 fixing undesired behaviour 2015-03-04 12:03:33 +01:00
Vadim Pisarevsky 2c57717ca2 Merge pull request #3774 from JoeHowse:2.4 2015-03-03 12:31:29 +00:00
Joe Howse e9b4813bb2 Cat face detection cascades 2015-03-02 11:58:08 -04:00
Vadim Pisarevsky 9185b62a1d Merge pull request #3761 from StevenPuttemans:fix_smile_model 2015-03-02 11:49:41 +00:00
Vadim Pisarevsky ac8045b9c6 Merge pull request #3754 from eliteraspberries:unsigned-mask 2015-03-02 11:34:43 +00:00
Vadim Pisarevsky 417f1e51a4 Merge pull request #3755 from eliteraspberries:mat-size-sign 2015-03-02 11:34:09 +00:00
Vadim Pisarevsky b595812bd0 Merge pull request #3745 from nitsch:fix-mingw-detection 2015-03-02 10:55:00 +00:00
Vadim Pisarevsky 0172bd6beb Merge pull request #3756 from eliteraspberries:cast-double 2015-03-02 10:52:28 +00:00
Vadim Pisarevsky e02d6e2c8f Merge pull request #3766 from StevenPuttemans:add_GPU_old_models 2015-03-02 10:49:38 +00:00
Vadim Pisarevsky 7458dfc082 Merge pull request #3765 from jet47:gpu-hog-fix 2015-03-02 10:34:51 +00:00
Vadim Pisarevsky bed8cb42be Merge pull request #3768 from jet47:gpumat-set-to 2015-03-02 10:33:45 +00:00
Vladislav Vinogradov c849492dfa fix tests for gpu HOG
initialize HOG after CUDA device switch
2015-03-02 11:02:47 +03:00
Vladislav Vinogradov 4f5d30a865 fix GpuMat::setTo implementation
previous implementation was not thread/stream safe, since it used constant
memory

new implementation doesn't use any global objects, so it is thread/stream safe
2015-02-27 16:28:06 +03:00
StevenPuttemans 2c0ef660bf Add GPU models in seperate folder, only old models are supported and they were replaced to make the CPU interface work.
This solves the undesired consequence of breaking the GPU interface.
2015-02-27 14:15:30 +01:00
Vladislav Vinogradov 21bbed7baf fix gpu HOG implementation:
move hog::set_up_constants from constructor to compute method

if user changed CUDA device between constructor and computation,
some variables were uninitialized
2015-02-27 14:28:12 +03:00
StevenPuttemans 1e95c964f3 fixing model size, typo in previous PR 2015-02-26 15:53:00 +01:00
Vadim Pisarevsky 2c9547e314 Merge pull request #3747 from StevenPuttemans:fix_annotationtool_extras 2015-02-25 12:10:31 +00:00
Alexander Smorkalov f73a97b53b Merge pull request #3751 from jet47:gpu-bmoptflow-test-epsilon 2015-02-25 11:54:44 +00:00
StevenPuttemans 387a0f26fb fix annotation tool, add auto make of tool 2015-02-25 11:27:59 +01:00
Vladislav Vinogradov c147ab1e85 set epsilon for gpu OpticalFlowBM to 1e-6, since it uses floating point arithmetic 2015-02-25 13:16:36 +03:00
Alexander Nitsch a5b293b412 Fix setting of architecture for MinGW builds
The architecture has been correctly determined earlier in this
file. No need to do it again.
2015-02-24 23:13:27 +01:00
Mansour Moufid 7d4cbbd7aa Cast a long integer to double explicitly. 2015-02-24 17:04:28 -05:00
Mansour Moufid b7be49426d Cast some image coordinates and sizes to double. 2015-02-24 12:21:34 -05:00
Alexander Smorkalov 96d7bcc2a9 Merge pull request #3677 from ilya-lavrenov:cuda_backport 2015-02-24 15:06:15 +00:00
Vadim Pisarevsky 2d2ecbf3ee Merge pull request #3653 from StevenPuttemans:add_annotationtool 2015-02-24 13:50:39 +00:00
Ilya Lavrenov e03136e951 backport from master 2015-02-24 16:05:21 +03:00
Alexander Smorkalov 1c6e9fdfae Merge pull request #3735 from SpecLad:align-cpack-variables 2015-02-24 11:42:40 +00:00
Maksim Shabunin d56dd0e091 Merge pull request #3727 from StevenPuttemans:fix_3714_2.4 2015-02-24 10:08:43 +00:00
Maksim Shabunin baabd95f30 Merge pull request #3740 from StevenPuttemans:fix_3028_2.4 2015-02-24 10:06:20 +00:00
Alexander Smorkalov 877058aaed Merge pull request #3739 from ilya-lavrenov:2_4_cc 2015-02-24 09:35:32 +00:00
Mansour Moufid 42b1c6440c Cast some matrix sizes to type int. 2015-02-23 23:19:33 -05:00
Mansour Moufid 35a89b1541 Change some vector mask types to unsigned. 2015-02-23 23:10:57 -05:00
Alexander Nitsch 8ae6402799 Fix MinGW detection on x86
MinGW-w64 always uses "w64" as vendor key which the previously
used check for "64" anywhere in the target triplet matched. This
would lead to MinGW-w64 setups always being treated as x64.

Since we are actually interested in finding the "64" in the
triplet's operating system key, this fix makes sure to look for
"mingw64" and thus avoids the false match.

Fixes issue #3835. Credits to Lode Leroy for the original patch.
2015-02-23 15:03:28 +01:00
StevenPuttemans 720fd144ef add fit ellipse technique notice 2015-02-23 14:59:40 +01:00
Ilya Lavrenov 0832b47d21 fixed cross-compilation for Android with CUDA 2015-02-22 13:18:57 +03:00
Alexander Smorkalov dcc569ee5c Merge pull request #3721 from nitsch:fix-cmake-current-list-dir 2015-02-21 16:49:36 +00:00
Alexander Smorkalov 0cbe2f2eab Merge pull request #3708 from StevenPuttemans:fix_traincascade_load_message 2015-02-21 16:47:58 +00:00
Alexander Smorkalov 3df13ff564 Merge pull request #3732 from StevenPuttemans:fix_4004_2.4 2015-02-21 16:46:41 +00:00
Alexander Nitsch c2944dbc0c Exclude >= 2.8.3 from reimplementation of CMAKE_CURRENT_LIST_DIR
This avoids violation of possible future CMake policy checks
regarding reserved/read-only variables.
2015-02-20 19:55:46 +01:00
Andrey Pavlenko c059f7ddcd Merge pull request #3726 from asmorkalov:ocv_version_inc4 2015-02-20 16:11:58 +00:00
Roman Donchenko cf54e3b97e Mark the libs component required
Everything else depends on it, after all.
2015-02-20 18:37:21 +03:00
Roman Donchenko 6d52ea8984 Add component display names 2015-02-20 18:22:01 +03:00
Roman Donchenko b8c60234c3 Update the CPack variables to match the changes in asmorkalov/CMake#1
Which also happens to align the non-Debian specific variables
with the ones used by upstream CMake.
2015-02-20 18:21:47 +03:00
StevenPuttemans 2136c3f3c8 add remarks for iOS tutorial 2015-02-20 15:14:36 +01:00
Vadim Pisarevsky a46166d30f Merge pull request #3710 from asmorkalov:aarc64_manager_android_5 2015-02-20 13:02:07 +00:00
Vadim Pisarevsky 85fd599939 Merge pull request #3588 from vpradeep07:feature/deterministic_pnpransac 2015-02-20 12:32:35 +00:00
Vadim Pisarevsky f3210b58a1 Merge pull request #3723 from SpecLad:run-all-tests-windows 2015-02-20 12:28:15 +00:00
Vadim Pisarevsky d34a52042e Merge pull request #3704 from SpecLad:win-install-data 2015-02-20 12:27:35 +00:00
Vadim Pisarevsky 99ae48f0b4 Merge pull request #3707 from alalek:fix_android_camera 2015-02-20 12:27:13 +00:00
Alexander Smorkalov 96e5300fdd OpenCV and OpenCV Manager version++ 2015-02-20 15:17:11 +03:00
StevenPuttemans 4f621de849 fix bug 3714 2.4 branch 2015-02-20 12:39:31 +01:00
Alexander Smorkalov 3649a1a179 Build fix for case without TegraDetector. 2015-02-20 13:29:58 +03:00
Alexander Smorkalov 352485fc54 Android 5 support and aarch64-related fixes for Android Manager. 2015-02-20 13:16:33 +03:00
Roman Donchenko c1e3ca170e Add a script to run all tests on Windows
It's pretty much a simplified copy of the Linux script, lacking fancy colors.
Also, I had to drop Python testing, because it's not easy to pass the Python
module location to the script, and I have no pressing need to run the Python
tests at the moment.
2015-02-20 12:38:25 +03:00
Alexander Nitsch 9665e08bac Implement CMAKE_CURRENT_LIST_DIR for older CMake
The use of built-in CMAKE_CURRENT_LIST_DIR requires at least
CMake 2.8.3. This fix properly defines the variable to allow its
use in versions < 2.8.3 as well.

Fixes issue #4205.
2015-02-20 00:55:26 +01:00
Vadim Pisarevsky 65e4df751c Merge pull request #3705 from SpecLad:unused-nNull 2015-02-19 18:40:22 +00:00
Alexander Alekhin 4e8aac5308 Merge pull request #3683 from SeninAndrew:2.4 2015-02-18 17:15:10 +00:00
Vadim Pisarevsky a649aea82a Merge pull request #3699 from SpecLad:rm-component-install 2015-02-18 13:55:07 +00:00
Vadim Pisarevsky 4fcfcfd002 Merge pull request #3663 from eliteraspberries:ffmpeg-dylib 2015-02-18 12:50:10 +00:00
Vijay Pradeep 4ce31c7c1a Merge remote-tracking branch 'itseez/2.4' into feature/deterministic_pnpransac 2015-02-17 10:16:44 -08:00
Vijay Pradeep 49bc100e51 Removing rng_seed arg in order to maintain ABI compatibility. Hardcoding seed 2015-02-17 09:19:36 -08:00
StevenPuttemans f5a14e5594 fix message of preloaded parameters 2015-02-17 10:21:31 +01:00
Alexander Alekhin dc21a0a6b5 Android: fix JavaCameraView implementation
1) Fixed deadlock if camera is started and stopped immediately
2) Invalid pattern usage of Object.wait(). Refer to "spurious wakeup": http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait
3) Fixed buffer usage:
  a) fix eliminates processing of zero NV12 (green in RGB) first frame
  b) latest ready frame is delivered for processing (not previous)
2015-02-17 01:28:43 +03:00
Roman Donchenko d218f28070 cap_msmf.hpp: fix a warning about nNull being unused
The two functions featuring nNull are not particularly needed, so
I simply removed them.
2015-02-16 19:31:51 +03:00
Roman Donchenko e8a7394009 Install data and test data on Windows
Because why not?
2015-02-16 19:24:07 +03:00
Vadim Pisarevsky 6a3a6416d7 Merge pull request #3698 from SpecLad:avcodec-free-frame 2015-02-16 11:33:00 +00:00
Vadim Pisarevsky 9e3a826263 Merge pull request #3697 from tomi44g:2.4 2015-02-16 11:28:02 +00:00
Roman Donchenko 8714219dab Merge pull request #3695 from SpecLad:fix-hdc-tautology 2015-02-13 14:09:07 +00:00
Roman Donchenko 6c4b3c1efe Merge pull request #3693 from SpecLad:no-absolute-destinations 2015-02-13 14:06:54 +00:00
Roman Donchenko 49fe496914 Remove useless CPACK_*_COMPONENT_INSTALL variables
They don't actually do anything. And even if they did, all components are
enabled by default, anyway.
2015-02-13 15:31:19 +03:00
Roman Donchenko 77578d415f Fix a memory leak in CvCapture_FFMPEG::close
FFmpeg now requires that frames allocated with avcodec_alloc_frame are
freed with avcodec_free_frame.
2015-02-13 15:12:52 +03:00
Thomas Gabrowski ff4c42d182 Fix iOS warnings about implicit conversion precision by changing double literals to float ones 2015-02-13 00:51:03 +00:00
Roman Donchenko 3d46c1f960 Don't install documentation if it isn't built
The HAVE_DOC_GENERATOR variable was always true.
2015-02-12 16:51:26 +03:00
Roman Donchenko 0387f8ad56 Don't use ${CMAKE_INSTALL_PREFIX} as an install destination
Absolute destinations are not necessary, and prevent CPack from working.
2015-02-10 19:43:29 +03:00
Vadim Pisarevsky 9a62173a5b Merge pull request #3689 from jet47:test-script-optional-color-2.4 2015-02-10 12:00:44 +00:00
Vladislav Vinogradov 682fdcfc9b make color output in run_test script optional 2015-02-09 15:23:34 +03:00
Andrew Senin b9a6edfe3d Fixing XIMEA parameters mapping (issue #4176) 2015-02-09 15:15:23 +03:00
Vadim Pisarevsky 606a646435 Merge pull request #3680 from jet47:fix-run-tests-script-2.4 2015-02-08 17:07:11 +00:00
Vladislav Vinogradov 94d14c637f fix opencv_run_all_tests_unix.sh script:
use `bash` shell instead of `sh`, since on Ubuntu `sh` by default is `dash`,
and `dash` doesn't support `PIPESTATUS` feature used in this sctipt
2015-02-06 12:34:50 +03:00
Vadim Pisarevsky cd1ca7b08b Merge pull request #3667 from AfterEight:cap_ximea_setResolution_bugfix 2015-02-05 07:48:43 +00:00
Vadim Pisarevsky 98f9a013d1 Merge pull request #3674 from jet47:colorize-run-test-script-2.4 2015-02-05 07:35:01 +00:00
Mansour Moufid c60fa84027 Add back the version variables removed in ab40630f. 2015-02-04 10:55:38 -05:00
Vadim Pisarevsky 50eb661df8 Merge pull request #3676 from asmorkalov:changelog_for_tests 2015-02-04 15:13:44 +00:00
Alexander Smorkalov a87ccb9ac0 Added Debian changelog to -tests package. 2015-02-04 16:52:39 +03:00
Vadim Pisarevsky 8e1b1a845b Merge pull request #3672 from asmorkalov:debian_lower_case 2015-02-04 13:17:51 +00:00
Vadim Pisarevsky 5253265342 Merge pull request #3671 from jet47:disable-gpu-match-template-tests 2015-02-04 13:17:26 +00:00
Vladislav Vinogradov 2b303f38a8 colorize opencv_run_all_tests_unix.sh script output 2015-02-04 12:38:51 +03:00
Alexander Smorkalov e6ac64008b Debian package names replaced by lower case version to satisfy lintian. 2015-02-04 11:56:29 +03:00
Vladislav Vinogradov 7bb8c50080 disable gpu::matchTemplate tests 2015-02-04 11:21:17 +03:00
Mansour Moufid 8c68f1f626 Fix indentation of 98a157f5. 2015-02-03 23:17:43 -05:00
Mansour Moufid 98a157f589 Remove Apple-specific logic in finding the FFmpeg libraries.
Thanks to SpecLad.
2015-02-03 23:14:11 -05:00
Mansour Moufid a1cc9380e5 Correct the new find_library commands.
Thanks to SpecLad.
2015-02-02 11:54:09 -05:00
AfterEight e938563de5 Modified resetCvImage() in cap_ximea.cpp, so that the IplImage* frame is also updated after the resolution has changed via set(CV_CAP_PROP_FRAME_WIDTH, value)/set(CV_CAP_PROP_XI_DOWNSAMPLING, value) 2015-02-02 15:04:29 +01:00
Vadim Pisarevsky 0ab4bbf771 Merge pull request #3662 from StevenPuttemans:fix_models 2015-02-02 10:17:43 +00:00
Mansour Moufid ab40630ff4 Use the CMake find_library command to find the FFmpeg libraries. 2015-02-01 15:51:33 -05:00
StevenPuttemans 8548a8430e fixing wrong model sizes 2015-02-01 15:13:57 +01:00
Vadim Pisarevsky 06b97b7b67 Merge pull request #3660 from asmorkalov:samples_install_permissions 2015-02-01 09:14:28 +00:00
Alexander Smorkalov cf852972d1 Fixed samples install permissions for Debian packaging. 2015-02-01 00:34:23 +03:00
Vadim Pisarevsky 1f47c22371 Merge pull request #3655 from asmorkalov:remove_opencv_testing_sh 2015-01-31 14:46:40 +00:00
Vadim Pisarevsky 602b034a03 Merge pull request #3658 from asmorkalov:numpy_dependency 2015-01-31 14:45:11 +00:00
Vadim Pisarevsky 8764b17ffc Merge pull request #3659 from asmorkalov:debian_changelog_stub 2015-01-31 14:44:41 +00:00
Alexander Smorkalov ddc1b965b6 Added Debian changelog installation step for Debian package generation. 2015-01-30 13:21:52 +03:00
Alexander Smorkalov be6b847675 Added dependency from numpy to debian package with python bindings. 2015-01-30 12:27:33 +03:00
Alexander Smorkalov 9206ec30a2 opencv_testing.sh script installation is removed as run tests script does the same thing. 2015-01-29 19:20:18 +03:00
Vadim Pisarevsky a7e9760316 Merge pull request #3649 from StevenPuttemans:fix_tutorials 2015-01-29 12:14:09 +00:00
Vadim Pisarevsky 7e1068919b Merge pull request #3587 from vpradeep07:fix/pnpransac_race_cond 2015-01-29 12:12:18 +00:00
StevenPuttemans 30d46313ec adding a universal OpenCV based annotation tool for cascade classifier training 2015-01-29 13:03:28 +01:00
Vadim Pisarevsky c1252a1089 Merge pull request #3648 from SpecLad:get_policy-ts 2015-01-28 18:49:59 +00:00
StevenPuttemans a86dc747b3 fixing tutorial errors 2015-01-28 13:52:50 +01:00
Alexander Karsakov c481e06e87 Fixed getPolicy() method to make it thread-safe.
(cherry picked from commit 8910508b83)
2015-01-27 19:20:35 +03:00
Vadim Pisarevsky 3bfe4f711d Merge pull request #3641 from cbenhagen:patch-2 2015-01-26 09:45:59 +00:00
Ben Hagen 5245c7454c Do not blacklist GStreamer on Apple 2015-01-23 12:59:09 +01:00
Vadim Pisarevsky 2fabe56bbe Merge pull request #3631 from StevenPuttemans:fix_samples 2015-01-21 10:40:19 +00:00
Vadim Pisarevsky 2ca39c910d Merge pull request #3468 from StevenPuttemans:fix_models 2015-01-20 15:25:51 +00:00
StevenPuttemans cf5a7b9679 remove an unused #endif 2015-01-20 15:41:39 +01:00
Vadim Pisarevsky 9a6a046caf Merge pull request #3613 from asmorkalov:aarch64_tiff 2015-01-20 12:36:38 +00:00
Vadim Pisarevsky c29c52a216 Merge pull request #3609 from jet47:fix-ocv_add_module-2.4 2015-01-20 12:34:50 +00:00
Vadim Pisarevsky 07c9a88d9c Merge pull request #3621 from asmorkalov:ts_master_comapat_header 2015-01-19 12:33:58 +00:00
Vadim Pisarevsky f3439de480 Merge pull request #3623 from Trundle:fix_android_link 2015-01-19 10:51:12 +00:00
Vadim Pisarevsky 28dd3aae79 Merge pull request #3614 from cwreynolds:Unicode-fix-for-addText-2 2015-01-19 10:50:14 +00:00
Andreas Stührk 0a5b200da2 Update link to information about Android platform.
The current link does no longer seem to work.
2015-01-19 00:01:12 +01:00
Alexander Smorkalov 9e9327e2f8 Added OpenCV 3.0 compat header for TS module. 2015-01-18 21:32:19 +03:00
Vadim Pisarevsky 9fb0f5ac51 Merge pull request #3620 from asmorkalov:native_samples_install 2015-01-18 18:22:27 +00:00
Alexander Smorkalov 911be68a41 Prevent native c/c++/ocl/gpu CMakeLists.txt install if samples are turned off. 2015-01-18 20:33:05 +03:00
Craig Reynolds 72d90ba8d2 In cvAddText, construct QString from "text" using fromUtf8. 2015-01-16 14:57:11 -08:00
Alexander Smorkalov d277a1ba75 TIFF support hack for aarch64 reverted. 2015-01-17 01:25:58 +03:00
Vadim Pisarevsky 396f7e1a17 Merge pull request #3604 from asmorkalov:ocv_samples_package 2015-01-16 10:23:32 +00:00
Vladislav Vinogradov 12a3eb776d fix ocv_add_module CMake macro:
it tries to remove 'opencv_' prefix from 'name' variable, but
it creates new variable with the same name as module
2015-01-16 10:59:52 +03:00
Alexander Smorkalov 6628714fc6 Fixed -samples debian package dependencies. 2015-01-15 15:36:45 +03:00
Alexander Smorkalov 187befd665 Fixed installation of CMakeLists.txt and enabled GPU samples build in stand alone version. 2015-01-15 14:48:24 +03:00
Vijay Pradeep 1292fdf71a Now using default arg instead of overloads 2015-01-13 11:25:01 -08:00
Alexander Smorkalov 3425c90b66 GPU samples with NVIDIA specific API excluded from build if CUDA disabled. 2015-01-13 14:58:51 +03:00
Alexander Smorkalov b0c5f49170 Build fixes for GPU samples. 2015-01-13 14:39:18 +03:00
Vadim Pisarevsky 9cadc1e530 Merge pull request #3310 from tSed:opencv-2.4/fix-gstreamer-detection 2015-01-13 11:25:32 +00:00
Alexander Smorkalov c0d76ef984 driver_api_stereo_multi sample reworked to use parallel_for_ instead of parallel_do 2015-01-13 13:00:06 +03:00
Alexander Smorkalov 72063bf136 parallel_do replaced with parallel_for_ in driver_gpu_multi sample. 2015-01-13 12:53:13 +03:00
Vadim Pisarevsky 36c1dce264 Merge pull request #3578 from asmorkalov:ocv_avx 2015-01-12 11:29:21 +00:00
Vijay Pradeep 964d5a20e9 Whitespace fix 2015-01-09 10:44:19 -08:00
Vijay Pradeep 177478a8ad overload instead of default arg for ABI backwards compatibility. rng_seed is now 'int' to support python port 2015-01-09 10:18:08 -08:00
Vijay Pradeep a1c5740044 solvePnPRansac now accepts a seed and is deterministic 2015-01-08 18:24:55 -08:00
Vijay Pradeep 042ff210d5 Fixing race condition by expanding resultsMutex lock section 2015-01-08 15:26:15 -08:00
Alexander Smorkalov 091c7a3821 OpenGL interop sample reworked not ot use cvconfig.h 2015-01-04 23:52:00 +03:00
Alexander Smorkalov c778011f14 More accurate AVX and AVX2 control.
- Previous version just checked option support, but not enable it.
- Also OpenCV tests reports invalid AVX and AVX2 support status.
2015-01-04 23:41:14 +03:00
Vadim Pisarevsky 4e9cb475da Merge pull request #3565 from mshabunin:ml-leak-24 2014-12-31 09:17:25 +00:00
Alexander Smorkalov e02418e904 parallel_do replaced by parallel_for_ in gpu/multi.cpp sample to get rid of cvconfig.h 2014-12-30 16:44:33 +03:00
Alexander Smorkalov 840088e021 Get rid of cvconfig.h in Latent SVM samples. Use common OpenCV parallel framework instead of direct TBB calls. 2014-12-30 15:52:23 +03:00
Maksim Shabunin e23ba9215d Fixed memory leak in ML module
"int * CvMLData::sample_idx" was not freed
2014-12-30 15:20:24 +03:00
Vadim Pisarevsky ad71efb2cb Merge pull request #3562 from asmorkalov:ocv_aarch64 2014-12-30 11:06:00 +00:00
Alexander Smorkalov 8acd4c3ff4 More accurate fix for libtiff and aarch64. 2014-12-28 12:44:24 +03:00
Alexander Smorkalov 0f263e125b Full AARCH64 support with NEON and new CUDA toolkit. 2014-12-28 11:51:33 +03:00
Alexander Smorkalov 82bd82e2f8 TBB updated to 4.3u2. Fix for aarch64 support. 2014-12-28 11:49:25 +03:00
Alexander Smorkalov c0a8d4e1ef Fix of HaarCascade GPU test for aarch64. 2014-12-28 11:49:25 +03:00
Vadim Pisarevsky a5969aec96 Merge pull request #3534 from taka-no-me:build_fixes 2014-12-26 14:34:13 +00:00
Vadim Pisarevsky b01cdf28ca Merge pull request #3543 from MatMoore:2.4 2014-12-26 12:11:42 +00:00
Vadim Pisarevsky ba84eb58f2 Merge pull request #3545 from jet47:gpu-match-template-tests 2014-12-26 12:08:54 +00:00
Vladislav Vinogradov d00f36ec75 fix tests for gpu::matchTemplate:
use ASSERT_FLOAT_EQ to compare float values, it is more robust for
large values
2014-12-25 17:43:13 +03:00
Andrey Kamaev 7ec6d8a336 Fix Android build with the most resent android.toolchain.cmake 2014-12-25 12:41:17 +03:00
Andrey Kamaev c105b72945 Assorted fixes:
* cmake CMP0054 and CMP0045
* aarch64 build
* portable code options in PCH cmake
* some of gcc 4.9 warnings
2014-12-25 12:41:16 +03:00
Roman Donchenko 1ed22204c8 Merge pull request #3506 from doltac:typofix 2014-12-24 09:01:40 +00:00
Roman Donchenko 034ff3ce13 Merge pull request #3497 from SpecLad:fs-open-fail-leak 2014-12-24 08:59:53 +00:00
Mat Moore 1386489f41 Minor grammar improvements to documentation 2014-12-23 19:17:27 +00:00
Roman Donchenko 08da247a87 cvOpenFileStorage: reduce the scope of xml_buf and make sure it's freed...
... before any exceptions occur.
2014-12-22 18:54:39 +03:00
Vadim Pisarevsky 63bc4d4b7f Merge pull request #3471 from HelenWong:FixBug3714 2014-12-22 10:55:23 +00:00
Vadim Pisarevsky cc024d3ef2 Merge pull request #3484 from euphrat:gmg_update_fix 2014-12-22 10:54:57 +00:00
Vadim Pisarevsky 20d957d212 Merge pull request #3511 from mattip:2.4 2014-12-22 10:41:21 +00:00
Vadim Pisarevsky 03df7831ab Merge pull request #3514 from mshabunin:compat-24 2014-12-22 10:38:56 +00:00
Vadim Pisarevsky 2425dac9a1 Merge pull request #3500 from StevenPuttemans:fix_2432_2.4 2014-12-22 10:28:33 +00:00
Vadim Pisarevsky 9071598a65 Merge pull request #3515 from StevenPuttemans:fix_FeatureDetector_docs 2014-12-22 10:27:01 +00:00
Roman Donchenko 16ce114e0c Fix memory leaks appearing when cvOpenFileStorage throws 2014-12-22 12:59:08 +03:00
Vadim Pisarevsky 183454a723 Merge pull request #3522 from ilya-lavrenov:update_android_toolchain_cmake 2014-12-18 14:49:35 +00:00
Ilya Lavrenov ba612fc9bd update android.toolchain.cmake 2014-12-17 20:08:55 +03:00
Maksim Shabunin 91e21847e2 Some changes to make migration to 3.0 easier 2014-12-16 13:00:31 +03:00
Vadim Pisarevsky 241991c677 Merge pull request #3498 from ilya-lavrenov:omp 2014-12-15 18:08:31 +00:00
Vadim Pisarevsky 4ef03ccbe1 Merge pull request #3449 from Ashod:2.4_highgui_trackbar_improvements 2014-12-15 18:02:29 +00:00
StevenPuttemans 73d1ea9a52 fix bug 2432 for 2.4 branch 2014-12-15 11:56:42 +01:00
StevenPuttemans db9a0cfbc0 add extra to FeatureDetector docs 2014-12-15 11:31:18 +01:00
mattip ff7ea605ef export thread control to generated wrappers 2014-12-14 11:55:02 +02:00
doltac 6cc5959356 Fixed typos in latentSVM detector demo. 2014-12-11 19:22:40 +09:00
Ilya Lavrenov ce81433aff ability to enable OpenMP simultaneously with other parallel framework 2014-12-10 13:34:39 +03:00
Ashod Nakashian 63c49be487 highgui: Support to change trackbar count in setTrackbarPos and replaced deprecated CreateToolbarEx in Windows. 2014-12-06 11:56:01 -05:00
Vadim Pisarevsky 4f82b3588a Merge pull request #3480 from mshabunin:python-test-24 2014-12-06 08:07:56 +00:00
Vadim Pisarevsky 3481c1caec Merge pull request #3488 from jeremyhu:PR-4048 2014-12-06 08:03:56 +00:00
Jeremy Huddleston Sequoia 35f96d6da7 Fix tautologies in calibfilter.cpp which cause a build failure when using -Werror=address with clang-3.5
http://code.opencv.org/issues/4048

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-12-05 10:22:11 -08:00
Firat Kalaycilar 2bda7aaf61 minor fix to make "updateBackgroundModel=false" option meaningful. 2014-12-04 22:36:42 +02:00
Maksim Shabunin 3212dd5465 Python test: new options provide local test data paths 2014-12-03 18:15:54 +03:00
StevenPuttemans 7efc917ee0 pulling most recent models 2014-12-03 12:57:37 +01:00
HelenWong ec57a938c0 Fix#3714:Improve Display Image Tutorial
For Bug #3714, user use the imshow() function without calling
namedWindow() properly, because user did not know the implicit rule for
imshow(). (i.e. without calling namedWindow implied calling namedWindow(
,CV__WINDOW_AUTOSIZE).

Improve the Display Image Tutorial to educate the user for such implied
rule.

Put a note on documentation for Bug#3714

Revise the documentation regarding to imshow() function to better
educate the user the implicit rule. (i.e. without creating the window
before the imshow() function is the same as creating AUTOSIZE window)
2014-12-02 09:43:52 -08:00
Vadim Pisarevsky c5b6c0456d Merge pull request #3445 from jet47:get-rid-of-cuda-h 2014-12-01 10:40:57 +00:00
Vadim Pisarevsky 1b73530b75 Merge pull request #3447 from a-wi:Fill_ellipse_arc 2014-12-01 10:40:12 +00:00
Artur Wieczorek 7512b5fdde Fix determining bounding box of the edge collection in FillEdgeCollection().
There is necessary to account also x-ccordinate of the end of the edge when determining bounding box of the edge collection.
2014-11-25 18:54:47 +01:00
Vladislav Vinogradov eeb997261d get rid of cuda.h usage 2014-11-25 18:29:56 +03:00
Vadim Pisarevsky 3dd1afe4ec Merge pull request #3433 from StevenPuttemans:fix_whitebalance_naming 2014-11-24 09:40:21 +00:00
StevenPuttemans f151b1d277 fix wrong property name and corresponding documentation 2014-11-19 14:00:40 +01:00
Vadim Pisarevsky 047b1ca457 Merge pull request #3419 from samyak-268:2.4 2014-11-16 18:17:54 +00:00
Vadim Pisarevsky 8ebd474c0e Merge pull request #3425 from StevenPuttemans:fix_firewire_buffersize 2014-11-16 18:06:20 +00:00
Vadim Pisarevsky 9086d6a230 Merge pull request #3427 from tstellarAMD:2.4-farneback-crash-fix 2014-11-16 18:05:17 +00:00
StevenPuttemans d9164bdd4c added extra BUFFERSIZE doc and getter 2014-11-14 14:09:43 +01:00
Tom Stellard 42b1bd56cc ocl: Move static oclMat variables into FarnebackOpticalFlow class
Move some static functions into the FarnebackOpticalFlow class as well,
so they can access these new class variables.

oclMat objects cannot be declared statically, because their destructor
depends on the statically defined __module variable from cl_context.cpp.
Since statically defined variables in separate compilation units have
an undefined destruction order there is always the possibility the
__module will be destructed before an oclMat object, which results
in a segfault.
2014-11-13 11:16:10 -05:00
Vadim Pisarevsky eedde323ce Merge pull request #3421 from SpecLad:ncv-algorithm 2014-11-13 15:40:29 +00:00
Roman Donchenko da6a38f9f6 NCV.cu: include <algorithm>
It's needed for std::max.
2014-11-13 16:16:26 +03:00
Vadim Pisarevsky 92e08c9863 Merge pull request #3412 from StevenPuttemans:ieee1934_camera_set_params 2014-11-13 07:27:33 +00:00
Vadim Pisarevsky 773e621190 Merge pull request #3414 from SpecLad:vg-stereogc 2014-11-13 07:20:30 +00:00
Alexander Alekhin d2f19a3a0d Merge pull request #3418 from tstellarAMD:2.4-hog-crash-fix 2014-11-13 01:49:06 +00:00
Samyak Datta a3f05474c9 C++ sample code to detect facial features 2014-11-12 23:35:02 +05:30
Maksim Shabunin 2d8673197c Merge pull request #3417 from ilya-lavrenov:dox_warn 2014-11-12 17:48:43 +00:00
Ilya Lavrenov d8ca61b01b attemp to fix dox warning 2014-11-12 19:18:45 +03:00
Tom Stellard ec335b7398 ocl: Fix crash during destruction of gauss_w_lut object in hog.cpp
gauss_w_lut is a statically defined variable of type oclMat.  The oclMat
destructor calls openCLFree() which via getInitializationMutex() accesses
the __module variable which has been statically defined in cl_context.cpp

Since the destruction order of statically defined variables in different
compilation units is undefined, it is possible that __module will
be destructed before gauss_w_lut, which would result in a segfault when
getInitializationMutex() is called while destructing gauss_w_lut.

In order to avoid this issue, we need to make gauss_w_lut a private
member of the HOGDescriptors class so we know it will be destroyed
before __module.
2014-11-12 10:07:07 -05:00
Roman Donchenko 7d8e5f623a Fix uninitialized memory reads and memory leaks in StereoGC 2014-11-12 17:00:08 +03:00
StevenPuttemans 2b8229f716 adding extra buffer parameter 2014-11-12 13:09:53 +01:00
Vadim Pisarevsky b80a3a91a8 Merge pull request #3401 from SpecLad:optflow-bogus-Warray-bounds 2014-11-11 13:27:41 +00:00
Roman Donchenko 13d67b6ae7 Suppress a bogus -Warray-bounds in modules/superres/src/optical_flow.cpp
This is actually the same warning that the suppression at the bottom
suppresses, but that one doesn't suppress it when using a native compiler
(go figure).

I remove the forced inclusion of precompiled headers into all sources,
since otherwise this workaround doesn't work - the header with the warning
is included before I can use a pragma.
2014-11-10 18:38:54 +03:00
Vadim Pisarevsky e05a0bc6c5 Merge pull request #3322 from StevenPuttemans:fix_pvpapi_interface 2014-11-10 08:27:42 +00:00
Vadim Pisarevsky 3da1144cef Merge pull request #3305 from tSed:opencv-2.4.x/opencv.pc-generation-refactoring 2014-11-06 08:41:07 +00:00
Vadim Pisarevsky b476bf2a00 Merge pull request #3294 from mshabunin:fix-ios-warnings-24 2014-11-05 11:35:19 +00:00
Vadim Pisarevsky 23b28a6700 Merge pull request #3376 from vriera:2.4 2014-11-05 11:13:03 +00:00
Samuel Martin eceada586b cmake/OpenCVGenPkgconfig.cmake: rework opencv.pc generation
Using absolute path to locate the components in the "Libs:" field of the
*.pc can badly break cross-compilation, especially when building
statically linked objects.

Indeed, pkg-config automatically replaces the '-I...' and '-L...' paths
when the PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR environment
variables are set [1]. This feature is very helpful and common in
cross-compilation framework like Buildroot [2,3].

When there are absolute paths in the *.pc files, pkg-config won't be
able to do the path substitions for these paths when the afromentioned
environment variables are set.
In such case, since the prefix is the target one, not the sysroot one,
these libraries' abolute paths will point to:
- in the best case: a non-existing file (i.e. these files do not exists
  on the host system;
- at worst: the host system's libraries. This will make the linking
  failed because these host system's libraries will most likely not be
  build for the target architecture [4].

So, this patch replace the components' absolute paths by the form:
  -L<libdir> -l<libname>

This way, the linker will be able to resolve each dependency path,
whatever the kind of objects/build (shared object or static build) it
is dealing with.

Note that for static link, the library order does matter [5]. The order
of the opencv components has been carefully chosen to comply with this
requirement.

Fixes #3931

[1] http://linux.die.net/man/1/pkg-config
[2] http://buildroot.org/
[3] http://git.buildroot.net/buildroot/tree/package/pkgconf/pkg-config.in
[4] http://autobuild.buildroot.net/results/e8a/e8a859276db34aff87ef181b0cce98916b0afc90/build-end.log
[5] http://stackoverflow.com/questions/45135/linker-order-gcc

Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
Note: this patch properly applies on top of the master branch, though it
      has been written on top of the 2.4 branch.
2014-11-05 11:32:11 +01:00
Alexander Smorkalov 67635c6d65 Version++. 2014-11-05 08:46:55 +03:00
Vladislav Vinogradov a26e496d00 minor fix for StereoCSBP data cost compute kernel and test
(cherry picked from commit 84f33d0578)
2014-11-04 10:19:38 +03:00
Vladislav Vinogradov d579d3e596 increase epsilons for some tests, which functions use floating point arithm
(cherry picked from commit 5c07e0b6d3)
2014-11-04 10:19:18 +03:00
Vladislav Vinogradov 5a77176654 avoid pointer arithmetic on register memory in color conversion
(cherry picked from commit e0827069c1)
2014-11-04 10:18:58 +03:00
Vadim Pisarevsky a28cde9c3b Merge pull request #3382 from StevenPuttemans:fix_3982 2014-10-31 11:18:24 +00:00
Vadim Pisarevsky 529af7a90e Merge pull request #3364 from mshabunin:doxygen-docs-24 2014-10-30 10:42:25 +00:00
StevenPuttemans 8bf58937a9 fixing SVM negative value rounding 2014-10-29 13:50:20 +01:00
StevenPuttemans 7dce2d0b8f fixing cap_pvpapi interface and making sure both AVT Manta and Proscilla
series are supported. Testing this with both cams for Windows and Linux
exhaustively.

Optimizing memory footprint by removing unused calls.

Adapted with the input of Shai

Added small example that illustrates how it should work.
2014-10-28 15:33:37 +01:00
Vicente Olivert Riera 2e393ab833 superres: Fix return value VideoFrameSource_GPU
superres module fails to compile with the following error messages:

[100%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/super_resolution.cpp.o
/opencv-2.4.10/modules/superres/src/frame_source.cpp: In function 'cv::Ptr<cv::superres::FrameSource> cv::superres::createFrameSource_Video_GPU(const string&)':
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected type-specifier before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: could not convert '(int*)operator new(4ul)' from 'int*' to 'cv::Ptr<cv::superres::FrameSource>'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected ';' before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:41: error: 'VideoFrameSource' was not declared in this scope
/opencv-2.4.10/modules/superres/src/frame_source.cpp:264:1: error: control reaches end of non-void function [-Werror=return-type]
cc1plus: some warnings being treated as errors
make[3]: *** [modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....

This is caused because the return value of the createFrameSource_Video_GPU function should be a VideoFrameSource_GPU object.
2014-10-27 13:39:35 +00:00
Maksim Shabunin 0c3722be82 iOS framework build script changes from master branch 2014-10-27 15:28:21 +03:00
Maksim Shabunin 09fb7512ed Fixed iOS framework compilation warnings 2014-10-27 15:28:21 +03:00
Maksim Shabunin b59aaae2dc iOS framework build script changes
- buildbot process support (break build in case of errors)
- disabled some warnings in cmake script
2014-10-27 15:28:05 +03:00
Maksim Shabunin d77088b19b Merge pull request #3336 from BKNio:putText_develop2 2014-10-27 11:56:25 +00:00
Dinar Ahmatnurov b5a6df4966 fixed issue with malformed UTF-8 string;
ocl: Change static variable order in cl_context.cpp to avoid crashes during destruction

ContextImpl::currentContext contains a reference to one of the
DeviceInfoImpl objects from:

static std::vector<DeviceInfoImpl> global_devices;

ContextImpl::currentContext is destroyed in the destructor
for the statically defined object __module, and relies on its
DeviceInfoImpl reference to query some hardware features while
being destroyed.

This means that we need to ensure that the global_devices vector is
destroyed affter __module, otherwise ContextImpl::currentContext's
DeviceInfoImpl reference will no longer be valid when __module is
destroyed.

Since these variables are all confined to a single compilation unit,
they will be destruct from bottom to top, so we need to make sure
that __module is the bottom definition so it can be destroyed first.

iOS: fix crash from overrelease in UIImageToMat

viz: fixed memory leak, issue 3961

fix installation layout for debian packages:

Install symlinks to shared libraries as a part of development package,
not runtime package.

It is default behavior for debian packages.

Fix test name.

TIFF loader: Allocate large enough buffer when (bpp * ncn) > 8.

TIFF loader: Pass buffer size to read functions.

replace not ascii and not cyrillic symbols with '?';

add test for putText;

fix warning;

minor fixes;
2014-10-27 12:47:53 +03:00
Vadim Pisarevsky 67e50b4415 Merge pull request #3362 from mshabunin:fix-drawing-24 2014-10-26 17:44:07 +00:00
Vadim Pisarevsky 0cf170587f Merge pull request #3363 from asmorkalov:qnx_support 2014-10-26 17:42:24 +00:00
Vadim Pisarevsky 0c2ccd3bae Merge pull request #3366 from jet47:fix-gpu-cuda-7.0 2014-10-26 17:41:14 +00:00
Vadim Pisarevsky 1692801fc5 Merge pull request #3356 from jet47:ctest-support 2014-10-26 17:40:35 +00:00
Vladislav Vinogradov 84f33d0578 minor fix for StereoCSBP data cost compute kernel and test 2014-10-23 19:33:44 +04:00
Vladislav Vinogradov 5c07e0b6d3 increase epsilons for some tests, which functions use floating point arithm 2014-10-23 19:33:42 +04:00
Vladislav Vinogradov e0827069c1 avoid pointer arithmetic on register memory in color conversion 2014-10-23 18:39:23 +04:00
Maksim Shabunin 9b55c09999 Basic doxygen documentation support
- updated existing Doxyfile.in
- added corresponding cmake instructions
- added some specific files (layout, icon)
- clean existing doxygen warnings

Conflicts:
	CMakeLists.txt
	doc/CMakeLists.txt
	modules/core/include/opencv2/core.hpp
	modules/core/include/opencv2/core/base.hpp
	modules/core/include/opencv2/core/cuda.inl.hpp
	modules/core/include/opencv2/core/mat.hpp
	modules/core/include/opencv2/core/matx.hpp
	modules/core/include/opencv2/core/types.hpp
	modules/flann/include/opencv2/flann/lsh_table.h
	modules/imgproc/include/opencv2/imgproc.hpp
2014-10-23 18:27:26 +04:00
Alexander Smorkalov 6bb6039ebb Fixes for QNX 6.6 Neitrino support. 2014-10-23 17:17:35 +04:00
Maksim Shabunin ba7c92b0e8 Fixed highgui drawing test
- changed image comparison technique
- removed old assert statements
2014-10-23 13:28:33 +04:00
Vladislav Vinogradov 4f8a1213bd determine test category (Public vs Extra) based on module location 2014-10-21 18:51:02 +04:00
Vladislav Vinogradov edf54ac3a9 add CTest targets for sanity tests 2014-10-21 18:50:38 +04:00
Vladislav Vinogradov f44c29ad7d disable CTest target for opencv_test_viz:
opencv_test_viz creates windows and waits until user close them,
it is not appropriate for automatic testing
2014-10-21 18:49:53 +04:00
Vladislav Vinogradov 0c57dc2e00 rewrite add_test command for accuracy tests:
* use new syntax introduced in CMake 2.8.0
* set OPENCV_TEST_DATA_PATH enviroment property
2014-10-21 18:48:46 +04:00
Vladislav Vinogradov 07bd58a0e8 turn on testing support in root binary directory 2014-10-21 18:45:47 +04:00
Vadim Pisarevsky 7bff337828 Merge pull request #3350 from Trundle:fix_some_tiff_crashes 2014-10-20 06:44:10 +00:00
Andreas Stührk 24580e348a TIFF loader: Pass buffer size to read functions. 2014-10-19 01:22:18 +02:00
Andreas Stührk cfdcf9f2d2 TIFF loader: Allocate large enough buffer when (bpp * ncn) > 8. 2014-10-19 01:22:04 +02:00
Andreas Stührk 63ac69cadf Fix test name. 2014-10-19 01:13:35 +02:00
Vadim Pisarevsky 263621aed8 Merge pull request #3341 from jet47:deb-package-lib-symlinks 2014-10-18 17:00:52 +00:00
Vadim Pisarevsky 40efd17be4 Merge pull request #3346 from Nerei:fixed_memory_leak_in_viz 2014-10-18 16:57:55 +00:00
Anatoly Baksheev 0f2b7fbc45 viz: fixed memory leak, issue 3961 2014-10-18 18:12:36 +04:00
Vadim Pisarevsky 1ce31dcd62 Merge pull request #3340 from AdLantis:2.4 2014-10-17 11:36:24 +00:00
Vladislav Vinogradov f55c1cc0fb fix installation layout for debian packages:
Install symlinks to shared libraries as a part of development package,
not runtime package.

It is default behavior for debian packages.
2014-10-17 13:23:23 +04:00
Thomas Weisbach 81c0537b0c iOS: fix crash from overrelease in UIImageToMat 2014-10-17 17:49:14 +09:00
Vadim Pisarevsky 32f978ff4b Merge pull request #3337 from tstellarAMD:2.4-ocl-context-cleanup-fix 2014-10-16 10:07:13 +00:00
Tom Stellard 8f3b876ee6 ocl: Change static variable order in cl_context.cpp to avoid crashes during destruction
ContextImpl::currentContext contains a reference to one of the
DeviceInfoImpl objects from:

static std::vector<DeviceInfoImpl> global_devices;

ContextImpl::currentContext is destroyed in the destructor
for the statically defined object __module, and relies on its
DeviceInfoImpl reference to query some hardware features while
being destroyed.

This means that we need to ensure that the global_devices vector is
destroyed affter __module, otherwise ContextImpl::currentContext's
DeviceInfoImpl reference will no longer be valid when __module is
destroyed.

Since these variables are all confined to a single compilation unit,
they will be destruct from bottom to top, so we need to make sure
that __module is the bottom definition so it can be destroyed first.
2014-10-14 20:54:13 -04:00
Vadim Pisarevsky 6b0cd392f0 Merge pull request #3331 from tSed:opencv-2.4.x/fix-x86-PIC-compilation 2014-10-12 13:42:38 +00:00
Samuel Martin ea50be0529 core: fix x86 PIC code compilation
This bug was triggered by Buildroot autobuilders [1,2], causing this
kind of failures [3,4]:

  [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
  /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp: In function '(static initializers for /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp)':
  /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an 'asm'
  make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1

[1] http://buildroot.org/
[2] http://autobuild.buildroot.org/
[3] http://autobuild.buildroot.org/?reason=opencv-2.4.10
[4] http://autobuild.buildroot.org/results/483/4838285b25d6293a5cf0bb9eadd5040a7c75d766/build-end.log

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
2014-10-12 12:45:20 +02:00
Vadim Pisarevsky b11b08b478 Merge pull request #3265 from BKNio:putText_develop 2014-10-11 18:06:25 +00:00
Vadim Pisarevsky a5e89bf724 Merge pull request #3329 from taka-no-me:patch-1 2014-10-11 17:41:23 +00:00
Vadim Pisarevsky 0d196529f7 Merge pull request #3300 from rohitrawat:bug_3787_docs_NAryMatIterator 2014-10-11 17:35:51 +00:00
Vadim Pisarevsky 77b57459c4 Merge pull request #3327 from JonasVautherin:patch_cmake_android_r10 2014-10-11 17:26:19 +00:00
Andrey Kamaev 5dde172452 silence cmake 3.0+ warnings on LOCATION attribute 2014-10-11 20:35:48 +04:00
Jonas Vautherin d83372a8dc Patch for NDK r10 2014-10-10 15:16:51 +02:00
Dinar Ahmatnurov 5a797ae7de fix issue with font; 2014-10-10 17:11:20 +04:00
Vadim Pisarevsky ff8e32453b Merge pull request #3307 from ilya-lavrenov:ffmpeg_rtsp 2014-10-10 11:02:50 +00:00
Ilya Lavrenov fb2012def2 TCP instead of UDP 2014-10-09 19:23:51 +04:00
Vadim Pisarevsky d7ba03a9cb Merge pull request #3298 from a-wi:DShow_capture 2014-10-09 15:00:25 +00:00
Vadim Pisarevsky 1e744bf5b1 Merge pull request #3309 from nisargthakkar:Thickness1NoLineCV_AA 2014-10-09 14:42:44 +00:00
Vadim Pisarevsky 8364ea3954 Merge pull request #3311 from BarneyBear:2.4-drawMatches-flag-fix 2014-10-09 14:20:23 +00:00
Vadim Pisarevsky c24e6f7ae9 Merge pull request #3316 from nisargthakkar:Bug3887 2014-10-09 14:19:12 +00:00
Vadim Pisarevsky ed2fb773cd Merge pull request #3319 from Trundle:tiff_infinite_rowsperstrip 2014-10-09 14:15:03 +00:00
Andreas Stührk afb164cc15 Don't allocate lots of memory when reading TIFFs with infinite rows per strip.
Some TIFF images consist of only one strip. The magic value 2**32-1 for the
"rows per strip" tag reflects that fact, effectively meaning "infinite".
2014-10-08 23:31:30 +02:00
Nisarg Thakkar 474897ff01 Made some changes specefict to 4 channel images. Fixed step value for tptr 2014-10-08 22:08:14 +05:30
Nisarg Thakkar 29fb2b6e47 Fixed doc for Bug #3887
Fixed doc for Bug #3887
2014-10-08 19:52:35 +05:30
Niklas Frisk af72e6b8f4 Fixes #3910, flags in _prepareImgAndDrawKeypoints are now binary OR'ed instead of added. 2014-10-07 09:40:56 +02:00
Samuel Martin 38bb0db9db cmake: fix gstreamer check conditions
The current situation of the Gstreamer detection does not always honor
all the configurations set by the user, among this:
- if both WITH_GSTREAMER and WITH_GSTREAMER_0_10 are off, but
  Gstreamer 0.10 is installed in the system, Gstreamer 0.10 support will
  be enable;
- if both WITH_GSTREAMER and WITH_GSTREAMER_0_10 are on, only checks for
  Gstreamer 0.10 will be run.

This patch fixes the Gstreamer detection like this:

  |        -DWITH_...          | Package installed  ||    OpenCV    |
  | GSTREAMER | GSTREAMER_0_10 | gst-1.x | gst-0.10 || gst. support |
  +===========+================+=========+==========##==============+
  |    OFF    |      OFF       |    -    |    -     ||     none     |
  |    OFF    |      ON        |    -    |    no    ||     none     |
  |    OFF    |      ON        |    -    |   yes    ||   gst-0.10   |
  |    ON     |      OFF       |    no   |    no    ||     none     |
  |    ON     |      OFF       |    no   |   yes    ||   gst-0.10   |
  |    ON     |      OFF       |   yes   |    -     ||    gst-1.x   |
  |    ON     |      ON        |   yes   |    -     ||    gst-1.x   |

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
2014-10-06 21:40:55 +02:00
Rohit Rawat 2ad8c6dbd0 Fixing bug in NAryMatIterator documentation(Bug #3787).
Fixed the non-working code example for NAryMatIterator.
The documentation of NAryMatIterator in file:
modules/core/include/opencv2/core/core.hpp has a working example which
was used for these edits.
2014-10-02 18:48:31 -05:00
Artur Wieczorek 5c96021172 Fixed getting CV_CAP_PROP_FOURCC property value
Save selected FCC in order to return proper CV_CAP_PROP_FOURCC property value (currently FCC for RGB24 is always returned).
2014-10-02 21:41:54 +02:00
Artur Wieczorek 4b1bb702ce Fixed media type GUID for I420 format in DShow capture.
FOURCC code bytes should be placed in the reverse order.
2014-10-02 13:07:50 +02:00
Maksim Shabunin a77a2f357c Merge pull request #3297 from asmorkalov:ocv_docs_fix 2014-10-02 10:56:08 +00:00
Artur Wieczorek 7e78b5d06e Fixed selecting media type in DShow video capture.
Set correct value of sample size when calling IAMStreamConfig::SetFormat function. For non-RGB media type it can be set to zero value.
(See http://msdn.microsoft.com/en-us/library/windows/desktop/dd373477%28v=vs.85%29.aspx)
2014-10-02 12:08:37 +02:00
Alexander Smorkalov 11c81067dc doc/check_docs2.py warnings fixes 2014-10-02 13:40:30 +04:00
Andrey Pavlenko 7018f94959 Merge pull request #3288 from StevenPuttemans:fix_ts_dependencies 2014-10-01 07:33:36 +00:00
Andrey Pavlenko 533fde66e3 Merge pull request #3281 from a-wi:MSMF_remove_ATL_dependency 2014-10-01 07:26:25 +00:00
Andrey Pavlenko 5bd18155be Merge pull request #3290 from asmorkalov:android_disable_fisheye.rectify_for_tegra 2014-10-01 07:26:04 +00:00
Andrey Pavlenko aa6b5ac124 Merge pull request #3291 from asmorkalov:android_superres_video_check 2014-10-01 07:25:15 +00:00
Alexander Smorkalov ca40a749b6 Turn off superres accuracy tests if video i/o is not supported. 2014-10-01 09:15:24 +04:00
Roman Donchenko d54d580f79 Merge pull request #3275 from asmorkalov:ocv_gstreamer_backport 2014-09-30 15:55:26 +00:00
Roman Donchenko 774d6c1d0a Merge pull request #3285 from asmorkalov:android_servive_big.little_fix 2014-09-30 15:19:07 +00:00
Roman Donchenko 302d80d744 Merge pull request #3287 from asmorkalov:android_manager_version_inc5 2014-09-30 14:44:36 +00:00
Alexander Smorkalov 286c6b496d OpenCV Manager hardware detector workaround for not detected ARM SoC support. 2014-09-30 18:43:11 +04:00
Maksim Shabunin 44da1f795f Merge pull request #3282 from asmorkalov:android_exclude_ocl 2014-09-30 10:53:16 +00:00
Alexander Smorkalov 71c4e96e17 Test fisheye.rectify disabled for Tegra. 2014-09-30 14:49:33 +04:00
StevenPuttemans 60fd5c2a3a fixing dependencies 2014-09-30 11:53:46 +02:00
Alexander Smorkalov 8271c4e9c4 Highgui_Video.prop_fps disabled as fails with FFmpeg in Ubuntu 14.04. 2014-09-30 13:35:19 +04:00
Alexander Smorkalov 1f4fe3bb27 GStreamer 1.0 backport from master branch. 2014-09-30 12:30:09 +04:00
Alexander Smorkalov a0431acb37 OpenCV Manager version++. 2014-09-30 12:05:46 +04:00
Artur Wieczorek e3f1d722e7 Remove ATL dependency from MSMF capture code
Use _com_ptr_t instead of CComPtr in ComPtr wrapper to avoid ATL dependency.
2014-09-30 01:35:59 +02:00
Alexander Smorkalov 1c3c94fd2c Exclude OpenCL tests from default test list for Android as they are experimental. 2014-09-29 20:45:12 +04:00
Roman Donchenko 45a1063c4a Merge pull request #3263 from asmorkalov:python_tests_package_lintian 2014-09-29 14:53:02 +00:00
Alexander Smorkalov 1cc80f10ba Added implicit dependency from python and python-py to debian packages. 2014-09-29 17:43:54 +04:00
Maksim Shabunin a160158cb3 Merge pull request #3272 from mgeorg:reset_ffmpeg_mutex_2_4 2014-09-29 12:07:22 +00:00
Vadim Pisarevsky 6a53cb9307 Merge pull request #3266 from mshabunin:arm_warning 2014-09-27 13:06:44 +00:00
Vadim Pisarevsky 1920232268 Merge pull request #3260 from a-wi:MSMF_file_error 2014-09-27 13:06:18 +00:00
Manfred Georg 7f4eb4f6c6 set ffmpeg mutex to NULL on destruction.
The Mutex manager registered with ffmpeg must reset the mutex to NULL after destruction, otherwise ffmpeg will give the invalid mutex to the next mutex manager when it asks it to CREATE a new mutex.
See ffmpeg code: http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/utils.c;h=28c5785398fcf11a3d3c70a8cd09e9df798e2734;hb=HEAD#l3423

Cherry picked from head (file has moved but issue is the same).
Conflicts:
	modules/videoio/src/cap_ffmpeg_impl.hpp
2014-09-26 10:19:34 -07:00
Dinar Ahmatnurov de6edcc48a fixing issue with "ёЁ"; 2014-09-26 11:32:14 +04:00
Maksim Shabunin e88a36621e Fixed warning during cross compile for ARM 2014-09-25 12:27:48 +04:00
Dinar Ahmatnurov e9f7c4aeba added Cyrillic;
added Cyrillic;

replace binary format with hex;

move duplicated code to inline function;
2014-09-25 11:15:20 +04:00
Vadim Pisarevsky 467f5fc90f Merge pull request #3261 from a-wi:CMake_FFMPEG_config 2014-09-24 17:03:08 +00:00
Vadim Pisarevsky ad018da224 Merge pull request #3262 from StevenPuttemans:fix_window_param 2014-09-24 12:22:20 +00:00
StevenPuttemans 90a1c6b1f0 fixing some wrong CPP prefixes - still old interface 2014-09-24 09:33:22 +02:00
Artur Wieczorek 93d1ceae43 Use FFMPEG capture only if HAVE_FFMPEG flag is defined. 2014-09-24 02:11:59 +02:00
Artur Wieczorek 073a7ff95a Fixed CMake issue with FFMPEG highgui configuration
Currently, FFMPEG source files are included in highgui project file regardless of CMake WITH_FFMPEG option.
After applying this PR FFMPEG files are included only if WITH_FFMPEG option is enabled.
2014-09-23 23:46:03 +02:00
Artur Wieczorek 5bf1a4c08c Fixed MSMF file capture error while opening the file containing unsupported video stream format 2014-09-23 20:21:53 +02:00
Vadim Pisarevsky 562ff9d111 Merge pull request #3255 from bhack:fix_cuda_macosx 2014-09-23 15:40:23 +00:00
bhack 32f6e1a554 Fix for bug #3469 CV_XADD failing in clang+nvcc combination
Taken from 3f07655231
2014-09-23 12:39:16 +02:00
Vadim Pisarevsky 10bbcca11e Merge pull request #3251 from a-wi:MSMF_camera_errors 2014-09-23 08:42:57 +00:00
Vadim Pisarevsky 19b3aab23f Merge pull request #3244 from tstellarAMD:2.4-ocl-inline-fix-v2 2014-09-23 07:19:38 +00:00
Vadim Pisarevsky df28bb5ccd Merge pull request #3190 from StevenPuttemans:fix_simpleblobdetector 2014-09-23 07:18:01 +00:00
StevenPuttemans d4ec359f11 Fixing errors 2014-09-22 22:12:27 +02:00
Artur Wieczorek 3603102c89 Fixed assertion warning in MSMF frame grabber 2014-09-22 19:38:04 +02:00
Artur Wieczorek a615102947 Fixed MSMF video capture initialization 2014-09-22 19:35:36 +02:00
Vadim Pisarevsky 9c91d0103f Merge pull request #3247 from a-wi:CMake_MSMF_configuration 2014-09-22 15:31:09 +00:00
Vadim Pisarevsky 37a1767286 Merge pull request #3243 from a-wi:MSMF_linking_error 2014-09-22 15:29:32 +00:00
StevenPuttemans 03662c0589 fix blobdetector 2014-09-22 13:58:45 +02:00
Artur Wieczorek 7c354c14f7 CMake configuration for MSMF capture 2014-09-21 21:03:41 +02:00
Artur Wieczorek d2ba09e6ff Fix linking error under Win 7 - do not import MinCore_Downlevel.lib if target is Win 7 or earlier. 2014-09-19 22:46:09 +02:00
Tom Stellard 934394c5e2 ocl: Don't use 'inline' attribute on functions
In C99 'inline' is not a hint to the compiler to inline the function,
it is an attribute that affects the linkage of the function.  'inline'
functions are required to have a definition in a different compiliation
unit, so compilers are free to delete 'inline' functions if they want to.

This issue can be seen in Clang when compiling at -O0.  Clang
will sometimes delete 'inline' functions which creates an invalid
program.

Issue 3746: http://code.opencv.org/issues/3746
2014-09-19 16:13:57 -04:00
Vadim Pisarevsky 6c3cadbd73 Merge pull request #3240 from a-wi:MSMF_compilation_errors 2014-09-19 17:36:13 +00:00
Vadim Pisarevsky 4dda2002f6 Merge pull request #3241 from WilhelmHannemann:bugfix_brute_force_match_cl 2014-09-19 17:35:07 +00:00
Artur Wieczorek 539f8032dc Fixed compilation errors under VS 2010 and Win 7 2014-09-19 17:07:52 +02:00
WilhelmHannemann f8c5128729 Merge branch 'bugfix_brute_force_match_cl' of https://github.com/WilhelmHannemann/opencv into bugfix_brute_force_match_cl 2014-09-19 16:42:59 +02:00
WilhelmHannemann 150487feda Bugfix brute_force_match.cl (see http://code.opencv.org/issues/2837): wrong results for non-float descriptors in OpenCL BruteForceMatcher 2014-09-19 16:41:54 +02:00
WilhelmHannemann b767613d20 Bugfix brute_force_match.cl (Bug #2837): wrong results for non-float descriptors in OpenCL BruteForceMatcher 2014-09-19 16:31:11 +02:00
Vadim Pisarevsky 197b2e75e1 Merge pull request #3238 from vpisarev:bfmatcher_fix 2014-09-19 13:21:05 +00:00
Vadim Pisarevsky 3516e14e05 Merge branch 'bug_3172' of https://github.com/elmarb/opencv into bfmatcher_fix;
use different fix for the problem, embedded right into the BFMatcher.
2014-09-19 15:31:21 +04:00
E Braun d82b918a7b fix for bug 3172 2014-09-19 14:47:43 +04:00
E Braun f60726b090 Revert "fix for bug 3172"
This reverts commit ed2cdb71e5.
2014-09-19 14:47:43 +04:00
E Braun 1675b23a64 fix for bug 3172 2014-09-19 14:47:43 +04:00
E Braun aa9da6e433 regression test for bug 3172 2014-09-19 14:47:43 +04:00
Vadim Pisarevsky 772f6208db Merge pull request #3235 from Atanahel:gbt_bugfix 2014-09-19 09:42:01 +00:00
Vadim Pisarevsky 0cf1de8eea Merge pull request #3236 from vpisarev:fix_traincascade 2014-09-18 17:45:28 +00:00
Stephen Mell 5947519ff4 Check sure that we're not already below required leaf false alarm rate before continuing to get negative samples. 2014-09-18 16:54:22 +04:00
Benoit Seguin 084835ec30 Fixing a line where integer data was treated as floating point data. 2014-09-18 14:03:13 +02:00
Vadim Pisarevsky a67484668e Merge pull request #2711 from GregoryMorse:patch-5 2014-09-18 11:28:58 +00:00
Vadim Pisarevsky 26fd37b27d Merge pull request #3212 from mshabunin:python_cross_build_2.4 2014-09-18 08:57:32 +00:00
Vadim Pisarevsky ccaedaedc8 Merge pull request #2047 from GregoryMorse:patch-4 2014-09-17 12:48:45 +00:00
Vadim Pisarevsky c5de129c36 Merge pull request #3222 from dmitrygribanov:dg/2.4-stitching-wave-correction-bugfix 2014-09-17 10:54:02 +00:00
Vadim Pisarevsky 533dd85299 Merge pull request #3225 from jormansa:bug_#3631 2014-09-17 10:40:42 +00:00
Vadim Pisarevsky 48dc18ed59 Merge pull request #3228 from PhilLab:patch-4 2014-09-17 09:50:09 +00:00
Philipp Hasper bac492fff6 Doc: Fixing indentation 2014-09-17 09:30:19 +02:00
jormansa 1d2d579bd6 bug fixed 2014-09-15 18:09:44 +02:00
Andrey Pavlenko 80687c8a56 Merge pull request #3219 from mshabunin:png_iccp_strip_24 2014-09-15 13:54:19 +00:00
Dmitry Gribanov 8a1d3929cc Feature based stitching's wave correction bugfix.
When we have similar matrices in input, then algorithm returns matrices
with NaN values.
2014-09-15 17:04:08 +04:00
Alexander Alekhin 281ce7a054 Merge pull request #3221 from asmorkalov:ocv_2.4.10_version_inc 2014-09-15 11:12:02 +00:00
Alexander Smorkalov 343f4b3026 OpenCV version++. 2014-09-15 14:55:25 +04:00
Maksim Shabunin 882426a9b2 Stripped iCCP chunk from png files 2014-09-15 12:48:28 +04:00
Vadim Pisarevsky cf15b9e8ad Merge pull request #3204 from parafin:ximea_unix-2.4 2014-09-14 18:44:23 +00:00
Vadim Pisarevsky f4f7522fe7 Merge pull request #3202 from parafin:bug_3858-2.4 2014-09-14 18:43:48 +00:00
Maksim Shabunin 1b4e3ec35a Changed cmake python library search startegy for crosscompiling 2014-09-12 13:44:16 +04:00
GregoryMorse b9d5f3f6e9 Add support for WinRT in the MF capture framework by removing the disallowed calls to enumerate devices and create a sample grabber sink and adding framework for the MediaCapture interface and a custom sink which interfaces with the sample grabber callback interface. The change requires discussion for making it completely functional as redundancy is required given that if the source is a video file, the old code pathways must be used. Otherwise all IMFMediaSession, IMFMediaSource, and IMFActivate code must use a MediaCapture code path and all sink code must use the CMediaSink custom sink.
Support for the custom sink is extended to non-WinRT not for compatibility as Windows Vista client is a minimum regardless, but because it offers more flexibility, could be faster and is able to be used as an optionally different code path during sink creation based on a future configuration parameter.

My discussion and proposal to finish this change:
 Devices are so easily enumerated through WinRT Windows.Devices namespace that wrapping the calls in a library is quite a chore for little benefit though to get the various modes and formats could still be a worthwhile project. For now conditional compilation to remove videodevices and any offending non-video file related activity in videodevice. In my opinion, this is a different , far less fundamental and important change which can possibly be done as a future project and also much more easily implemented in C++/CX.

ImageGrabber has the IMFSampleGrabberSinkCallback replaced with a base class (SharedSampleGrabber) which also be is base class for ImageGrabberRT. This change is necessary as the custom sink does not require a thread to pump events which is done through MediaCapture already. IMFSampleGrabberSinkCallback is the common element between both models and that piece can be shared. Initializing the new ImageGrabberRT is as simple as passing an already initialized MediaCapture object and any video format/encoding parameters.

The concurrency event is necessary to wait for completion and is the way the underlying, IAsyncAction wrappers in the task library work as well. Native WIN32 event objects would be an option if HAVE_CONCURRENCY is not defined. I could even imagine doing it with sleep/thread yield and InterlockedCompareExchange yet I am not enthusiastic about that approach either. Since there is a specific compiler HAVE_ for concurrency, I do not like pulling it in though I think for WinRT it is safe to say we will always have it available though should probably conditionally compile with the Interlocked option as WIN32 events would require HAVE_WIN32.

It looks like C++/CX cannot be used for the IMediaExtension sink (which should not be a problem) as using COM objects requires WRL and though deriving from IMediaExtension can be done, there is little purpose without COM. Objects from C++/CX can be swapped to interact with objects from native C++ as Inspectable* can reinterpret_cast to the ref object IInspectable^ and vice-versa. A solution to the COM class with C++/CX would be great so we could have dual support. Also without #define for every WRL object in use, the code will get quite muddy given that the */^ would need to be ifdef'd everywhere.

Update cap_msmf.cpp

Fixed bugs and completed the change.  I believe the new classes need to be moved to a header file as the file has become to large and more classes need to be added for handling all the asynchronous problems (one wrapping IAsyncAction in a task and another for making a task out of IAsyncAction).  Unfortunately, blocking on the UI thread is not an option in WinRT so a synchronous architecture is considered "illegal" by Microsoft's standards even if implementable (C++/CX ppltasks library throws errors if you try it).  Worse, either by design or a bug in the MF MediaCapture class with Custom Sinks causes a crash if stop/start previewing without reinitializing (spPreferredPreviewMediaType is fatally nulled).  After decompiling Windows.Media.dll, I worked around this in my own projects by using an activate-able custom sink ID which strangely assigns 1 to this pointer allowing it to be reinitialized in what can only be described as a hack by Microsoft.  This would add additional overhead to the project to implement especially for static libraries as it requires IDL/DLL exporting followed by manifest declaration.  Better to document that it is not supported.

Furthermore, an additional class for IMFAttributes should be implemented to make clean architecture for passing around attributes as opposed to directly calling non-COM interface calls on the objects and making use of SetProperties which would also be a set up for an object that uses the RuntimeClass activation ID.

The remaining changes are not difficult and will be complete soon along with debug tracing messages.

Update and rename cap_msmf.h to cap_msmf.hpp

Successful test - samples are grabbed

Library updated and cleaned up with comments, marshaling, exceptions and linker settings
Fixed trailing whitespace

VS 2013 support and cleanup consistency plus C++/CX new object fixed

VS 2013 Update 2 library bug fix integrated

Various minor cleanup

Create agile_wrl.h

a-wi's changes integrated

Update cap_msmf.hpp

Update cap_msmf.cpp

Regression test fixes and simplifications
2014-09-10 17:21:38 +08:00
GregoryMorse 587402859e Add VS2013 support
Fix indentation in output that made it look like changes were dependent on WinRT when they are independent libraries.

Defaults needed flipping otherwise undesired behavior.  Change is tested with combinations.

Fixed and tested

Windows Phone v8.0/v8.1 SDK for Universal Windows Apps (Windows Phone v8.1 Silverlight App support not included) and fix initial cache causing problem
2014-09-10 17:18:41 +08:00
Igor Kuzmin 0421da78b3 XIMEA cam support: allow on OS X too 2014-09-09 19:17:13 +04:00
Igor Kuzmin b027a84fa1 XIMEA cam support: use correct library for 64 bit Linux 2014-09-09 19:15:03 +04:00
Igor Kuzmin fbbf4e380f fix for issue 3858 (remove unneeded #include's)
also use correct include path on Linux
2014-09-09 19:10:05 +04:00
Vadim Pisarevsky faed8f43d6 Merge pull request #3194 from stonier:2.4 2014-09-09 06:33:15 +00:00
Vadim Pisarevsky 9a15c7a899 Merge pull request #3197 from asmorkalov:python_tests_package 2014-09-09 06:31:18 +00:00
Alexander Smorkalov 35768ed638 Python tests added to -tests deb package. 2014-09-08 18:11:12 +04:00
Daniel Stonier 161f50962d make sure children are included in the moveToThread 2014-09-08 04:31:37 +09:00
Daniel Stonier e638b9e805 support invokation of cv windows from parallel threads to an external qt application. 2014-09-08 03:19:56 +09:00
Roman Donchenko d7737528d1 Merge pull request #3156 from sergregory:CreateSamplesMod 2014-09-05 09:49:55 +00:00
Grigory Serebryakov 18c0511d3c Warning on converting int to bool fixed 2014-09-05 11:27:43 +04:00
Grigory Serebryakov 06a1c90679 Include for cvSameImage corrected 2014-09-05 10:45:54 +04:00
Alexander Smorkalov e929dd4d98 GPU MatchTemplate32F test epsilon increased. 2014-09-02 20:24:49 +04:00
E Braun bdb82d181f fix for bug 3172 2014-09-02 18:05:23 +02:00
Vladislav Vinogradov 10a2c51c52 fix OpenCVConfig.cmake template - missing parentheses
(cherry picked from commit 67b562d543)
2014-09-02 19:30:35 +04:00
Alexander Smorkalov 4664a339ae Fix non-Android cross compilation with OpenCVConfig.cmake
(cherry picked from commit e8376c789d)
2014-09-02 19:29:59 +04:00
Vladislav Vinogradov fb81e4df1c fix CUDA cvtColor after corresponding change in CPU version
see https://github.com/Itseez/opencv/pull/3137
(cherry picked from commit ebe36d6e7c)
2014-09-02 16:48:20 +04:00
E Braun 89833853fa Revert "fix for bug 3172"
This reverts commit ed2cdb71e5.
2014-09-02 13:56:13 +02:00
Alexander Karsakov cb1e9adc63 Fixed getConversionInfo() for YUV2RGBA_* conversions
(cherry picked from commit 023a42ba55)
2014-09-02 15:05:13 +04:00
Vladislav Vinogradov 562796e41b fix cv::gpu::resize for INTER_LINEAR, now it produces the same result as CPU version
(cherry picked from commit da9be8231f)
2014-09-02 13:17:47 +04:00
Alexander Smorkalov bb93c53948 OpenCV version++. 2014-09-02 11:54:54 +04:00
Alexander Karsakov 00575b346d Fixed range for 'v' channel for 8U images.
(cherry picked from commit b027eac173)
2014-09-02 11:41:08 +04:00
Grigory Serebryakov 25d125fba1 Documentation update: createsamples usage 2014-09-02 10:55:45 +04:00
Vladislav Vinogradov 7316676c41 fix CUDA LUT implementation
In CUDA 6.0 there was a bug in NPP LUT implementation (invalid results when
src == 255). In CUDA 6.5 the bug was fixed.

Replaced NPP LUT call with own implementation (ported from master branch)
to be independant from CUDA Toolkit version.
(cherry picked from commit eaaa2d27d5)
2014-09-02 08:34:42 +04:00
Grigory Serebryakov d1229efeec No output image resize in case of PNG dataset 2014-09-01 13:02:27 +04:00
Vadim Pisarevsky fd7a2defae Merge pull request #3178 from jimcamel:freak_sse_bugfix 2014-09-01 06:15:36 +00:00
Adrian Clark fcc481e751 Fixed crash in SSE implementation of FREAK descriptor when number of pairs is set to something other than 512.
See http://code.opencv.org/issues/3889 for more details
2014-09-01 09:37:33 +12:00
Vadim Pisarevsky 1984aacb27 Merge pull request #3164 from jet47:fix-cuda-lut 2014-08-29 08:11:29 +00:00
Vladislav Vinogradov eaaa2d27d5 fix CUDA LUT implementation
In CUDA 6.0 there was a bug in NPP LUT implementation (invalid results when
src == 255). In CUDA 6.5 the bug was fixed.

Replaced NPP LUT call with own implementation (ported from master branch) 
to be independant from CUDA Toolkit version.
2014-08-28 14:47:26 +04:00
Alexander Smorkalov 77585bf8af Several fixes for lintian varnings
(cherry picked from commit 634ffed488)
2014-08-27 16:44:18 +04:00
Vladislav Vinogradov c821cb1489 fix BGR->BGR5x5 color convertion
(cherry picked from commit 62f27b28ed)
2014-08-27 16:44:18 +04:00
Vladislav Vinogradov 86c1babd03 use downscaled frames in FGDStatModel test
(cherry picked from commit 599f5ef51b)
2014-08-27 16:44:18 +04:00
Vladislav Vinogradov 2205b2f5bc increase epsilon for ResizeSameAsHost test
(cherry picked from commit 86e12b6074)
2014-08-27 16:44:18 +04:00
Vladislav Vinogradov 975e40f1c0 increase epsilon for TVL1 sanity test
(cherry picked from commit 5dff283b39)
2014-08-27 16:44:18 +04:00
Grigory Serebryakov 74d8527f8a Naming fixes and code beautification 2014-08-27 12:41:18 +04:00
Grigory Serebryakov 57cf3d1766 Class naming update
Documentation improvement
Bug in output format for JPG set fixed
2014-08-26 10:02:50 +04:00
Grigory Serebryakov f81b3101e8 Typo in string fixed 2014-08-25 18:46:23 +04:00
Grigory Serebryakov 81aefed13a Can create training set in PNG format
The format of the training set can be changed with the `-pngoutput` key.
Output image will be resized to a 640x480 size if greater.
2014-08-25 18:14:27 +04:00
Vadim Pisarevsky 41040e589f Merge pull request #3147 from asmorkalov:ocv_deb_lintian_fixes 2014-08-22 11:49:52 +00:00
Vadim Pisarevsky 6eb26c1519 Merge pull request #3109 from jet47:gpu-test-fixes 2014-08-22 07:22:23 +00:00
Vadim Pisarevsky ad7a871708 Merge pull request #3143 from jet47:cuda-cvt-color-fix 2014-08-22 07:21:46 +00:00
Alexander Smorkalov 634ffed488 Several fixes for lintian varnings 2014-08-22 10:53:33 +04:00
Vladislav Vinogradov ebe36d6e7c fix CUDA cvtColor after corresponding change in CPU version
see https://github.com/Itseez/opencv/pull/3137
2014-08-21 14:14:06 +04:00
Vadim Pisarevsky d68e62c968 Merge pull request #3137 from akarsakov:fix_cvtcolor_luv_rgb 2014-08-21 05:39:18 +00:00
Alexander Karsakov b027eac173 Fixed range for 'v' channel for 8U images. 2014-08-20 11:09:21 +04:00
Vadim Pisarevsky 2ed24876af Merge pull request #3120 from StevenPuttemans:fix_bug3863 2014-08-18 15:39:30 +00:00
Vadim Pisarevsky b08a6ccd9d Merge pull request #3118 from akarsakov:fix_cvtcolor_perf 2014-08-18 12:45:35 +00:00
StevenPuttemans d558260a8e fixing GT and GE comparison symbol 2014-08-18 13:33:40 +02:00
Alexander Karsakov 023a42ba55 Fixed getConversionInfo() for YUV2RGBA_* conversions 2014-08-18 13:01:19 +04:00
Vadim Pisarevsky 7409f21e9f Merge pull request #3108 from LeszekSwirski:fix-gemm-buf-allocate-2.4 2014-08-16 06:03:28 +00:00
Vladislav Vinogradov 62f27b28ed fix BGR->BGR5x5 color convertion 2014-08-15 14:10:15 +04:00
Vladislav Vinogradov 599f5ef51b use downscaled frames in FGDStatModel test 2014-08-15 13:42:25 +04:00
Vladislav Vinogradov 86e12b6074 increase epsilon for ResizeSameAsHost test 2014-08-15 13:42:06 +04:00
Vladislav Vinogradov 5dff283b39 increase epsilon for TVL1 sanity test 2014-08-15 13:41:47 +04:00
Leszek Swirski 341c3d5933 Fix reallocation of D buffer in gemm
Conflicts:
	modules/core/src/matmul.cpp
2014-08-15 09:57:46 +01:00
Alexander Smorkalov 628b23acc8 GCC 4.8 warning array subscript is above array bounds fixed.
(cherry picked from commit e11333dd83)
2014-08-15 10:20:31 +04:00
Vadim Pisarevsky 988555a5d9 Merge pull request #3093 from asmorkalov:ocv_array_bound_fix 2014-08-13 14:08:51 +00:00
Alexander Smorkalov e11333dd83 GCC 4.8 warning array subscript is above array bounds fixed. 2014-08-13 17:12:08 +04:00
Vadim Pisarevsky af2434c547 Merge pull request #2827 from Alexander-Petrikov-ELVEES-NEOTEK:neon-stereobm 2014-08-13 13:04:02 +00:00
Vadim Pisarevsky a4c883c098 Merge pull request #3076 from vpisarev:fix_small_filters 2014-08-11 16:10:15 +00:00
Aleksandr Petrikov 0a531815c5 fix bug 3733 for imgproc/filter.cpp 2014-08-11 16:00:21 +04:00
Vadim Pisarevsky a15db2d9cf Merge pull request #3058 from PhilLab:patch-2 2014-08-11 11:10:17 +00:00
PhilLab efc1c39315 Fixed self-assignment in cv::Ptr::operator =
A self-assignment leads to a call of release() with refcount being 2. In the release() method, refcount is decremented and then successfully checked for being 1. As a consequence, the underlying data is released. To prevent this, we test for a self-assignment
2014-08-08 17:39:12 +02:00
Vadim Pisarevsky 3334b1437b Merge pull request #3046 from StevenPuttemans:fix_Qt_locale 2014-08-07 06:40:38 +00:00
StevenPuttemans 34103ef1cb fixing setting the locale back to what should be expected
fix should be applyed for every window interface and generation
2014-08-05 16:20:08 +02:00
Vadim Pisarevsky e7f348e720 Merge pull request #3026 from jet47:fix-gpu-resize-linear 2014-08-02 21:52:51 +00:00
Vladislav Vinogradov da9be8231f fix cv::gpu::resize for INTER_LINEAR, now it produces the same result as CPU version 2014-08-01 11:33:29 +04:00
E Braun ed2cdb71e5 fix for bug 3172 2014-08-01 07:47:59 +02:00
E Braun bbe48eaac6 regression test for bug 3172 2014-08-01 00:17:17 +02:00
Alexander Alekhin bab826a381 Merge pull request #3019 from alalek:ocl_fix_pyrUp_test 2014-07-30 13:02:45 +00:00
Alexander Smorkalov 77294855d7 Android native camera rebuilt after sources update. 2014-07-30 14:52:01 +04:00
Alexander Smorkalov d8187f7518 Merge branch 'fix_androidcamera_preview_usage_bits' into 2.4 2014-07-30 14:35:00 +04:00
Alexander Alekhin 9e83463128 ocl: fix pyrUp perf test 2014-07-30 13:27:36 +04:00
Vadim Pisarevsky e98c9a7ce3 Merge pull request #2968 from LeonidBeynenson:bugfix_crash_gpu_feature_matcher_in_stitcher 2014-07-29 13:48:19 +00:00
Vadim Pisarevsky 204651e0e2 Merge pull request #3014 from vpisarev:fix_python_tests 2014-07-29 11:54:36 +00:00
Vadim Pisarevsky 042892f0d7 hopefully fixed Python tests 2014-07-29 12:27:31 +04:00
Vadim Pisarevsky 7cefaa49dd Merge pull request #2816 from ehren:avcapturesession_leak 2014-07-25 13:18:06 +00:00
Vadim Pisarevsky fc41e8850b Merge pull request #2836 from s98felix:2.4 2014-07-25 12:59:41 +00:00
Vadim Pisarevsky 38b3698b97 Merge pull request #2997 from mojoritty:bugfix_3767 2014-07-25 12:39:30 +00:00
Vadim Pisarevsky c2746b5d2a Merge pull request #3001 from asmorkalov:cuda_6.5_support 2014-07-25 11:25:36 +00:00
Alexander Smorkalov daff2a0674 More accurate deb package build fix for CUDA 6.5 and newer.
(cherry picked from commit b2790973a3)
(cherry picked from commit f8758da289)
2014-07-24 15:08:29 +04:00
Alexander Smorkalov ad5c2de97c Deb package build fix for CUDA 6.5 and newer.
(cherry picked from commit e650d87e47)
(cherry picked from commit ca9c52ac97)
2014-07-24 15:08:27 +04:00
Alexander Smorkalov f8758da289 More accurate deb package build fix for CUDA 6.5 and newer.
(cherry picked from commit b2790973a3)
2014-07-24 15:06:38 +04:00
Alexander Smorkalov ca9c52ac97 Deb package build fix for CUDA 6.5 and newer.
(cherry picked from commit e650d87e47)
2014-07-24 15:06:35 +04:00
Martijn Liem 9c285da329 Bugfix for bug #3767
Fixed a memory leak in cap_dshow.cpp in videoInput::setVideoSettingCamera(). The leak was caused by not releasing an IBaseFilter object created in a call to getDevice(). Tho object is now properly released.
2014-07-23 12:33:51 +02:00
Richard Yoo de37cfc224 Enable Intel AVX/AVX2 compilation on Windows. 2014-07-21 13:26:50 -07:00
Vadim Pisarevsky 946c09f58c Merge pull request #2985 from StevenPuttemans:fix_3777_redo 2014-07-19 18:02:20 +00:00
StevenPuttemans 4e168ffdf3 fixing bug 3777 2014-07-18 12:49:56 +02:00
Vadim Pisarevsky d7bbafd683 Merge pull request #2948 from PhilLab:patch-1 2014-07-18 10:10:44 +00:00
Vadim Pisarevsky e90c233551 Merge pull request #2984 from cambyse:2.4 2014-07-18 10:05:22 +00:00
Vadim Pisarevsky 06897dbdb5 Merge pull request #2980 from akarsakov:revert_dft_dst_fix 2014-07-18 09:57:51 +00:00
Vadim Pisarevsky 39020fc9cf Merge pull request #2898 from PhilLab:2.4 2014-07-18 09:26:50 +00:00
PhilLab d5489f3a68 Clarified DescriptorExtractor::compute 2014-07-18 10:57:54 +02:00
Camille 5a5a487612 bug fix 3381 2014-07-18 00:06:31 +02:00
Camille 46775ad186 bug fix 3381 2014-07-17 22:57:31 +02:00
Alexander Karsakov 901d9b70b0 Revert changes by PR#2930 since it breaks logic of inverse mode. 2014-07-17 15:11:06 +04:00
Vadim Pisarevsky 0b4e043442 Merge pull request #2970 from PhilLab:patch-3 2014-07-16 19:26:46 +00:00
unknown d0c3c4c373 Function for drawing arrows 2014-07-15 14:12:16 +02:00
Vadim Pisarevsky 6c5dc17a1e Merge pull request #2909 from StevenPuttemans:bugfix_profileface_model 2014-07-15 09:47:52 +00:00
Vadim Pisarevsky cf3757448d Merge pull request #2965 from soulslicer:patch-2 2014-07-15 09:44:32 +00:00
LeonidBeynenson 8578f9c565 Added a TODO comment about changes which should be done in GpuMatcher::match 2014-07-15 13:27:59 +04:00
Vadim Pisarevsky c9c09262f7 Merge pull request #2966 from PhilLab:patch-2 2014-07-15 08:10:33 +00:00
Vadim Pisarevsky faac7f18c7 Merge pull request #2967 from LeonidBeynenson:bugfix_wave_correction_wrong_result 2014-07-15 08:10:04 +00:00
Alexander Smorkalov b2790973a3 More accurate deb package build fix for CUDA 6.5 and newer. 2014-07-14 23:58:05 +04:00
Vadim Pisarevsky 8d58b238ca Merge pull request #2780 from hbadino:Feature_3692_2.4 2014-07-14 19:00:52 +00:00
Vadim Pisarevsky 51bd56f19d Merge pull request #2959 from StevenPuttemans:add_notice_loaded_parameters 2014-07-14 18:47:13 +00:00
Vadim Pisarevsky b111fb94b7 Merge pull request #2957 from cambyse:2.4 2014-07-14 18:42:49 +00:00
Vadim Pisarevsky 544dd8b130 Merge pull request #2971 from ruslo:docfix 2014-07-14 18:40:39 +00:00
Vadim Pisarevsky 246a793d82 Merge pull request #2972 from apavlenko:24_face_rec_sample 2014-07-14 18:35:37 +00:00
Alexander Smorkalov e650d87e47 Deb package build fix for CUDA 6.5 and newer. 2014-07-14 21:27:23 +04:00
Alexander Smorkalov feb74b125d Build fixes for CUDA 6.5
(cherry picked from commit 60a5ada454)
2014-07-14 16:39:23 +04:00
Alexander Smorkalov 3c0b0b0f94 Build fixes for CUDA 6.5
(cherry picked from commit 60a5ada454)
2014-07-14 16:37:50 +04:00
Roman Donchenko d31a0eab9e Merge pull request #2815 from Aletheios:Bugfix#3705 2014-07-14 12:19:31 +00:00
Roman Donchenko ccbc764c02 Merge pull request #2975 from asmorkalov:ocv_cuda_6.5_fix 2014-07-14 12:11:49 +00:00
Alexander Smorkalov 60a5ada454 Build fixes for CUDA 6.5 2014-07-14 14:26:50 +04:00
Roman Donchenko d3c2b15f82 Merge pull request #2955 from SpecLad:find-libv4l2 2014-07-14 08:21:24 +00:00
Ruslan Baratov b030d7e6a1 Doc: fix definition of macro CV_MAKETYPE
At least this is how it's defined in core/types_c.h
2014-07-12 19:35:22 +04:00
Andrey Pavlenko 64d8cf1e2e improving face-rec sample:
* CSV can contain dir-s and wildcards
* save trained model
2014-07-12 19:28:43 +04:00
Roman Donchenko d262b04d99 Merge pull request #2903 from mmaraya:2.4 2014-07-11 14:15:59 +00:00
Leonid Beynenson cce2d9927e Fixed bug which caused crash of GPU version of feature matcher in stitcher
The bug caused crash of GPU version of feature matcher in stitcher when
we use ORB features.
2014-07-11 16:37:30 +04:00
Leonid Beynenson 79878a57a9 Fixed bug in cv::detail::waveCorrect
The function makes wave correction of a stitched panorama.
Earlier it gave wrong results for panorama made from 1 frame.
2014-07-11 15:47:41 +04:00
StevenPuttemans 03fe86f0a3 added extra warning about the automatic parameter loading for traincascade application when the param.xml file already exists 2014-07-11 11:42:13 +02:00
PhilLab 13a0c14e6c Added publication reference 2014-07-11 09:22:55 +02:00
Raaj 6e022dcb06 Update facedetect.cpp
Somebody forgot to add curly brackets
2014-07-10 17:44:40 -07:00
Richard Yoo c38023f4e7 Modifications to support dynamic vector dispatch. 2014-07-09 16:55:39 -07:00
Camille cbb5fc0acc bug fix 3696 2014-07-09 22:35:56 +02:00
Alexander Alekhin 2df3abe16b Merge pull request #2954 from ilya-lavrenov:doc_fix 2014-07-09 14:57:46 +00:00
Ilya Lavrenov ecec53f509 fixed docs 2014-07-09 17:48:28 +04:00
Roman Donchenko 023102c804 cap_libv4l.cpp depends on both libv4l 1 and 2, so search for both
How this worked before, I do not know.
2014-07-09 16:55:40 +04:00
unknown 52c05e75cc Fixed C++11 compatibility warning 2014-07-09 14:19:15 +02:00
Roman Donchenko 3d48994a72 Merge pull request #2883 from berak:b_3756_24 2014-07-09 07:49:47 +00:00
berak 7b160fa3cb added missing impl for multi-dim Mat::ones, Mat::zeros (issue #3756) 2014-07-08 18:04:56 +02:00
Roman Donchenko 71d3654832 Merge pull request #2558 from asmorkalov:ocv_matop_init_fix 2014-07-08 12:14:55 +00:00
PhilLab 2c29ee9e00 Added cast and removed formatting error 2014-07-08 13:24:35 +02:00
PhilLab aafda43df1 Double precision for solvePnPRansac()
solvePnPRansac() and pnpTask() now accept object or image points with double precision.
2014-07-08 11:52:42 +02:00
Vadim Pisarevsky 39127d942e Merge pull request #2908 from mmaraya:bug_3737 2014-07-07 13:29:38 +00:00
Vadim Pisarevsky b068e63618 Merge pull request #2930 from akarsakov:dft_dst_size_fix 2014-07-07 11:21:12 +00:00
Alexander Karsakov 4b8fb6c246 Fixed dst size 2014-07-03 15:17:51 +04:00
Vadim Pisarevsky 133d861d65 Merge pull request #2915 from SpecLad:core-useless-casts 2014-07-02 14:25:52 +00:00
Vadim Pisarevsky 8539d424b2 Merge pull request #2071 from pemmanuelviel:LshOrthogonalSubvectors 2014-07-02 14:24:09 +00:00
Alexander Alekhin dcf96b2da7 Merge pull request #2922 from ilya-lavrenov:mac_fix 2014-07-02 12:18:11 +00:00
Alexander Alekhin b1ac35e14a ocl: fix mac and superres test 2014-07-02 11:54:20 +04:00
Ilya Lavrenov 43e4946cca fix for fisheye 2014-07-02 11:53:53 +04:00
Vadim Pisarevsky 1b18ebf28a Merge pull request #2905 from Jazmann:2.4 2014-07-01 18:41:15 +00:00
Vadim Pisarevsky f6cf68094f Merge pull request #2917 from mmaraya:bug_3872 2014-07-01 16:40:08 +00:00
Vadim Pisarevsky d826bcdbbb Merge pull request #2914 from alalek:fix2.4 2014-07-01 11:02:04 +00:00
Ilya Lavrenov 070be56e14 fixed warnings 2014-07-01 14:32:16 +04:00
StevenPuttemans 939c60bcaa fixed two models, adding xml identifier to correct position 2014-07-01 10:27:36 +02:00
Mike Maraya 95550c2582 test.py: Check if camera_calibration.tar.gz file exists before downloading it, opencv bug #3782 2014-06-30 22:17:52 -04:00
Roman Donchenko ebb0255e19 Remove a couple of useless casts in core headers
This helps users who compile their code with -Wuseless-cast.
2014-06-30 16:12:04 +04:00
Alexander Alekhin 5c8cd76893 fix bug with invalid signature size (should not be less than signatureLength()) 2014-06-30 16:03:20 +04:00
Alexander Alekhin 3a8af7d691 fix python tests 2014-06-30 16:03:07 +04:00
Mike Maraya 7936faf9a3 Fixes build failure on Mac OS X 10.10 Yosemite Beta due to highgui/src/window_cocoa.mm (Bug #3737) 2014-06-27 08:34:40 -04:00
Mike Maraya 5c85f816c9 Revert "Fixes build failure on Mac OS X 10.10 Yosemite Beta due to highgui/src/window_cocoa.mm (Bug #3737)"
This reverts commit 56683e6d11.
2014-06-27 08:20:22 -04:00
Mike Maraya 56683e6d11 Fixes build failure on Mac OS X 10.10 Yosemite Beta due to highgui/src/window_cocoa.mm (Bug #3737) 2014-06-27 08:02:01 -04:00
Mike Maraya fbac578c79 Fixes resizeWindow() on OS X (Bug #3200) 2014-06-27 23:26:09 -04:00
unknown ade46bd428 Fixed typos in comments 2014-06-26 16:29:45 +02:00
Roman Donchenko 1138fbb940 Merge pull request #2766 from akarsakov:pyr_border_constant 2014-06-26 17:28:44 +04:00
Roman Donchenko 436342d5f4 Merge pull request #2880 from GravityJack:SparseMatIterator-build-fix 2014-06-25 16:32:18 +04:00
Roman Donchenko b21b8ff9d7 Merge pull request #2891 from nisargthakkar:dims_zero_on_release 2014-06-25 16:27:33 +04:00
Vadim Pisarevsky fb8fa3fdac Merge pull request #2889 from Ilya-Krylov:fisheye 2014-06-24 12:06:19 +00:00
Jasper f45da9866a Fix for VTK6.2 issue. 2014-06-24 11:52:56 +01:00
Nisarg Thakkar 98421e5970 Fix for Bug#3757: All dimension values are 0 after release is called 2014-06-23 20:15:23 +05:30
Ilya Krylov 84bb77e914 Fixed android and windows x64 build issues 2014-06-23 17:06:40 +04:00
Alexander Petrikov 6882970248 Add CV_Assert (ndisp % 8 == 0) to NEON version 2014-06-23 11:08:51 +04:00
Marc Rollins 05e0b3b7e6 Fixing build error when using post-increment operator. 2014-06-19 14:14:10 -07:00
Roman Donchenko 6a94862fef Merge pull request #2870 from 23pointsNorth:patch-5 2014-06-19 16:52:00 +04:00
Roman Donchenko cb69a5c29a Merge pull request #2868 from neo008:2.4 2014-06-19 16:51:37 +04:00
Andrey Pavlenko 75742fcd01 Merge pull request #2843 from berak:f_export_bow_24 2014-06-19 09:08:32 +00:00
Alexander Alekhin c99ce0f427 Merge pull request #2846 from alalek:2.4_fix_python_warnings 2014-06-18 13:19:11 +00:00
Daniel Angelov 660d7cd3ae Updated findHomography docs branch 2.4
Updated the documents to give warning to the users of `findHomography` that the function may return an empty matrix in some cases. 
The user must take care of checking that.
2014-06-16 13:05:17 +01:00
Neo Alienson b6e25a9fc7 Fix typos 2014-06-16 18:48:10 +08:00
Vadim Pisarevsky 2b2ce3f6e9 Merge pull request #2726 from Ilya-Krylov:2.4 2014-06-12 21:37:47 +04:00
Vadim Pisarevsky 3391caf434 Merge pull request #2779 from pemmanuelviel:kmeansppSquareDist 2014-06-12 21:35:28 +04:00
berak 3500c940d4 add Bag of Words to python wrapper 2014-06-11 11:50:22 +02:00
Alexander Alekhin 4d0848b3e8 fix -Wmaybe-uninitialized warning (initialize pointers to NULL) 2014-06-10 18:12:38 +04:00
Roman Donchenko 1f4ddbe5b6 Merge pull request #2705 from KonstantinMatskevich:face_recognition_labels_info 2014-06-10 12:24:56 +04:00
Roman Donchenko 4ef311949b Merge pull request #2834 from atinfinity:pullreq/140606-TickMeter-2.4 2014-06-09 14:29:44 +04:00
Roman Donchenko 64344f4545 Merge pull request #2818 from StevenPuttemans:fix_linux_tutorial 2014-06-09 13:37:39 +04:00
Andrey Pavlenko 02b32d86d3 moving FaceRecognizer2 from public header to .cpp 2014-06-09 13:26:45 +04:00
berak fc610979bb export BOW to script wrappers 2014-06-07 16:34:53 +02:00
Richard Yoo 11a09ef5cc Changes to support Intel AVX/AVX2 in cvResize(). 2014-06-06 15:39:09 -07:00
atinfinity f08d88fa78 fixed calculation method of "cv::TickMeter" 2014-06-07 07:29:22 +09:00
Konstantin Matskevich 59c8edfd98 facerec2 2014-06-06 15:57:11 +04:00
Aleksandr Petrikov 1a1cd9b4e9 add NEON realization for StereoBM(findCorrespondence, prefilterXSobel) 2014-06-04 12:06:33 +04:00
StevenPuttemans 7c44a07810 fix typo in linux tutorial 2014-06-02 09:35:19 +02:00
Ehren Metcalfe cd3aa0184a Fix resource leak with iOS camera due to failure to remove AVCaptureSession input/outputs on stop (Bug #3389) 2014-05-31 19:41:16 -04:00
aletheios 1020a93fa3 Bugfix #3705: params.setRecordingHint(true) breaks camera preview on Samsung Galaxy S2 2014-05-31 18:44:32 +02:00
Roman Donchenko 9a5e9d3442 Merge pull request #2771 from SpecLad:pvs-checks-opencv 2014-05-29 14:50:42 +04:00
Alexander Alekhin 0ea572d772 Merge pull request #2796 from berak:b_3674_24 2014-05-28 13:28:30 +04:00
berak 2bacd8b702 2 fixed unassigned reshapes in em (#3674) 2014-05-28 10:37:16 +02:00
Roman Donchenko aa170cfb5b Merge pull request #2793 from alalek:run_android_env 2014-05-27 13:35:11 +04:00
Alexander Alekhin e6f6905868 run.py: propagate OPENCV* env variables only with --android_propagate_opencv_env flag 2014-05-26 14:32:52 +04:00
Alexander Alekhin 766600529b run.py: added --android_env parameter 2014-05-26 13:27:31 +04:00
Roman Donchenko 09f9b35bc6 Merge pull request #2742 from StevenPuttemans:feature_3176 2014-05-22 18:03:56 +04:00
StevenPuttemans fea4396023 Added more info on the data input variable of kmeans 2014-05-22 12:56:44 +02:00
Pierre-Emmanuel Viel ec99f96c62 Add the ensureSimpleDistance() method to ensure the user the returned distance is not ^2 (the default for L2 for instance) 2014-05-21 13:16:12 +02:00
Pierre-Emmanuel Viel 2f8b5731da Fix local variable shadowing 2014-05-21 12:27:38 +02:00
Konstantin Matskevich 8d4a76925c fixed binary compatibility 2014-05-21 09:25:15 +04:00
Pierre-Emmanuel Viel 00367cfb00 Merge remote-tracking branch 'upstream/2.4' into LshOrthogonalSubvectors 2014-05-21 01:31:52 +02:00
Pierre-Emmanuel Viel e63d7de87c Allows to choose orthogonal sub-vectors for LSH without using a static table among LshTable instances 2014-05-20 22:52:11 +02:00
Alexander Karsakov 511ed4388e Disabled BORDER_CONSTANT for pyramid functions. 2014-05-20 17:28:47 +04:00
Hernan Badino 8a3b93773d Merge branch 'Itseez-2.4' into Feature_3692_2.4 2014-05-20 09:28:11 -04:00
Hernan Badino bcd63766ce Merge branch '2.4' of https://github.com/Itseez/opencv into Itseez-2.4 2014-05-20 09:27:59 -04:00
Roman Donchenko 7ea1bf3cf0 Fixed several problems found by PVS-Studio.
This fixes all problems from the article "Checking OpenCV with PVS-Studio"
<http://www.viva64.com/en/b/0191/> that are not already fixed and are
not in 3rdparty or the legacy module.

The problems fixed are two instances of useless code and one instance
of unspecified behavior (right-shifting a negative number).
2014-05-20 13:54:00 +04:00
Ilya Krylov 3678020c28 Added license to source files 2014-05-20 12:37:37 +04:00
Roman Donchenko 976da2f3d3 Merge pull request #2768 from SpecLad:useless-loop 2014-05-20 11:50:29 +04:00
Ilya Krylov 0d2fab86b4 Changed documentation for namespace fisheye 2014-05-19 18:16:00 +04:00
Hernan Badino ca40d635e4 Switched insertion of connected components in filterSpecklesImpl 2014-05-19 10:12:07 -04:00
Ilya Krylov 651b13f72a Refactored class Fisheye to namespace fisheye 2014-05-19 17:55:32 +04:00
Roman Donchenko bea46c90b5 Remove a useless loop that copies an array to itself 2014-05-19 17:38:30 +04:00
Vadim Pisarevsky 0b4eb6a964 Merge pull request #2509 from euphrat:mog2_bgimg_gray 2014-05-19 17:36:38 +04:00
Vadim Pisarevsky 988b108858 Merge pull request #2701 from thoinvil:BugfixFilterEngineApplyROI 2014-05-19 17:34:45 +04:00
Vadim Pisarevsky 44acfc38a1 Merge pull request #2739 from StevenPuttemans:bug_1523 2014-05-19 17:33:36 +04:00
Vadim Pisarevsky e30939f09b Merge pull request #2738 from kevmitch:2.4 2014-05-19 17:33:22 +04:00
Vadim Pisarevsky 118b27f5b4 Merge pull request #2744 from jet47:kmeans-fix 2014-05-19 17:33:10 +04:00
Roman Donchenko eded87de5b Merge pull request #2754 from thoinvil:patch-1 2014-05-19 15:41:28 +04:00
StevenPuttemans 12207ac763 fix coordinate problem with large images - bug 1523 2014-05-19 13:07:44 +02:00
Roman Donchenko f77aa45cfb Merge pull request #2735 from StevenPuttemans:bug_2000 2014-05-19 14:25:47 +04:00
StevenPuttemans 7fc764f5e5 added documentation for findContours 2014-05-19 11:44:25 +02:00
Roman Donchenko 06b335b2d7 Merge pull request #2733 from StevenPuttemans:bug_2162 2014-05-19 13:04:54 +04:00
Roman Donchenko 62e0759ba2 Merge pull request #2719 from yashdv:patch-1 2014-05-19 13:00:32 +04:00
Konstantin Matskevich a46f119fdf docs fixes 2014-05-19 09:54:15 +04:00
Roman Donchenko c9cb480844 Merge pull request #2753 from shahurik:2.4 2014-05-16 17:40:41 +04:00
Vladislav Vinogradov 746185652a add additional tests for different input cases 2014-05-15 12:08:38 +04:00
Vladislav Vinogradov f16503743f use more accurate reshape 2014-05-15 12:08:01 +04:00
thoinvil ea038436e6 Added condition to 1st test in cv::GaussianBlur
Consistent with the test made in cv::boxFilter, it adjusts the kernel size to the source size only if the border is not BORDER_CONSTANT and if BORDER_ISOLATED is set. Otherwise, the source has to be considered possibly in a larger image (i.e. the source being a ROI) in witch the kernel should apply.
2014-05-15 08:40:13 +02:00
Vlad Shakhuro 6a93b43cae Fix svm intro tutorial 2014-05-14 21:24:57 +04:00
Roman Donchenko 0ebde64701 Merge pull request #2743 from StevenPuttemans:bugfix_3549 2014-05-14 19:49:27 +04:00
Ilya Krylov c30fef1f9d Fixed build issues 2014-05-14 18:58:39 +04:00
Roman Donchenko 55bff44810 Merge pull request #2747 from jet47:gpu-resize-stream-fix 2014-05-14 16:34:48 +04:00
Roman Donchenko 75a1743f35 Merge pull request #2745 from yashdv:patch-3 2014-05-14 12:38:43 +04:00
Roman Donchenko 83b7fe1b82 Merge pull request #2748 from jet47:fix-bug-3690 2014-05-14 12:35:04 +04:00
Vladislav Vinogradov 7e2f7f45d7 fix bug #3690
removed invalid condition, it is always false
2014-05-14 10:47:28 +04:00
Vladislav Vinogradov 1f72873c55 fix cv::gpu::resize function
add missing stream parameter to call_resize_linear_glob
2014-05-14 10:31:28 +04:00
Yash Vadalia 7e56cfafbc fixed a syntax error in cap_giganetix.cpp
Ticket 3458 (http://code.opencv.org/issues/3458)
2014-05-13 19:59:37 +05:30
Yash Vadalia 6ecd553810 Added doc for LinearPolar Transform 2014-05-13 19:36:43 +05:30
Vladislav Vinogradov 55a714c83b fix cv::kmeans function
reshape input matrix, since the function works with data
as with [N x dims] matrix
2014-05-13 18:00:17 +04:00
StevenPuttemans 1d557e6702 adding bugfix 3549 2014-05-13 15:34:30 +02:00
Roman Donchenko 10f89b9c8b Merge pull request #2737 from jet47:fix-opencv-cmake-config 2014-05-13 14:39:10 +04:00
Roman Donchenko 4a24ecd176 Merge pull request #2731 from StevenPuttemans:bug_2626 2014-05-13 14:21:36 +04:00
Roman Donchenko 2cf6cea90f Merge pull request #2730 from StevenPuttemans:bug_2740 2014-05-13 14:19:42 +04:00
Roman Donchenko c607dadc49 Merge pull request #2729 from StevenPuttemans:bug_3252 2014-05-13 14:17:09 +04:00
Roman Donchenko 83e2731c94 Merge pull request #2728 from StevenPuttemans:bug_3434 2014-05-13 14:15:38 +04:00
Kevin Mitchell 63e508abd2 doc: update/clarify behaviour of mask in floodFill
Clarify how the mask parameter is set on output and how this is
affected by the flags parameter.

resolves Feature #2942
2014-05-13 02:26:59 -07:00
StevenPuttemans 006956c324 Fixing as suggested in bug 2626, made naming same for both C, C++ and python API 2014-05-13 11:02:01 +02:00
Roman Donchenko ff2d76ec0d Merge pull request #2699 from GregoryMorse:patch-1 2014-05-13 11:58:25 +04:00
Roman Donchenko bc7b21609a Merge pull request #2692 from 1Hyena:2.4 2014-05-13 11:56:12 +04:00
Roman Donchenko f0547e5e05 Merge pull request #2727 from StevenPuttemans:bug_3484 2014-05-13 11:55:17 +04:00
Vladislav Vinogradov 67b562d543 fix OpenCVConfig.cmake template - missing parentheses 2014-05-13 11:37:21 +04:00
1Hyena 6c118ebc51 Changed ostringstream to ostream for new print_params and added the old
version of print_params for backwards compatibility.
2014-05-12 23:01:44 +03:00
Roman Donchenko 09674623cf Merge pull request #2714 from asmorkalov:ocv_cmake_config 2014-05-12 18:53:10 +04:00
Roman Donchenko ecfb1ab4f8 Merge pull request #2721 from zarrabeitia:2.4 2014-05-12 18:48:01 +04:00
StevenPuttemans a0a8fb4fd9 fixed bug 2626 2014-05-12 16:43:07 +02:00
StevenPuttemans 6c59e39f7c fix bug 3434 2014-05-12 16:41:22 +02:00
StevenPuttemans e96de8821c bug 2740 added fix 2014-05-12 15:26:56 +02:00
StevenPuttemans b382984810 fix bug 3252 2014-05-12 15:01:15 +02:00
StevenPuttemans 2b4241c10b fixed bug 3484 2014-05-12 14:40:12 +02:00
Alexander Smorkalov e8376c789d Fix non-Android cross compilation with OpenCVConfig.cmake 2014-05-12 15:45:02 +04:00
Ilya Krylov e4a9c0f184 Fixed review comments 2014-05-12 15:37:47 +04:00
Roman Donchenko 5e47aa6300 Merge pull request #2717 from StevenPuttemans:2.4 2014-05-12 15:14:53 +04:00
Konstantin Matskevich d67c9aabff docs 2014-05-12 10:09:39 +04:00
Luis Zarrabeitia bb5a22c504 highgui: fix segfault on CvCapture_GStreamer::retrieveFrame
CvCapture_GStreamer::retrieveFrame assumes that RGB videos are 24BPP.
This is not necesarily the case, unless we explicitly tell GStreamer
that we want 24BPP RGB streams.

Adding bpp=(int)24 to the appsink caps.
2014-05-11 19:00:14 -04:00
StevenPuttemans a9c7db7518 add suggestion of feature 2619 2014-05-09 13:44:12 +02:00
Alexander Alekhin c74fed1fcf Merge pull request #2706 from ilya-lavrenov:ipp_2.4_warnings 2014-05-08 17:04:18 +04:00
Alexander Alekhin 7c9caab1fb Merge pull request #2708 from StevenPuttemans:2.4 2014-05-08 17:02:40 +04:00
Konstantin Matskevich aa76ef9a98 fixes 2014-05-08 15:55:55 +04:00
Alexander Alekhin 78f660024b Merge pull request #2712 from jet47:subtract-fix-3rd-attempt 2014-05-08 15:44:52 +04:00
Ilya Lavrenov 19a2495067 fixed IPP related warnings 2014-05-08 13:31:27 +04:00
Vladislav Vinogradov 77275031ab finally fix cv::subtract 2014-05-08 13:11:42 +04:00
StevenPuttemans 99475e2976 fixed wrong download link in tutorial 2014-05-08 10:45:51 +02:00
Ilya Krylov 349ff631a5 Added sample of work of Fisheye::undistortImage and its description to documentation. Removed readPoints and readExtrinsic (useless) 2014-05-07 20:53:07 +04:00
thoinvil e50ef2dab5 Bugfix #3668 removed the comment 2014-05-07 18:27:08 +02:00
Vladislav Vinogradov 942401de16 fix output matrix allocation in cv::subtract(cherry picked from commit 629461c836) 2014-05-07 20:16:27 +04:00
Vladislav Vinogradov 629461c836 fix output matrix allocation in cv::subtract 2014-05-07 19:52:35 +04:00
Vladislav Vinogradov f9ff9c5618 fix cv::subtract function:
call dst.create(...) before using it(cherry picked from commit 4c66614e07)
2014-05-07 16:54:20 +04:00
Alexander Alekhin e2c7adc7c4 Merge pull request #2703 from jet47:subtract-create-dst-mat 2014-05-07 16:50:50 +04:00
Konstantin Matskevich 36afd4ef55 added additionalInfo in faceRecognition 2014-05-07 16:29:55 +04:00
Vladislav Vinogradov 4c66614e07 fix cv::subtract function:
call dst.create(...) before using it
2014-05-07 13:15:19 +04:00
Alexander Alekhin b1a28a52fa Merge pull request #2693 from mvukad:bugfix_ippmorphop 2014-05-07 13:15:09 +04:00
GregoryMorse 38db7a78df WinRT core compatibility fixes
Update system.cpp

Update system.cpp

Update system.cpp

Update matching.cpp

Update matching.cpp
2014-05-07 06:17:37 +08:00
Thierry Hoinville 5efd2056f0 Bugfix #3668 in FilterEngine::apply(), use the ROI properly 2014-05-06 15:33:07 +02:00
Ilya Krylov 1f94b7dfc9 minor 2014-05-06 11:17:10 +04:00
Ilya Krylov ef01044b2f Added documentation for Fisheye::stereoCalibrate 2014-05-06 11:09:22 +04:00
Alexander Alekhin 59cf62ad9e Merge pull request #2636 from atrebbi:#3653 2014-05-05 18:00:18 +04:00
Ilya Krylov 50b291995a Added tests for stereoCalibrate 2014-05-05 17:23:03 +04:00
Alexander Alekhin f0d4ccc6cf Merge pull request #2696 from PhilLab:2.4 2014-05-05 17:08:48 +04:00
Ilya Krylov c2341fd446 Added stereoCalibrate for Fisheye camera model 2014-05-05 14:21:24 +04:00
PhilLab 897d0a9aaf Updated documentation: library names
updated the library names to OpenCV version 2.4.9
2014-05-05 12:16:48 +02:00
Michael Vukadinovic c1aee0c312 Fixed bug in IPPMorphOp function when looping over elements of the morphology kernel. 2014-05-01 11:52:49 -07:00
1Hyena dfdb09386f Autotuned_index now prints all info into logger instead of couting it. 2014-05-01 20:55:49 +03:00
Jüri Aedla 6fb83f869c Android camera qcom HAL doesn't like it when no consumer usage bits are set. Set a usage bit for preview BufferQueue. 2014-05-01 16:03:39 +03:00
Ilya Krylov e6aa8ce932 Corrected notes 2014-04-29 10:24:39 +04:00
Ilya Krylov f0f741b796 Added documentation 2014-04-28 15:27:30 +04:00
Ilya Krylov 05ee15f108 Added FisheyeTest 2014-04-28 12:01:27 +04:00
Roman Donchenko 5042ab1f32 Merge pull request #2659 from adrians:docs_pull_1 2014-04-28 11:36:12 +04:00
Ilya Krylov 35e1b322cb Added test for jacobians 2014-04-25 18:36:48 +04:00
Ilya Krylov 9c7e0bfd33 Added fisheye camera model 2014-04-25 14:49:36 +04:00
Adrian Stratulat 4fb5680d91 Documentation - minor fix-ups 2014-04-23 17:30:27 +00:00
Roman Donchenko cccdcac0c8 Merge pull request #2640 from a-wi:2.4 2014-04-22 12:01:47 +04:00
Artur Wieczorek f27a886314 Fix for issue #3645 (http://code.opencv.org/issues/3645).
Implement missing features in CvCaptureCAM_VFW class.

Implemented missing CvCaptureCAM_VFW::setProperty() member function (handling CV_CAP_PROP_FRAME_WIDTH, CV_CAP_PROP_FRAME_HEIGHT, CV_CAP_PROP_FPS properties).
Extended CvCaptureCAM_VFW::setProperty()/getProperty() functions to handle also CV_CAP_PROP_FPS property.
Minor refactoring of CvCaptureCAM_VFW class.
2014-04-21 17:10:58 +02:00
Alessandro Trebbi 3d25d70627 fix for compiling 2.4 opencv with xcode 5.1 2014-04-18 13:42:47 +02:00
Andrey Pavlenko 7ba4212529 Merge pull request #2544 from alalek:perf_report_regressions 2014-04-15 16:17:39 +04:00
Vadim Pisarevsky 6a5a0fe803 Merge pull request #2016 from pemmanuelviel:kmeansppSquareDist 2014-04-15 13:31:48 +04:00
Roman Donchenko df8e28283f Merge pull request #2571 from MartinChodakowski:fix-old-python-doc-typos 2014-04-11 14:15:26 +04:00
Roman Donchenko 4c2db3d6e7 Merge pull request #2579 from maksqwe:test_operations_fix 2014-04-11 14:14:33 +04:00
Roman Donchenko 8ab224746b Merge pull request #2603 from maksqwe:unused_fix_2.4 2014-04-11 14:14:04 +04:00
Vadim Pisarevsky dae04aacc3 Merge pull request #2575 from rold2007:Bugfix_1437 2014-04-10 13:31:33 +04:00
Vadim Pisarevsky b66adc81a4 Merge pull request #2599 from maksqwe:test_calibration_2.4 2014-04-10 13:30:37 +04:00
Vadim Pisarevsky 211d44cfc5 Merge pull request #2591 from Nerei:viz_cloud_shading_support 2014-04-10 13:29:58 +04:00
Maks Naumov eb89f5207c remove unused variables in CV_KDTreeTest_CPP::findNeighbors() 2014-04-09 23:07:48 +03:00
Maks Naumov 29d1bce85f remove unused variable in TEST_P() 2014-04-09 23:06:06 +03:00
Maks Naumov 79eb3c5cde remove unused variable in OCL_PERF_TEST_P() 2014-04-09 23:04:29 +03:00
Maks Naumov befbe89bdf remove unused variable in ocl_moments() 2014-04-09 23:01:49 +03:00
Maks Naumov eb45cf0c93 remove unused variable in findCorners_caller() 2014-04-09 22:59:52 +03:00
Maks Naumov 9b52b61451 remove unused variable in HOGDescriptor::groupRectangles() 2014-04-09 22:56:19 +03:00
Maks Naumov a01659825c remove unused variable in loadFromXML() 2014-04-09 22:53:36 +03:00
Maks Naumov c098c18942 Merge pull request #1 from Itseez/2.4
2.4
2014-04-09 22:48:19 +03:00
Maks Naumov b033a63e63 fix typo in test_cameracalibration 2014-04-09 14:41:16 +03:00
David Rolland cb8ddb1179 Corrected bug #1437. Corrected the cast of two short values from an lParam. lParam contains two signed-short, the position can be negative when another mouse event happens with a mouse_move (mouse_click, etc.)
The Microsoft documentation specifies NOT to use LOWORD and HIWORD macros to extract the x/y positions as it won't work correctly with multiple monitors. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms645607(v=vs.85).aspx.
2014-04-09 18:24:21 +12:00
Anatoly Baksheev 3f95818252 Added cloud shading support - additional normals array is used 2014-04-08 20:31:28 +04:00
Firat Kalaycilar 990295644e made a performance improvement.
changed the way the mean value for each pixel is assigned in the output image.
2014-04-08 16:10:32 +03:00
Firat Kalaycilar 9eb0e7d99b Merge branch '2.4' of git://github.com/Itseez/opencv into mog2_bgimg_gray 2014-04-08 14:58:32 +03:00
Martin Chodakowski 267241b889 Fix typos in old python wrapper documentation(Bug #3628)
Fixed spelling of CV_INTER_LINEAR flag in geometric_transformations.rst
2014-04-08 00:55:08 -04:00
Maks Naumov 8271bd5f14 fix condition in CV_OperationsTest::operations1() 2014-04-07 11:24:27 +03:00
Roman Donchenko 1cee868e88 Merge pull request #2572 from jet47:gpu-generalized-hough 2014-04-07 11:57:52 +04:00
Vladislav Vinogradov d822d6f101 disable GeneralizedHough tests on gcc 4.7 2014-04-07 09:49:17 +04:00
Vladislav Vinogradov f8d922ad3e disable gpu::GeneralizedHough compilation on gcc 4.7 2014-04-04 10:31:33 +04:00
Alexander Smorkalov 0c30b18769 Bug #3611 Initializing static cv::Mat with cv::Mat::zeros causes segmentation fault fixed. 2014-04-01 18:00:44 -07:00
Roman Donchenko a8cb5c3983 Merge pull request #2554 from asmorkalov:ocv_249_version 2014-04-01 12:16:25 +04:00
Alexander Smorkalov e23f7303a6 OpenCV version++. OpenCV Manager version++. 2014-03-31 15:00:25 -07:00
Andrey Pavlenko 0d5ffec521 Merge pull request #2553 from ilya-lavrenov:typo 2014-03-31 23:21:07 +04:00
Andrey Pavlenko 97eac3f394 Merge pull request #2551 from ilya-lavrenov:ocl_nonfree 2014-03-31 21:21:27 +04:00
Andrey Pavlenko bb3c0c066c Merge pull request #2548 from jet47:gpu_mog2_test 2014-03-31 20:19:21 +04:00
Ilya Lavrenov 9b9769169f doc typos 2014-03-31 19:57:05 +04:00
Ilya Lavrenov 7df92bbb77 fixed C4505 2014-03-31 17:30:15 +04:00
Alexander Alekhin eeed9ce247 perf report: summary.py: added custom --regressions map 2014-03-31 16:04:18 +04:00
Andrey Pavlenko 1f4586f3dd Merge pull request #2541 from JinoBetti:2.4 2014-03-31 15:48:45 +04:00
Vladislav Vinogradov 6d368dc1e7 increase epsilon for MOG2::getBackgroundImage test:
it uses float arithmetics
2014-03-30 18:02:03 -07:00
Andrey Pavlenko 51530d4d8e Merge pull request #2543 from apavlenko:24_haar_revert 2014-03-28 23:17:08 +04:00
Roman Donchenko 8541b7bf92 Merge pull request #2534 from asmorkalov:opencv_config_cut_cuda_abs_path 2014-03-28 19:37:04 +04:00
Alexander Smorkalov b852108262 OpenCVConfig.cmake fix after cutting absolute CUDA libraries path. 2014-03-28 18:57:21 +04:00
Andrey Pavlenko 3747d2643f Revert pull request #1929 from @alalek "ocl: added workaround into Haar kernels"
This reverts commit 3dcddad88a.

Conflicts:
	modules/ocl/src/opencl/haarobjectdetect.cl
2014-03-28 16:08:11 +04:00
Andrey Pavlenko 7d82171af4 - fix test 2014-03-28 16:06:39 +04:00
Andrey Pavlenko e6e817e613 Revert "Merge pull request #1779 from perping:integral_2.4"
This reverts commit 54ea5bbac7, reversing
changes made to 28e0d3d771.
2014-03-28 16:05:04 +04:00
Roman Donchenko 0469c18726 Merge pull request #2542 from asmorkalov:android_javacam_cvtcolor_fix 2014-03-28 12:45:39 +04:00
Roman Donchenko f5fecc7e9a Merge pull request #2539 from mjul:fixtypos 2014-03-28 11:58:23 +04:00
Roman Donchenko 4382970739 Merge pull request #2540 from mjul:fixtypos_2.4 2014-03-28 11:58:11 +04:00
Alexander Smorkalov d17740ec87 Bug #3553 JavaCameraView frame format and cvtColor format inconsistency fixed. 2014-03-28 04:56:31 +04:00
JinoBetti 91511c1521 Update out.cpp
Fixed a bug with the cv::format(cv::Mat, ...) method for matrices with only one row

see http://answers.opencv.org/question/21201/cvformat-does-not-format-the-way-it-should/?answer=23945#post-id-23945 for details
2014-03-27 16:28:40 +01:00
Roman Donchenko 2e3e106676 Merge pull request #2537 from ilya-lavrenov:doc_fix 2014-03-27 17:43:02 +04:00
Martin Jul a1798cb28e Fixed typo in BFMatcher in docs. 2014-03-27 13:52:49 +01:00
Ilya Lavrenov 80df44bd75 doc fix 2014-03-27 16:30:29 +04:00
Martin Jul bb05af8ece Merge branch '2.4' into fixtypos 2014-03-27 13:20:48 +01:00
Martin Jul 73042b32e1 Fixed typos in "matching" 2014-03-26 23:29:48 +01:00
Andrey Pavlenko a1d151924d Merge pull request #2527 from apavlenko:ocl_surf_24 2014-03-26 19:03:44 +04:00
Andrey Pavlenko fa5705613d splitting plain and OCL tests for SURF. 2014-03-26 17:18:05 +04:00
Roman Donchenko a7f9677378 Merge pull request #2404 from yashdv:old_basic_structures_doc_fix 2014-03-26 12:18:39 +04:00
Andrey Pavlenko c1acbb02bc disabling calls to SURF_OCL causing tests failures 2014-03-25 14:09:49 +04:00
Andrey Pavlenko 63a746c6ea fixing conditional compilation 2014-03-25 13:16:42 +04:00
Andrey Pavlenko 7e03a8b279 fixing check_docs2.py issue 2014-03-25 13:15:56 +04:00
Roman Donchenko 5effebb5f5 Merge pull request #2498 from dreamworld:fix_tutorial_mat_the_basic_image_container 2014-03-25 12:14:44 +04:00
Roman Donchenko 8af175b81b Merge pull request #2521 from atrebbi:#3620 2014-03-24 18:54:00 +04:00
Roman Donchenko 4d3f9228aa Merge pull request #2516 from Daniil-Osokin:fix_docs 2014-03-24 18:52:49 +04:00
Daniil Osokin ac19420907 Removed obsolete list from docs 2014-03-24 14:50:20 +01:00
Roman Donchenko f8a100f3e0 Merge pull request #2520 from vlkolesnikov:misprint_fix 2014-03-24 14:05:18 +04:00
Daniil Osokin 04b1822cff Fixed "Mat mask operations" tutorial. Thanks @RJ2 for pointing this. 2014-03-24 12:53:30 +04:00
Roman Donchenko bcb0ee3e4b Merge pull request #2514 from asmorkalov:android_two_libs_cuda 2014-03-24 12:26:57 +04:00
Roman Donchenko 9aa6528fd7 Merge pull request #2504 from asmorkalov:android_camera_locks_24 2014-03-24 12:06:51 +04:00
Roman Donchenko 7efb09fb8f Merge pull request #2513 from asmorkalov:ocv_cuda_link_revert 2014-03-24 12:03:27 +04:00
Vladimir Kolesnikov 60803afe8f Misprint fixed in table formatter 2014-03-24 11:04:49 +04:00
Andrey Pavlenko ae89787984 Merge pull request #2511 from apavlenko:2.4_fix_perf_nonfree 2014-03-24 10:25:47 +04:00
Andrey Pavlenko cf3a2e30cd Merge pull request #2517 from ilya-lavrenov:fix 2014-03-24 10:25:04 +04:00
Andrey Pavlenko 259b9e093c disabling failing tests 2014-03-24 10:12:02 +04:00
Andrey Pavlenko 5421d741bc making OCL tests conform to the comon style 2014-03-24 10:08:44 +04:00
Alessandro Trebbi c4a63f6a86 - 2014-03-23 22:00:16 +01:00
Ilya Lavrenov 20b6191842 doc fix 2014-03-23 16:20:00 +04:00
Alexander Smorkalov 64d679ecb4 Added guard to prevent from gpu module redefinition in OpenCV.mk 2014-03-22 05:41:29 +04:00
Kang Liu 9dc51a1aa4 Keep definitions of link aliases consistent 2014-03-21 22:28:48 +01:00
Daniil Osokin 2d3aa3861c Fixed Load, Modify, and Save an Image tutorial 2014-03-21 16:58:50 +01:00
Andrey Pavlenko 244f126ff6 Merge pull request #2454 from apavlenko:2.4_haar_extend 2014-03-21 18:45:58 +04:00
Alexander Smorkalov 3b65b710b6 Implicit linkage with CUDA runtime reverted. 2014-03-21 17:58:59 +04:00
Alexander Smorkalov 0dba5bdc4a Multiple fixes in camera.
Fixed constant value for focus mode FOCUS_MODE_CONTINUES_PHOTO;
Add setters and getters for exposure lock and white balance lock flags;
Excluded camera restart for all setters except frame size.
2014-03-21 17:26:05 +04:00
Roman Donchenko 46d39aff68 Merge pull request #2501 from asmorkalov:android_native_camera_qualcomm 2014-03-21 16:28:48 +04:00
Roman Donchenko 6bf4a7ce01 Merge pull request #2510 from asmorkalov:android_cuda_filter_fix 2014-03-21 16:00:29 +04:00
Kang Liu dc21e2cc0e remove highlighting in some function links
1. Remove whole-document highlighting in some function links
2. fix the function alias `readwriteimagevideo`
2014-03-21 11:54:35 +01:00
Andrey Pavlenko fe5eaae102 adding missing include (fixing 'no ocl implementation' error) 2014-03-21 14:30:49 +04:00
Alexander Smorkalov 846266fde4 Native camera fix for some deivices with Qualcomm SoC like Samsung Galaxy S4. 2014-03-21 14:16:03 +04:00
Roman Donchenko 49efc250d3 Merge pull request #2400 from RJ2:Bugfix_2 2014-03-21 13:58:06 +04:00
Roman Donchenko a66018d14d Merge pull request #2423 from RJ2:bugfix_5 2014-03-21 13:54:52 +04:00
Alexander Smorkalov b0ad84cfa2 Libraries filter update after abs path cut. 2014-03-21 12:48:38 +04:00
Firat Kalaycilar c9f51d5eed modified BackgroundSubtractorMOG2::getBackgroundImage so that it can now work with gray-level images. 2014-03-21 09:44:11 +02:00
Andrey Pavlenko 640e180efe switching to CV_HAAR_SCALE_IMAGE mode, enabling test 2014-03-20 22:22:55 +04:00
Roman Donchenko 034ef02409 Merge pull request #2449 from asmorkalov:cuda_abs_path_fix 2014-03-20 17:49:41 +04:00
Andrey Pavlenko 9c7ba6db90 Merge pull request #2490 from ilya-lavrenov:ocl_sep_filters 2014-03-20 13:54:27 +04:00
Roman Donchenko 68c57a1e82 Merge pull request #2473 from euphrat:mog2_weight_bugfix 2014-03-20 12:40:23 +04:00
Alexander Smorkalov 284b2fc1e7 Cut path to CUDA libraries to prevent generation of OpenCVModules.cmake with abs path. 2014-03-19 18:47:32 +04:00
Kang Liu 17713f6831 1. fix an error in sample code
2. change an external link to maintain consistency with the previous tutorial
2014-03-19 13:05:38 +01:00
Roman Donchenko a1e5bd71f1 Merge pull request #2446 from asmorkalov:ocv_implicit_cuda_control 2014-03-19 14:49:22 +04:00
Firat Kalaycilar 0a16d93e1d Fixed an issue with weight assignment causing the resulting GMM weights to be unsorted in the CUDA and OCL versions of BackgroundSubtractorMOG2 2014-03-18 17:26:24 +02:00
Alexander Smorkalov b4e4f13f9e Superres module enabled for Android. GPU samples build fixed for Android. 2014-03-18 17:07:19 +04:00
Firat Kalaycilar 4d9698a4cf Merge branch '2.4' of git://github.com/Itseez/opencv into mog2_weight_bugfix 2014-03-18 14:00:30 +02:00
Roman Donchenko bff92da970 Merge pull request #2488 from Nerei:minor_doc 2014-03-18 15:41:20 +04:00
Roman Donchenko d76226e21b Merge pull request #2456 from kurodash:pr_use_cvAlloc 2014-03-18 14:39:40 +04:00
Roman Donchenko bfb1ba371c Merge pull request #2026 from pemmanuelviel:giveFurthestPoint 2014-03-18 13:40:44 +04:00
RJ2 0470bb0e29 I have changed one sentence in tutorial, making it more understandable 2014-03-18 08:59:53 +01:00
RJ2 16869225ff It's will be better 2014-03-18 08:01:18 +01:00
Ilya Lavrenov 3940b6163b remove intel guard since the code is 2 times faster on AMD too 2014-03-17 19:11:21 +04:00
yash 51cb6998ea made the example consistent with the fuction definition and improved doc
made the example consistent with the fuction definition and improved doc
2014-03-17 18:44:02 +05:30
Anatoly Baksheev 0c02e5de25 minor doc fix 2014-03-17 17:02:49 +04:00
Roman Donchenko a489d86e5f Merge pull request #2460 from berak:b_3598_24 2014-03-17 15:52:56 +04:00
Roman Donchenko ae036838dd Merge pull request #2458 from asmorkalov:android_cmake_opencv_modules_suffix 2014-03-17 14:43:15 +04:00
Alexander Smorkalov 6b8de222d7 OpenCV_MODULES_SUFFIX variable added to OpenCVConfig.cmake to enable custom module configurations. 2014-03-17 14:32:32 +04:00
berak 5f94a205d1 fixed h / s ranges in histogram_calculation tutorial
literalinclude

literalinclude, dropped :lines:
2014-03-17 11:01:02 +01:00
Roman Donchenko 882971151d Merge pull request #2485 from Nerei:viz_correct_viewer_pose 2014-03-17 11:59:14 +04:00
Roman Donchenko 136e5eb804 Merge pull request #2484 from berak:mat_doc_24 2014-03-17 11:57:10 +04:00
Anatoly Baksheev 24d8cbf940 Viz::setViewerPose() - changed up-vector to down (common for Computer Vision & Odometry) 2014-03-16 20:07:05 +04:00
berak 80708008a4 missing () on Mat::type() 2014-03-16 14:04:05 +01:00
Andrey Pavlenko 5726e80f77 Merge pull request #2475 from ilya-lavrenov:ocl_2.4_fix 2014-03-14 19:05:55 +04:00
kuroda sho f9484bae8a fix: use "cvAlloc" wrapper function for malloc. 2014-03-14 17:09:08 +09:00
Ilya Lavrenov 61c347fb76 typos 2014-03-13 22:56:46 +04:00
Ilya Lavrenov 357a856cf6 nonfree perf tests 2014-03-13 22:35:08 +04:00
Ilya Lavrenov 6f76e7b42d improved performance of bitwise ops 2014-03-13 19:42:13 +04:00
Ilya Lavrenov adc15c2bba improved performance of cv::ocl::sum 2014-03-13 17:33:18 +04:00
Ilya Lavrenov 3ebfe60008 improved performance of cv::ocl::countNonZero 2014-03-13 15:35:53 +04:00
Ilya Lavrenov 8e79de35a8 changes for GFTT 2014-03-13 14:57:13 +04:00
Ilya Lavrenov a5afcd9f11 improved performance of cv::ocl::minMax 2014-03-13 14:35:12 +04:00
Firat Kalaycilar a87607e3ef Fixed an issue with weight assignment causing the resulting GMM weights to be unsorted in BackgroundSubtractorMOG2 2014-03-12 16:14:59 +02:00
Roman Donchenko 836635d2d5 Merge pull request #2434 from Nerei:viz_continue 2014-03-12 16:53:42 +04:00
Anatoly Baksheev 4d7a593c25 minor cmake fix fo macos 2014-03-12 16:22:22 +04:00
Roman Donchenko 1bb0c5747c Merge pull request #2462 from ibtaylor:fix_deblurring_calcBlurriness_var_name_typo 2014-03-11 17:41:18 +04:00
Andrey Pavlenko 0084dee05b Merge pull request #2448 from akarsakov:ocl_cxt_termination 2014-03-11 12:57:29 +04:00
Andrey Pavlenko 1f8df38dba Merge pull request #2457 from ilya-lavrenov:ocl_calc_hist 2014-03-11 12:37:11 +04:00
Ilya Lavrenov 3eff05e3eb added performance tests for cv::ocl::calcHist 2014-03-11 12:34:27 +04:00
Ian Taylor 45969bb3ae fix variable name typo in calcBlurriness 2014-03-10 03:02:06 -04:00
kurodash 0eaeff0641 fix: use "cvAlloc" wrapper function for malloc. 2014-03-07 19:02:37 +09:00
Andrey Pavlenko 229aa62300 Merge pull request #2445 from ilya-lavrenov:ocl_perf 2014-03-06 22:03:01 +04:00
Roman Donchenko f351540eda Merge pull request #2443 from waveform80:issue-3554 2014-03-06 17:53:31 +04:00
Alexander Karsakov 806e9241a6 Clarifying comments 2014-03-06 16:44:46 +04:00
Alexander Smorkalov b3e18d23a3 Implicit CUDA and OpenCL control for module definition added.
Feature allows to exclude CUDA or OpenCL optimizations at all even CUDA is used
on build. Exclusion of CUDA or OpenCL cut unwanted dependencies.
2014-03-06 10:31:33 +04:00
Ilya Lavrenov f7a474180b tuned some tests 2014-03-06 09:24:02 +04:00
Anatoly Baksheev fde0185a77 iteractor work 2014-03-06 03:26:21 +04:00
Vadim Pisarevsky 22f42a639f fixed doc builder warnings; make sure the tests give reasonable results when OpenCL is not available 2014-03-05 18:48:19 +04:00
Alexander Karsakov 4aa891e773 Remove clReleaseDevice call (workaround for pure virtual call on Windows) 2014-03-05 17:57:06 +04:00
Vadim Pisarevsky 60ce2b2e9f modified SURF's performance test to test OpenCL version as well 2014-03-05 17:10:51 +04:00
Vadim Pisarevsky da70b04262 made SURF_OCL default constructor parameters the same as SURF 2014-03-05 17:04:49 +04:00
Vadim Pisarevsky 3c1917771b modified OpenCL SURF API and the tests in 2.4.x to prove that it gives different from CPU results 2014-03-05 16:31:41 +04:00
Dave Hughes b184d7f27b Fix for #3554
v4l2_scan_controls_enumerate_menu is unused and causes ioctl error on
RaspberryPi and possibly other Video4Linux variants. See
http://www.raspberrypi.org/forum/viewtopic.php?f=43&t=65026 for more
detail.
2014-03-05 02:44:40 +00:00
Andrey Pavlenko ba4513503e Merge pull request #2429 from ilya-lavrenov:master_compatible_tests 2014-03-04 19:18:13 +04:00
Roman Donchenko b5248dbf3f Merge pull request #2407 from codyrigney92:LKOptFlow_NEON 2014-03-04 15:30:26 +04:00
Roman Donchenko fa3f29f2b5 Merge pull request #2439 from ilya-lavrenov:typo 2014-03-04 13:51:31 +04:00
Ilya Lavrenov 099ea91823 typos 2014-03-04 12:47:40 +04:00
Roman Donchenko a600267b9f Merge pull request #2432 from ilya-lavrenov:summary_py 2014-03-04 11:46:29 +04:00
Ilya Lavrenov 29deff8707 ability to merge logs with intersections only 2014-03-03 13:27:07 +04:00
Roman Donchenko af8aa8a2fa Merge pull request #2433 from ilya-lavrenov:typos 2014-03-03 12:20:35 +04:00
Anatoly Baksheev fb7e74c511 iteractor work 2014-03-02 23:15:53 +04:00
Ilya Lavrenov eedf86402d typos 2014-03-02 21:04:17 +04:00
Ilya Lavrenov 767b28f2e3 tests 2014-03-01 18:47:44 +04:00
Cody Rigney fbc69e444b Added NEON optimizations for LK optical flow (Intrinsics). 2014-02-28 16:48:04 -05:00
Ilya Lavrenov c1c3139368 master-like performance tests 2014-02-28 22:40:24 +04:00
Andrey Pavlenko 409bd162ff Merge pull request #2421 from akarsakov:fix_ocl_haar_intel 2014-02-28 18:22:03 +04:00
Alexander Karsakov e6f6707558 OCL: Fix for Haar classifier (thanks to Konstantin Rodyushkin). 2014-02-26 18:11:11 +04:00
Roman Donchenko 7dc22b4ea6 Merge pull request #2419 from linquize:tgit.icon 2014-02-26 17:34:49 +04:00
Linquize a228633d31 Add tgit.icon project config 2014-02-26 17:46:52 +08:00
Roman Donchenko 1db1a83410 Merge pull request #2410 from asmorkalov:android_tiff_lowmem_fix 2014-02-25 15:04:24 +04:00
Roman Donchenko 7dc549f166 Merge pull request #2411 from asmorkalov:android_mat_leak_fix 2014-02-25 12:37:01 +04:00
Alexander Smorkalov c78142acb0 Bug #3391 org.opencv.android.NativeCameraView crashes after latest OpenCV Manager update fixed.
The crash was cased by massive Mat objects leak in NativeCameraView class.
2014-02-25 11:54:03 +04:00
Alexander Smorkalov dbb7aa7856 Highgui_Tiff.decode_tile16384x16384 disabled for Android.
Last changes in test leads to SIGKILL on Android.
SIGKILL is called by out of memory killer.
2014-02-25 10:36:20 +04:00
Andrey Pavlenko d695d4a0bf Merge pull request #2406 from ilya-lavrenov:abf 2014-02-25 09:12:32 +04:00
Ilya Lavrenov e1a598c5b3 disabled ABF tests 2014-02-24 23:26:01 +04:00
Roman Donchenko 681a8c6e18 Merge pull request #2398 from nghiaho12:integral_doc 2014-02-24 14:26:41 +04:00
Nghia Ho ced8e7a813 Typo 2014-02-24 20:06:20 +11:00
Roman Donchenko 2b0c3eb170 Merge pull request #2389 from SpecLad:ios-big-endian 2014-02-24 12:44:36 +04:00
Roman Donchenko 1cf75c0cab Hardcode iOS's endianness, since the TestBigEndian module doesn't work there 2014-02-24 12:13:35 +04:00
Roman Donchenko 51421098dd Merge pull request #2201 from mattip:2.4 2014-02-21 17:57:36 +04:00
Matti Picus dc50dc7254 fix merge 2014-02-21 13:54:58 +02:00
Andrey Pavlenko 3e5890694e Merge pull request #2384 from ilya-lavrenov:perf_match 2014-02-21 15:14:12 +04:00
Matti Picus f5330a44e8 merge with origin 2014-02-21 11:59:49 +02:00
Matti Picus 31c8f2ec57 fix code, it turns out only TIFFReadRGBATile needs buffer pointer mangling 2014-02-20 22:12:22 +02:00
Matti Picus 46d128e073 add test (needs updated opencv_extra repo) 2014-02-20 22:10:22 +02:00
Ilya Lavrenov aa5311ea9f backport of master-based perf tests for matchTemplate to 2.4 2014-02-20 18:58:32 +04:00
Roman Donchenko efafd4a9e5 Merge pull request #2380 from jet47:fix-3562 2014-02-20 13:41:45 +04:00
Vladislav Vinogradov 7fd21d217a fix bug #3562:
add missing __syncthreads to edgesHysteresisLocalKernel
2014-02-20 10:24:52 +04:00
Roman Donchenko ce42593fe6 Merge pull request #2368 from asmorkalov:ocv_gcc48_warning_fix 2014-02-19 12:03:06 +04:00
Roman Donchenko 7cbc4e88de Merge pull request #2357 from akarsakov:fix_ipp_compilation_linux 2014-02-19 12:02:41 +04:00
Alexander Smorkalov 4c1ed13846 Warning fixes for GCC 4.8. 2014-02-18 23:53:35 +04:00
Roman Donchenko 8754adc021 Merge pull request #2371 from ilya-lavrenov:typo 2014-02-18 18:00:14 +04:00
Roman Donchenko af9368d35f Merge pull request #2370 from ilya-lavrenov:cuda_nlm_typo 2014-02-18 17:00:54 +04:00
Roman Donchenko c35dab9046 Merge pull request #2359 from SpecLad:moments-no-vectorize 2014-02-18 17:00:32 +04:00
Roman Donchenko 6f19ef8631 Merge pull request #2361 from alekcac:ios_camera_changes 2014-02-18 15:44:56 +04:00
Roman Donchenko 5cb2d1c20d Merge pull request #2338 from asmorkalov:ocv_gcov 2014-02-18 14:25:16 +04:00
Ilya Lavrenov e460a29cab typo 2014-02-18 14:24:17 +04:00
Ilya Lavrenov da9bdf9c15 fixes typo and unused variables 2014-02-18 14:16:54 +04:00
Alexander Shishkov 77df5948e7 removed trailing spaces 2014-02-18 13:56:26 +04:00
Roman Donchenko e35d98e566 Worked around an apparent GCC bug in moments. 2014-02-18 13:51:27 +04:00
Roman Donchenko b7659c62f3 Merge pull request #2366 from yashdv:mat_copyto_doc_bug 2014-02-18 13:47:46 +04:00
yash 394c74b349 edited the doc for mat::copyto and clarified the part regarding reallocation by .create 2014-02-18 15:04:27 +05:30
Andrey Pavlenko e6420c523d Merge pull request #2235 from alalek:ocl_svm_perf_test 2014-02-18 13:33:16 +04:00
Alexander Smorkalov de6d13088f gcov tool support added. 2014-02-18 12:59:41 +04:00
Roman Donchenko 689589ebaa Merge pull request #2365 from yashdv:image_tutorial_doc_bug 2014-02-18 11:58:11 +04:00
Roman Donchenko 95d7ecb33f Merge pull request #2364 from ilya-lavrenov:unused_field 2014-02-18 11:57:36 +04:00
Roman Donchenko 13182da945 Merge pull request #2363 from alekcac:introduction_tut_fix 2014-02-18 11:56:57 +04:00
Roman Donchenko a0a4f6c23d Merge pull request #2362 from alekcac:docs_style_change 2014-02-18 11:56:36 +04:00
Roman Donchenko 224124b69e Merge pull request #2360 from Evgenij-Gr:XLSreport 2014-02-18 11:56:21 +04:00
yash 38ef8894b7 Made a sentence in the doc for Mat::copyTo more clearer 2014-02-18 10:51:05 +05:30
yash 017a282c7a Minor error in the documentation Load and Save Image 2014-02-18 10:34:58 +05:30
Ilya Lavrenov 01527c44fd removed unused field 2014-02-17 21:50:00 +04:00
Alexander Shishkov a8eab26bae fixed incorrect code in introduction tutorial 2014-02-17 18:10:08 +04:00
Alexander Shishkov 63235f51f0 fixed year in copyright 2014-02-17 17:56:12 +04:00
Alexander Shishkov cc529d971b removed tabs 2014-02-17 17:37:02 +04:00
Evgeniy 8236181c62 Added more colorizing options to XLS generating script 2014-02-17 17:01:23 +04:00
Alexander Karsakov 01a980aa9e Fixed compilation with IPP on Linux. Added linking with Intel compiler runtime libraries. 2014-02-17 16:56:02 +04:00
Roman Donchenko e8d26b02ac Merge pull request #2339 from jet47:gpu-warnings 2014-02-17 13:35:15 +04:00
Roman Donchenko 7358b44222 Merge pull request #2343 from yashdv:template_matching_doc_fix 2014-02-17 13:33:29 +04:00
Marijan Vukcevich 9a98cd6e65 Update cap_ios_abstract_camera.mm
AVCaptureVideoPreviewLayer setOrientation is depricated. This fixes the warning and provides backward compatibility.
2014-02-17 13:23:25 +04:00
Roman Donchenko b6dafed5ba Merge pull request #2342 from yashdv:android_doc_fix 2014-02-17 12:21:20 +04:00
Roman Donchenko 8cbb284b7b Merge pull request #2348 from ilya-lavrenov:typo 2014-02-17 12:02:59 +04:00
Roman Donchenko 9fcb0b2201 Merge pull request #2349 from jet47:fix-bug-3552 2014-02-17 11:52:01 +04:00
Roman Donchenko aad289a3a2 Merge pull request #2344 from kirill-kornyakov:replace-gittip-button 2014-02-17 11:48:03 +04:00
Vladislav Vinogradov 150e522bee fix bug #3552:
replace std::swap with own code
2014-02-16 12:17:17 +04:00
Ilya Lavrenov 510680a5df typo 2014-02-16 01:42:02 +04:00
Anatoly Baksheev 03bd82796d source compatibility with master 2014-02-15 23:40:09 +04:00
Anatoly Baksheev 56754e907d fixed crash for windows if console widow is closed or CTRL_C/CTRL_BRAK keys in console are pressed. 2014-02-15 20:08:04 +04:00
Anatoly Baksheev 1a5dfe421d Added WidgetMerger, Polyline - colors support for each point independently, simple widgets now compute color array instead of setting global color 2014-02-15 17:02:17 +04:00
Kirill Kornyakov ed1aa73dd3 Replaced Gittip button 2014-02-15 13:10:09 +04:00
yash cce225f6e9 fixed doc/tutorials/imgproc/histograms/template_matching/template_matching.rst 2014-02-15 12:48:42 +05:30
yash e2f5001b11 fixed doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst 2014-02-14 23:04:03 +05:30
Vladislav Vinogradov 8b8c368148 fixed two warnings in gpu sources (-Wshadow, -Wno-sign-promo) 2014-02-14 17:56:03 +04:00
Vladislav Vinogradov b4845d8c9f temporary disable performance test for alphaComp function(cherry picked from commit 1ce5165cb7) 2014-02-14 17:12:31 +04:00
Alexander Alekhin d1606b4aa3 ocl: added SVM perf test 2014-02-14 16:36:46 +04:00
Roman Donchenko e0d991cf46 Merge pull request #2335 from jet47:gpu-alphacomp-test 2014-02-14 16:20:45 +04:00
Roman Donchenko fa272c43c2 Merge pull request #2323 from stuart8c:issue2601_2.4_fix_16bit_tiff_reading_on_big_endian_host 2014-02-14 15:37:09 +04:00
Roman Donchenko a1de9e9ad5 Merge pull request #2329 from ilya-lavrenov:macosx_ogl 2014-02-14 14:38:37 +04:00
Vladislav Vinogradov 1ce5165cb7 temporary disable performance test for alphaComp function 2014-02-14 14:27:43 +04:00
Stuart Cunningham 1454843b81 Fix build of libtiff on big endian host due to defined but empty WORDS_BIGENDIAN macro 2014-02-14 16:16:17 +11:00
Ilya Lavrenov b92a46c130 some more fixes 2014-02-13 23:47:18 +04:00
Alexander Smorkalov ea51396731 Dead code removed as this cannot be null in Java.
(cherry picked from commit dbe7634286)
2014-02-13 20:13:47 +04:00
Vladislav Vinogradov aa82f921cc temporary disable perf test for StereoBeliefPropagation(cherry picked from commit eb247d826f) 2014-02-13 20:13:38 +04:00
Vladislav Vinogradov 2da7eae2c4 increase epsilon for AlphaComp sanity test for integer input(cherry picked from commit 9e69e2a07a) 2014-02-13 20:13:27 +04:00
Roman Donchenko ecbe843061 Merge pull request #2333 from asmorkalov:java_dead_code_fix 2014-02-13 19:21:56 +04:00
Roman Donchenko b4a535272c Merge pull request #2332 from jet47:gpu-fixes 2014-02-13 19:21:45 +04:00
Alexander Smorkalov dbe7634286 Dead code removed as this cannot be null in Java. 2014-02-13 18:17:47 +04:00
Alexander Smorkalov 25159d8e81 Application pause/resume fix for Android sample NativeActivity.
(cherry picked from commit 7da3e98dfd)
2014-02-13 17:59:23 +04:00
Roman Donchenko b8d8b0568c Merge pull request #2331 from asmorkalov:android_native_activity_finish 2014-02-13 17:57:46 +04:00
Vladislav Vinogradov eb247d826f temporary disable perf test for StereoBeliefPropagation 2014-02-13 17:25:59 +04:00
Vladislav Vinogradov 9e69e2a07a increase epsilon for AlphaComp sanity test for integer input 2014-02-13 17:16:43 +04:00
Alexander Smorkalov 7da3e98dfd Application pause/resume fix for Android sample NativeActivity. 2014-02-13 16:47:02 +04:00
Stuart Cunningham 55b9c0374c Fix cmake detection of build platform endianness
Improve comments to indicate actual usage of WORDS_BIGENDIAN where
it is tested with #ifdef rather than #if
2014-02-13 22:59:30 +11:00
Roman Donchenko 91ab92c349 Merge pull request #2318 from gongzg:2.4 2014-02-13 12:16:19 +04:00
Ilya Lavrenov 879c0196d4 enabled OpenGL on MacOSX 2014-02-13 00:17:15 +04:00
Alexander Smorkalov f40ffe4763 LICENSE and README files installation rules added.
(cherry picked from commit e55f2b2602)
2014-02-12 19:36:52 +04:00
Alexander Smorkalov 116311b7b4 opencv_run_all_tests.sh implemented for Android SDK.
(cherry picked from commit d02c291160)
2014-02-12 19:36:43 +04:00
Stuart Cunningham 5d43d3ca88 Fix Windows build of grfmt_tiff.cpp by using libtiff's integer types. 2014-02-12 23:41:38 +11:00
Roman Donchenko e55679079f Merge pull request #2320 from asmorkalov:ocv_readme_license_install 2014-02-12 16:27:24 +04:00
Roman Donchenko 3994cfbc59 Merge pull request #2321 from asmorkalov:android_run_all_tests 2014-02-12 15:41:29 +04:00
Alexander Smorkalov d02c291160 opencv_run_all_tests.sh implemented for Android SDK. 2014-02-12 14:21:58 +04:00
Stuart Cunningham 8bbce0a2a2 Fix reading of 16-bit TIFF images on big endian host.
Use correct integer types for arguments to TIFFGetField to avoid corruption
of values and failed loads of TIFF file when using cv::imread().

Added test where both big and little endian TIFF files are read using imread().

Fixed build of 3rdparty libtiff on big endian hosts.

Reduced memory required during decode_tile16384x16384 test by not converting
large grayscale test image to color image during read.
2014-02-12 21:21:06 +11:00
Alexander Smorkalov e55f2b2602 LICENSE and README files installation rules added. 2014-02-12 14:06:41 +04:00
Zhigang Gong 9aef26e2ad Workaround a LLVM/Clang 3.3 bug.
The LLVM/Clang 3.3 has a bug when compile a cl kernel with
assignment of a scalar to a vector data type. This patch
could work around this bug.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-02-12 13:14:43 +08:00
Anatoly Baksheev 261546f6f6 casting Vec3b operator for viz::Color 2014-02-11 23:27:19 +04:00
Roman Donchenko bb4199b177 Merge pull request #2314 from ilya-lavrenov:typo 2014-02-11 17:06:38 +04:00
Ilya Lavrenov 281666887e typo 2014-02-11 14:25:37 +04:00
Alexander Smorkalov f1ef3a4865 OpenCV version++. 2014-02-11 10:15:02 +04:00
Vladislav Vinogradov 9997aa8187 decrease input size for several gpu tests to fix "timed out" error:
* BruteForceNonLocalMeans
* OpticalFlowBM(cherry picked from commit 8b44a42a40)
2014-02-10 15:48:52 +04:00
Vladislav Vinogradov f15b42018c fix nonfree module compilation without CUDA(cherry picked from commit 3e1f74f2ca) 2014-02-10 15:48:52 +04:00
Alexander Smorkalov f9e9ae85bd dynamicuda module disabled in OpenCv.mk for all arches except armeabi-v7a.
(cherry picked from commit b10d4b05ed)
2014-02-10 15:48:52 +04:00
Alexander Smorkalov a49beb7c73 Multiple improvements in OpenCV examples build.
EMBED_CUDA and FORCE_EMBED_OPENCV flags added to cmake macro add_android_project;
INSTALL_CUDA_LIBRARIES option added to OpenCV.mk
opencv_dynamicuda library installation with enabled OPENCV_INSTALL_MODULES flag fixed;
CUDA initialization apportunity added to OpenCVLoader.initDebug();
Tutorial-4-CUDA sample reimplemented with static OpenCV and CUDA initialization.
(cherry picked from commit 6ae4a9b09b)
2014-02-10 15:48:52 +04:00
Alexander Smorkalov 51dff5b9e8 project.properties file generation fixed for per-component installation.
(cherry picked from commit 65b4d77959)
2014-02-10 15:48:52 +04:00
Alexander Smorkalov 826fc00374 Tests install path fix for Android SDK.
(cherry picked from commit 0cd0e4749b)
2014-02-10 15:48:52 +04:00
Vladislav Vinogradov c10692deff save previous values of LOCAL_* variables and restore them at the end(cherry picked from commit 286fe261d0) 2014-02-10 15:48:52 +04:00
Vladislav Vinogradov daa7b9ce5f fix path to CUDA libraries (use targets/armv7-linux-androideabi/lib)(cherry picked from commit a098fb1803) 2014-02-10 15:48:52 +04:00
Vladislav Vinogradov 1ab02631b0 update stitching sample
(cherry picked from commit 214cbabc40)
2014-02-10 15:48:52 +04:00
Vladislav Vinogradov 3e755b2290 turn on CUDA part of stitching module on Android for non-dynamic build(cherry picked from commit a138e5a6a5) 2014-02-10 15:48:51 +04:00
Vladislav Vinogradov f15a167df4 turn on CUDA part of nonfree module on Android for non-dynamic build(cherry picked from commit d8f7377122) 2014-02-10 15:48:51 +04:00
Ilya Lavrenov f6367a2ea5 eliminated possible memory leak
(cherry picked from commit e7e63fac6c)
2014-02-10 15:48:51 +04:00
Vladislav Vinogradov 5f88e2b496 fix #3477:
CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING property is not supported
by all VideoCapture backends. Some backends can return 0.0 or -1.0.(cherry picked from commit c41e8006c7)
2014-02-10 15:48:51 +04:00
Seunghoon Park 2c7cf52e3b fixing bug #3345. use norm to make sure two matrices are the same.
(cherry picked from commit eb9d7c4dd5)
2014-02-10 15:48:51 +04:00
Andrey Pavlenko b7c5083a87 removing duplicated legacy license, the actual instance is in 'opencv/LICENSE'
(cherry picked from commit dca5684145)
2014-02-10 15:48:51 +04:00
Vladislav Vinogradov d5d88efd5d fix GpuMat::copyTo method with mask:
fill destination matrix with zeros if it was reallocated(cherry picked from commit dda999545c)
2014-02-10 15:48:51 +04:00
Drew Jetter 6cb7a7be18 Fixed bug #3489: The code assumed that two global variables would be constructed in a particular order, but global variable initialization order is compiler-dependent.
(cherry picked from commit 6bf599b1bc)
2014-02-10 15:48:51 +04:00
Pierre-Emmanuel Viel cdea6b532f Fix: freeing previous elements has to be done before loading new parameters to avoid trying to delete unexisting objects if arrays size was modified
(cherry picked from commit 3f458c6eb1)
2014-02-10 15:48:51 +04:00
ComFreek d01e3529a6 Corrected package name in tutorial
See also #2101(cherry picked from commit ae795e5797)
2014-02-10 15:48:51 +04:00
Nghia Ho 7c13d3277c Fixed a valgrind 'Conditional jump or move depends on uninitialised value(s)' on cv::kmeans(...). The original code used points(sampleCount, 1, CV_32FC2), which confused generateCentersPP into thinking it is a 1 dimensional center, instead of 2. As a result it would set only the x variable and leave y unitialised.
(cherry picked from commit 601b7d1dd3)
2014-02-10 15:48:51 +04:00
Robbert Klarenbeek 345b3b0bdd Fix algorithm setter argument validation for uchar(cherry picked from commit e21c6e19db) 2014-02-10 15:48:51 +04:00
Kazuki Matsuda a65d7d4dd3 Fix typo of SparseMat_<_Tp>::SparseMat_(const SparseMat& m)
Fix compilation erros when compiling this constructor.
First argument type of "convertTo" should be instance, not a pointer of instance.

First pull request was created for master branch.
But it should be marged for 2.4.
https://github.com/Itseez/opencv/pull/2113
(cherry picked from commit 2ae20c74a2)
2014-02-10 15:48:51 +04:00
Ilya Lavrenov 5e986f3347 fixed bug #3319
(cherry picked from commit 4f9c081dc3)
2014-02-10 15:48:50 +04:00
Seunghoon Park 27a8bb471b fixing bug #3345. don't use BORDER_ISOLATED alone. it should be combined with some border type
(cherry picked from commit 2272a58769)
2014-02-10 15:48:50 +04:00
Seunghoon Park 7868733002 fixing bug #3345
(cherry picked from commit b036fc756a)
2014-02-10 15:48:50 +04:00
Ilya Lavrenov 469aef2e5e fixed bug #3341
(cherry picked from commit 09d25e11c6)
2014-02-10 15:48:50 +04:00
Roman Donchenko 5e00fc6afe Fixed MinGW build by declaring the minimal required Windows version.
Also deleted miscellaneous remaining multimon cruft.
Deleted #include <winuser.h>, because <windows.h> includes it
already.

This should have a nice side effect of preventing us from
accidentally using any Windows API that's too new.
(cherry picked from commit 795c108f2b)
2014-02-10 15:48:50 +04:00
Anatoly Baksheev f1c062c30a cloud collection finalize 2014-02-10 15:45:46 +04:00
Anatoly Baksheev 5dc17f5d58 Fixed all OpenGL issues for Macos (via objective-C++ layer) 2014-02-10 15:45:46 +04:00
Anatoly Baksheev 069dd8a068 default meshlab background 2014-02-10 15:45:45 +04:00
Anatoly Baksheev f8ccc115ef proper render call order (fixes some issues with VTK6.1) 2014-02-10 15:45:45 +04:00
Anatoly Baksheev 17fea0dd0a fixed size_t/int conversion warnings 2014-02-10 15:45:45 +04:00
Anatoly Baksheev 998aefd1d1 cloud collection merges data only on rendering 2014-02-10 15:45:44 +04:00
Anatoly Baksheev 975a6299fa More proper OpneCv+Qt+Vtk issues handling (http://code.opencv.org/issues/3492) 2014-02-10 15:45:44 +04:00
Anatoly Baksheev eb8728d727 Updated cloud io functionality - removed dependency from VTK legacy 2014-02-10 15:45:44 +04:00
Roman Donchenko 63dbe66b41 Merge pull request #2308 from jet47:gpu-tests-timeout 2014-02-10 15:10:31 +04:00
Roman Donchenko 3cc27c769c Merge pull request #2309 from Nerei:fixed_cl_exe_hang_with_eigen 2014-02-10 14:59:05 +04:00
Anatoly Baksheev becbfa6281 Fixed Cl.exe hang for VS2008 x64 with Eigen::exp() function 2014-02-10 13:41:27 +04:00
Vladislav Vinogradov 8b44a42a40 decrease input size for several gpu tests to fix "timed out" error:
* BruteForceNonLocalMeans
* OpticalFlowBM
2014-02-10 11:50:14 +04:00
Vladislav Vinogradov 5170f0b5da fixed several bugs in CUDA Canny implementation:
* out of border access in edgesHysteresisLocalKernel
* incorrect usage of atomicAdd(cherry picked from commit 5dbdadb769)
2014-02-07 20:59:13 +04:00
Vladislav Vinogradov dc2dbb4173 Revert "disable gpu Canny and HoughCircles perf tests:"
This reverts commit dbce90692a.
(cherry picked from commit bfc27271e2)
2014-02-07 20:58:49 +04:00
Roman Donchenko 1d68a89947 Merge pull request #2303 from jet47:gpu-canny-fix 2014-02-07 19:03:14 +04:00
Vladislav Vinogradov 79e4f7eb78 Revert "disable CUDA generalized Hough Transform"
This reverts commit 33d42b740c.
(cherry picked from commit 5d099df578)
2014-02-07 18:24:57 +04:00
Vladislav Vinogradov cc73c7000f fix epsilons for several gpu tests
(cherry picked from commit 3e4bb371c8)
2014-02-07 18:24:44 +04:00
Vladislav Vinogradov 8bb26fa5de Revert "disable gpu CvtColor.*2HSV tests:"
This reverts commit 952027a853.
(cherry picked from commit b6ba1f226c)
2014-02-07 18:24:35 +04:00
Vladislav Vinogradov 48612d7c58 Revert "disable gpu Subtract_Array test:"
This reverts commit e91bf95d58.
(cherry picked from commit da44a2fac1)
2014-02-07 18:24:23 +04:00
Alexander Smorkalov 8ba84f4b47 Implicit testdata directory permissions setup added.
(cherry picked from commit b86088b89c)
2014-02-07 18:24:11 +04:00
Roman Donchenko 48f95d92ae Merge pull request #2294 from jet47:fix-gpu-issues 2014-02-07 16:54:49 +04:00
Vladislav Vinogradov 5dbdadb769 fixed several bugs in CUDA Canny implementation:
* out of border access in edgesHysteresisLocalKernel
* incorrect usage of atomicAdd
2014-02-07 16:04:29 +04:00
Roman Donchenko 5a8363a44e Merge pull request #2301 from jet47:fix-nonfree-build 2014-02-07 15:34:46 +04:00
Roman Donchenko d534d04f25 Merge pull request #2297 from asmorkalov:ocv_testdata_install_perms_fix 2014-02-07 15:33:59 +04:00
Vladislav Vinogradov bfc27271e2 Revert "disable gpu Canny and HoughCircles perf tests:"
This reverts commit dbce90692a.
2014-02-07 14:55:06 +04:00
Alexander Smorkalov b86088b89c Implicit testdata directory permissions setup added. 2014-02-07 14:42:35 +04:00
Roman Donchenko c1b6bf21d5 Merge pull request #2300 from asmorkalov:android_no_cuda_not_armeabiv7a 2014-02-07 14:39:09 +04:00
Vladislav Vinogradov 3e1f74f2ca fix nonfree module compilation without CUDA 2014-02-07 13:40:37 +04:00
Alexander Smorkalov b10d4b05ed dynamicuda module disabled in OpenCv.mk for all arches except armeabi-v7a. 2014-02-07 12:46:24 +04:00
Vladislav Vinogradov 5d099df578 Revert "disable CUDA generalized Hough Transform"
This reverts commit 33d42b740c.
2014-02-06 18:02:14 +04:00
Vladislav Vinogradov 3e4bb371c8 fix epsilons for several gpu tests 2014-02-06 18:02:14 +04:00
Vladislav Vinogradov b6ba1f226c Revert "disable gpu CvtColor.*2HSV tests:"
This reverts commit 952027a853.
2014-02-06 18:02:14 +04:00
Vladislav Vinogradov da44a2fac1 Revert "disable gpu Subtract_Array test:"
This reverts commit e91bf95d58.
2014-02-06 18:02:14 +04:00
Alexander Smorkalov bc653add74 Absolute path to tests in opencv_run_app_tests.sh fixed.
(cherry picked from commit 530702c5f2)
2014-02-06 17:16:21 +04:00
Roman Donchenko 34b02f6437 Merge pull request #2276 from asmorkalov:android_install_cuda 2014-02-06 16:45:49 +04:00
Alexander Smorkalov 6ae4a9b09b Multiple improvements in OpenCV examples build.
EMBED_CUDA and FORCE_EMBED_OPENCV flags added to cmake macro add_android_project;
INSTALL_CUDA_LIBRARIES option added to OpenCV.mk
opencv_dynamicuda library installation with enabled OPENCV_INSTALL_MODULES flag fixed;
CUDA initialization apportunity added to OpenCVLoader.initDebug();
Tutorial-4-CUDA sample reimplemented with static OpenCV and CUDA initialization.
2014-02-06 15:32:57 +04:00
Roman Donchenko e91b818e3e Merge pull request #2292 from asmorkalov:ocv_deb_tests_script_path_fix 2014-02-06 14:59:31 +04:00
Andrey Pavlenko a078653ab4 Merge pull request #2285 from KonstantinMatskevich:ocl_test_cascade2.4 2014-02-06 12:52:28 +04:00
Alexander Smorkalov 530702c5f2 Absolute path to tests in opencv_run_app_tests.sh fixed. 2014-02-06 12:35:14 +04:00
Roman Donchenko feed2c074d Merge pull request #2288 from asmorkalov:android_project_properties_generation_fix 2014-02-06 12:20:08 +04:00
Alexander Smorkalov 65b4d77959 project.properties file generation fixed for per-component installation. 2014-02-05 17:34:19 +04:00
Roman Donchenko 4ab891e9e5 Merge pull request #2277 from asmorkalov:android_test_path_fix 2014-02-05 12:36:37 +04:00
Konstantin Matskevich 435615ba2e update test CascadeClassifier 2014-02-05 12:23:36 +04:00
Roman Donchenko ccda4bf008 Merge pull request #2274 from jet47:android-mk-fix 2014-02-04 18:59:14 +04:00
Alexander Smorkalov 0cd0e4749b Tests install path fix for Android SDK. 2014-02-04 16:23:01 +04:00
Vladislav Vinogradov 286fe261d0 save previous values of LOCAL_* variables and restore them at the end 2014-02-04 10:29:43 +04:00
Vladislav Vinogradov a098fb1803 fix path to CUDA libraries (use targets/armv7-linux-androideabi/lib) 2014-02-04 10:29:15 +04:00
Vadim Pisarevsky b8c6adc569 Merge pull request #2178 from Nerei:viz_backport 2014-02-03 16:16:51 +04:00
Roman Donchenko cd1ffd169c Merge pull request #2261 from jet47:stitching-cuda-android 2014-02-03 15:35:55 +04:00
Andrey Pavlenko a1ad1f0800 Merge pull request #2259 from ilya-lavrenov:ocl_surf 2014-02-03 14:24:36 +04:00
Vladislav Vinogradov 214cbabc40 update stitching sample 2014-02-03 12:55:03 +04:00
Vladislav Vinogradov a138e5a6a5 turn on CUDA part of stitching module on Android for non-dynamic build 2014-02-03 12:35:24 +04:00
Vladislav Vinogradov d8f7377122 turn on CUDA part of nonfree module on Android for non-dynamic build 2014-02-03 11:52:43 +04:00
Ilya Lavrenov ede5b23753 rewrote perf tests for SURF 2014-02-03 02:00:29 +04:00
Alexander Smorkalov 215f78eee2 Merge branch 'android_manager_version_inc4' into 2.4.8.1-prep 2014-01-31 22:25:36 +04:00
Vladislav Vinogradov 4425dac7f4 disable gpu CvtColor.*2HSV tests:
possible bug in CPU version(cherry picked from commit 3cb8b352e52f85847d98d2b0ece32ba5bdb5c31b)
2014-01-31 22:24:20 +04:00
Vladislav Vinogradov 4f79b9de48 disable gpu Subtract_Array test:
possible bug in CPU version(cherry picked from commit 59155c1eefb6f22e362e34a8d73b31841eb3413a)
2014-01-31 22:23:55 +04:00
Vladislav Vinogradov 397ac5e68f disable gpu Canny and HoughCircles perf tests:
it fails because driver terminates CUDA kernels after time out
(cherry picked from commit fa5bbb5f8dc1a86cfe004fb258d66e56c90560d6)
2014-01-31 22:23:39 +04:00
Vladislav Vinogradov 43c75c64b5 disable NPP for GpuMat methods and for copyMakeBorder(cherry picked from commit 316d49fc0fb7a609ebb0a65efc207faea6b978a4) 2014-01-31 22:23:22 +04:00
Vladislav Vinogradov c319625a07 disable some gpu tests if library was built without CUFFT(cherry picked from commit b4b929d27cc25822dd15b5b96b8d335c59d4408c) 2014-01-31 22:23:05 +04:00
Vladislav Vinogradov a7d0448faa gpu test output files moved from cwd to temp folder(cherry picked from commit 49731ad530) 2014-01-31 22:22:49 +04:00
Alexander Smorkalov ca10e5e8ae Highgui test output fixes.
Useless output to console fixed;
Test output files moved from cwd to temp folder.
(cherry picked from commit 87935f3560)
2014-01-31 22:22:33 +04:00
Vladislav Vinogradov 32414afe72 disable performance test for gpu generalized hough(cherry picked from commit 063d8b4211) 2014-01-31 22:22:14 +04:00
Alexander Smorkalov ed10f50d25 Reports path fix for opencv_run_all_tests.sh.in script.
(cherry picked from commit 3d261e8a01)
2014-01-31 22:21:57 +04:00
Alexander Smorkalov 48d9be70d5 Android toolchain file sync with original project.
Original project: https://github.com/taka-no-me/android-cmake/
Revision: 5db45cfb87fec180b74963d3680dd60d4d8d8c3a
(cherry picked from commit c815043607)
2014-01-31 22:21:34 +04:00
Roman Donchenko 2bef73c968 Merge pull request #2249 from jet47:gpu-tests-disable 2014-01-31 20:49:05 +04:00
Roman Donchenko a518d7a1cb Merge pull request #2248 from jet47:gpu-npp-disable 2014-01-31 20:48:52 +04:00
Roman Donchenko 9ef8aeadd3 Merge pull request #2247 from jet47:gpu-test-cufft 2014-01-31 20:48:38 +04:00
Roman Donchenko e2db68f822 Merge pull request #2242 from jet47:gpu-test-fix 2014-01-31 17:24:21 +04:00
Vladislav Vinogradov 952027a853 disable gpu CvtColor.*2HSV tests:
possible bug in CPU version
2014-01-31 16:20:45 +04:00
Vladislav Vinogradov e91bf95d58 disable gpu Subtract_Array test:
possible bug in CPU version
2014-01-31 16:15:11 +04:00
Vladislav Vinogradov dbce90692a disable gpu Canny and HoughCircles perf tests:
it fails because driver terminates CUDA kernels after time out
2014-01-31 16:14:07 +04:00
Vladislav Vinogradov e630be3890 disable NPP for GpuMat methods and for copyMakeBorder 2014-01-31 15:52:06 +04:00
Vladislav Vinogradov 8401ed9395 disable some gpu tests if library was built without CUFFT 2014-01-31 15:40:59 +04:00
Roman Donchenko 7161b5bbad Merge pull request #2241 from asmorkalov:ocv_highgui_test_output_fix 2014-01-31 14:56:10 +04:00
Roman Donchenko 7e6293d9ec Merge pull request #2240 from jet47:gpu-generalized-hough 2014-01-31 14:24:04 +04:00
Roman Donchenko b13d4bafa8 Merge pull request #2238 from asmorkalov:ocv_test_package_reports 2014-01-31 13:56:48 +04:00
Vladislav Vinogradov 49731ad530 gpu test output files moved from cwd to temp folder 2014-01-31 13:19:15 +04:00
Alexander Smorkalov 3d261e8a01 Reports path fix for opencv_run_all_tests.sh.in script. 2014-01-31 13:17:12 +04:00
Alexander Smorkalov 87935f3560 Highgui test output fixes.
Useless output to console fixed;
Test output files moved from cwd to temp folder.
2014-01-31 12:49:10 +04:00
Vladislav Vinogradov 063d8b4211 disable performance test for gpu generalized hough 2014-01-31 12:40:40 +04:00
Alexander Smorkalov c6b31481b6 OpenCV Manager version++. 2014-01-31 12:15:22 +04:00
Roman Donchenko d14e007fdb Merge pull request #2231 from asmorkalov:android_toolchain_update 2014-01-30 13:22:11 +04:00
Roman Donchenko 40f6f679b8 Merge pull request #2224 from SpecLad:obsolete-immediate 2014-01-30 12:43:51 +04:00
Roman Donchenko 2b3013fd20 Merge pull request #2229 from ilya-lavrenov:possible_memory_leak 2014-01-30 12:23:20 +04:00
Alexander Smorkalov c815043607 Android toolchain file sync with original project.
Original project: https://github.com/taka-no-me/android-cmake/
Revision: 5db45cfb87fec180b74963d3680dd60d4d8d8c3a
2014-01-30 11:08:49 +04:00
Ilya Lavrenov e7e63fac6c eliminated possible memory leak 2014-01-30 01:21:04 +04:00
Roman Donchenko 0dad2876e2 Removed all use of the obsolete IMMEDIATE parameter to configure_file.
It's not documented, and it does nothing unless CMake 2.0 compatibility
is enabled (and it isn't):

https://github.com/Kitware/CMake/blob/v2.6.0/Source/cmConfigureFileCommand.cxx
2014-01-29 19:34:02 +04:00
Alexander Smorkalov 514b714cc2 opencv_run_all_tests.sh script added to -tests package.
(cherry picked from commit d45350a06a)
2014-01-29 17:41:59 +04:00
Roman Donchenko 5ae9add102 Merge pull request #2221 from asmorkalov:ocv_test_install_custom 2014-01-29 17:09:28 +04:00
Alexander Smorkalov d45350a06a opencv_run_all_tests.sh script added to -tests package. 2014-01-29 16:31:24 +04:00
Alexander Smorkalov 7fec87d3f6 Multiple fixes for tests deb package build.
Added opencv_testing.sh.in file;
opencv_testing.sh installation guarded by OS check.
(cherry picked from commit d9dc5ffa91)
2014-01-28 17:56:22 +04:00
Roman Donchenko 3e59ddbace Merge pull request #2215 from asmorkalov:ocv_testpack_fix 2014-01-28 17:51:07 +04:00
Alexander Smorkalov d9dc5ffa91 Multiple fixes for tests deb package build.
Added opencv_testing.sh.in file;
opencv_testing.sh installation guarded by OS check.
2014-01-28 16:32:26 +04:00
Roman Donchenko 7a0a9d010b Merge pull request #2205 from jet47:bug-3477-fix 2014-01-28 12:23:32 +04:00
Andrey Pavlenko 51aa649499 Merge pull request #2097 from pclove1:blur_border_isolated 2014-01-28 10:51:11 +04:00
Vladislav Vinogradov c41e8006c7 fix #3477:
CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING property is not supported
by all VideoCapture backends. Some backends can return 0.0 or -1.0.
2014-01-28 10:28:00 +04:00
Seunghoon Park eb9d7c4dd5 fixing bug #3345. use norm to make sure two matrices are the same. 2014-01-27 20:57:40 -05:00
Seunghoon Park 73389b2b9c Merge branch '2.4' into blur_border_isolated 2014-01-27 20:44:03 -05:00
Alexander Smorkalov 00d555f051 Code review notes fixed.
Env setup for testing package implemented using /etc/profile.d;
Variable with path for all native samples added;
Path for test binaries and test data updated.
(cherry picked from commit 39201e68e2)
2014-01-27 21:37:01 +04:00
Alexander Smorkalov 6cf7d6ef4e OpenCV C/C++/OCL/CUDA samples install path fixed. Install rools for tests added.
(cherry picked from commit f332cba14b)
2014-01-27 21:36:43 +04:00
Roman Donchenko 452ea4c15f Merge pull request #2209 from asmorkalov:ocv_test_install 2014-01-27 20:59:53 +04:00
Alexander Smorkalov 39201e68e2 Code review notes fixed.
Env setup for testing package implemented using /etc/profile.d;
Variable with path for all native samples added;
Path for test binaries and test data updated.
2014-01-27 18:47:09 +04:00
Alexander Smorkalov f332cba14b OpenCV C/C++/OCL/CUDA samples install path fixed. Install rools for tests added. 2014-01-27 15:49:24 +04:00
Anatoly Baksheev 3dc2dbc17e VTK off by default 2014-01-26 14:48:29 +04:00
Alexander Smorkalov 3ebdcafdd3 All installed files marked with component names for install customization.
(cherry picked from commit b75cbfde45)

Conflicts:

	cmake/OpenCVModule.cmake
2014-01-24 17:13:22 +04:00
Andrey Pavlenko d093cb54d5 Merge pull request #2194 from apavlenko:2.4_perf_haar_iter 2014-01-24 16:13:19 +04:00
Matti Picus 64fd54ffb4 fix tiled read for reading tiles into partial blocks in image 2014-01-24 13:03:47 +02:00
Alexander Smorkalov a348f3eeaa OpenCV version++ 2014-01-24 14:49:56 +04:00
Alexander Smorkalov 33f423de04 Improvements in package build.
(cherry picked from commit 086792ec06)
2014-01-24 14:48:51 +04:00
Alexander Smorkalov d6ba52c3f9 Initial Linux packages build rools for CPack.
(cherry picked from commit 7821fe2bde)

Conflicts:

	cmake/OpenCVModule.cmake
2014-01-24 14:48:19 +04:00
Vladislav Vinogradov e9638d0997 disable CUDA generalized Hough Transform
(cherry picked from commit 33d42b740c)
2014-01-24 14:46:36 +04:00
Vladislav Vinogradov 5cb0084547 split CUDA Hough sources
(cherry picked from commit d847387694)
2014-01-24 14:46:16 +04:00
Roman Donchenko 24caa80143 Merge pull request #2197 from asmorkalov:ocv_packaging2 2014-01-24 14:27:44 +04:00
Alexander Smorkalov 086792ec06 Improvements in package build. 2014-01-24 12:00:44 +04:00
Andrey Pavlenko 0a4a1d7526 temporary disabling hanging test 2014-01-24 10:07:21 +04:00
Roman Donchenko 078d49609e Merge pull request #2193 from apavlenko:2.4_lic_remove 2014-01-23 17:13:52 +04:00
Andrey Pavlenko dca5684145 removing duplicated legacy license, the actual instance is in 'opencv/LICENSE' 2014-01-23 17:05:20 +04:00
Anatoly Baksheev 9145985ff4 added guard to prevent linking VTK with Qt5 2014-01-23 16:40:24 +04:00
Roman Donchenko 7ff9d7eb2d Merge pull request #2188 from jet47:gpumat-copyto-fix 2014-01-23 13:28:12 +04:00
Roman Donchenko 3715f71aaf Merge pull request #2175 from vrabaud:2.4 2014-01-23 13:27:38 +04:00
Vincent Rabaud 167a26642e fix message sent to user during cross_compilation 2014-01-22 15:26:14 +01:00
Roman Donchenko a4b34e7ae1 Merge pull request #2181 from asmorkalov:ocv_packaging 2014-01-22 11:54:07 +04:00
Vladislav Vinogradov dda999545c fix GpuMat::copyTo method with mask:
fill destination matrix with zeros if it was reallocated
2014-01-22 10:40:14 +04:00
Alexander Smorkalov 7821fe2bde Initial Linux packages build rools for CPack. 2014-01-21 20:34:36 +04:00
Alexander Smorkalov b75cbfde45 All installed files marked with component names for install customization. 2014-01-21 20:34:36 +04:00
Roman Donchenko a548a08129 Merge pull request #2183 from jet47:cuda-hough-fix 2014-01-21 19:27:54 +04:00
Andrey Pavlenko 32bc89f094 Merge pull request #2107 from nghiaho12:nn_doc 2014-01-21 19:11:12 +04:00
Vladislav Vinogradov 33d42b740c disable CUDA generalized Hough Transform 2014-01-21 15:07:47 +04:00
Vladislav Vinogradov d847387694 split CUDA Hough sources 2014-01-21 15:07:47 +04:00
Vincent Rabaud eabcfa5652 reorder the if's for clarity 2014-01-21 10:27:37 +01:00
Vincent Rabaud 6cb90c0e97 fix cross-compilation issue with Numpy 2014-01-21 10:07:19 +01:00
Anatoly Baksheev 130914d9f4 fixed documentation warnings 2014-01-21 02:15:37 +04:00
Anatoly Baksheev 02ebc4368c Viz initial backport, compilation fixes, moved viz/viz.hpp header according to 2.4 style 2014-01-20 22:51:33 +04:00
Roman Donchenko 64244e160b Merge pull request #2171 from djetter99:fix_static_init_order 2014-01-20 19:30:29 +04:00
Drew Jetter 6bf599b1bc Fixed bug #3489: The code assumed that two global variables would be constructed in a particular order, but global variable initialization order is compiler-dependent. 2014-01-18 23:04:16 -07:00
Roman Donchenko 088535fa56 Merge pull request #2159 from SpecLad:1xN 2014-01-17 18:23:53 +04:00
Roman Donchenko 58afe5dd17 Merge pull request #2140 from Daniil-Osokin:fix_saving_untrained_svm_model 2014-01-17 14:57:57 +04:00
Roman Donchenko 5f8d8c0069 Added a test for matrix-to-vector copy and convert. 2014-01-17 14:18:31 +04:00
Roman Donchenko 4e4a7d0353 Removed an unnecessary workaround for matrix-to-vector copyTo. 2014-01-17 14:16:22 +04:00
Roman Donchenko ee97a5e757 Re-fix bug #3319 with less side effects. 2014-01-17 14:13:21 +04:00
Roman Donchenko f02204847a Revert "fixed bug #3319"
See 092f916 for explanation.

This reverts commit 4f9c081dc3.
2014-01-17 13:43:00 +04:00
Andrey Pavlenko 8dbc96fed8 Merge pull request #2143 from Daniil-Osokin:fix_docs_cvt_color_alpha_channel 2014-01-17 10:43:40 +04:00
Daniil Osokin 8ce691e679 Fixed cvtColor alpha channel docs 2014-01-16 18:36:06 +04:00
Seunghoon Park 2272a58769 fixing bug #3345. don't use BORDER_ISOLATED alone. it should be combined with some border type 2014-01-14 20:47:23 -05:00
Roman Donchenko 2fde4d8a94 Merge pull request #2145 from andreasBihlmaier:2.4 2014-01-14 11:55:29 +04:00
Roman Donchenko 2443e8090e Merge pull request #2133 from apavlenko:2.4-perf_haar 2014-01-13 19:28:09 +04:00
ahb 49dfa5a17f Fix the following error for ocl::getOpenCLPlatforms() on Ubuntu 12.04 with gcc 4.8
OpenCV Error: Unknown error code -6 (OpenCL function is not available: [clGetPlatformIDs]) in opencl_check_fn, file /home/ahb/software/opencv/modules/ocl/src/cl_runtime/cl_runtime.cpp, line 83

The issue results from modules/ocl/src/cl_runtime/cl_runtime.cpp checking for
"linux" instead of "__linux__" (cp.  http://sourceforge.net/p/predef/wiki/OperatingSystems/)

Adjust all other occurrences of "defined(linux)" as well.
2014-01-13 16:09:42 +01:00
Andrey Pavlenko 4c99196399 adding finish() to flush CL queue, renaming the test to match 'master' branch 2014-01-13 18:12:30 +04:00
Roman Donchenko 9628abc786 Merge pull request #2137 from ilya-lavrenov:gitignore 2014-01-13 16:33:16 +04:00
Roman Donchenko 87e0c26129 Merge pull request #2108 from pemmanuelviel:flannMemoryLeak 2014-01-13 16:26:02 +04:00
Daniil Osokin 5d2edced26 Added throwing exception when saving untrained SVM model 2014-01-13 13:50:30 +04:00
Andrey Pavlenko a7821c60e5 refactoring the test as it should be in 2.4 2014-01-13 11:20:17 +04:00
Ilya Lavrenov f197d8b91c updated .gitignore 2014-01-10 18:59:06 +04:00
Roman Donchenko 890f1baff0 Merge pull request #2132 from ComFreek:patch-2 2014-01-10 11:44:46 +04:00
Andrey Pavlenko 4d28e8243c 'master'-like Haar perf test 2014-01-10 00:14:48 +04:00
ComFreek ae795e5797 Corrected package name in tutorial
See also #2101
2014-01-09 17:24:20 +01:00
Roman Donchenko a13e32f5ab Merge pull request #2115 from nghiaho12:kmeans_sample 2014-01-09 16:58:29 +04:00
Roman Donchenko d509165d96 Merge pull request #2118 from ilya-lavrenov:semicolons 2014-01-09 16:21:49 +04:00
Nghia Ho bf4994554d Removed unecessary initialisation of Mat centers. 2014-01-09 21:04:17 +11:00
Roman Donchenko 7acea48788 Merge pull request #2106 from robbertkl:patch-2 2014-01-09 13:25:59 +04:00
Roman Donchenko 58882e5c22 Merge pull request #2114 from kazuki-ma:SparseMat_convertTo_typofix_24 2014-01-09 13:24:20 +04:00
Ilya Lavrenov 6b9ebcbf3d deleted extra semicolons 2014-01-07 02:52:30 +04:00
Nghia Ho 601b7d1dd3 Fixed a valgrind 'Conditional jump or move depends on uninitialised value(s)' on cv::kmeans(...). The original code used points(sampleCount, 1, CV_32FC2), which confused generateCentersPP into thinking it is a 1 dimensional center, instead of 2. As a result it would set only the x variable and leave y unitialised. 2014-01-06 20:19:07 +11:00
Kazuki Matsuda 2ae20c74a2 Fix typo of SparseMat_<_Tp>::SparseMat_(const SparseMat& m)
Fix compilation erros when compiling this constructor.
First argument type of "convertTo" should be instance, not a pointer of instance.

First pull request was created for master branch.
But it should be marged for 2.4.
https://github.com/Itseez/opencv/pull/2113
2014-01-06 02:24:14 +09:00
Pierre-Emmanuel Viel 3f458c6eb1 Fix: freeing previous elements has to be done before loading new parameters to avoid trying to delete unexisting objects if arrays size was modified 2014-01-03 13:16:36 +01:00
Nghia Ho d3e24f3cbf Improved documentation for neural network 2014-01-03 14:18:07 +11:00
Robbert Klarenbeek e21c6e19db Fix algorithm setter argument validation for uchar 2014-01-02 21:17:55 +01:00
Roman Donchenko 5327482b46 Merge pull request #2084 from ilya-lavrenov:cont 2013-12-31 16:51:30 +04:00
Ilya Lavrenov 4f9c081dc3 fixed bug #3319 2013-12-31 13:56:59 +04:00
Roman Donchenko 157202fc8d Merge pull request #2094 from SpecLad:multimon-be-gone 2013-12-31 11:40:44 +04:00
Seunghoon Park b036fc756a fixing bug #3345 2013-12-30 21:10:06 -05:00
Roman Donchenko 4ce684e61c Merge pull request #2087 from ilya-lavrenov:remap_sse2_cond 2013-12-30 18:18:42 +04:00
Roman Donchenko 795c108f2b Fixed MinGW build by declaring the minimal required Windows version.
Also deleted miscellaneous remaining multimon cruft.
Deleted #include <winuser.h>, because <windows.h> includes it
already.

This should have a nice side effect of preventing us from
accidentally using any Windows API that's too new.
2013-12-30 18:13:42 +04:00
Roman Donchenko 6811d2ab24 Merge pull request #2086 from ilya-lavrenov:mul_fix 2013-12-30 17:57:43 +04:00
Ilya Lavrenov 5db1754d49 SSE2 optimization of cv::remap doesn't work with big images 2013-12-30 17:13:40 +04:00
Ilya Lavrenov 09d25e11c6 fixed bug #3341 2013-12-30 16:47:54 +04:00
Roman Donchenko a0c98dcefa Merge pull request #2092 from alalek:fix_mingw_warn 2013-12-30 15:34:16 +04:00
Alexander Alekhin 44970ddf56 eliminate MINGW pragma warning 2013-12-30 12:31:00 +04:00
Pierre-Emmanuel Viel 9cb48606ba Merge remote-tracking branch 'upstream/2.4' into LshOrthogonalSubvectors 2013-12-27 00:19:37 +01:00
Pierre-Emmanuel Viel 8e93c19de3 Fix a heap issue with static on Windows 2013-12-26 23:46:52 +01:00
Pierre-Emmanuel Viel e85bacff7b Avoid obtaining several identical dimensions between two LSH sub-vectors by choosing orthogonal sub-vectors. 2013-12-26 19:44:23 +01:00
Pierre-Emmanuel Viel d3ac1bc314 When a cluster is empty for KMeans, it's better to give it the point from another cluster j that is the furthest one from center j. 2013-12-20 01:00:55 +01:00
Pierre-Emmanuel Viel 0d19685f95 Move templates in dist.h in order to share them between KMeansIndex and HierarchicalClusteringIndex classes. 2013-12-18 20:48:34 +01:00
Pierre-Emmanuel Viel fa749de0dc As some processed distances are already ^2, use template to select whether or not we have to ^2 in KMeanspp 2013-12-18 20:48:25 +01:00
Pierre-Emmanuel Viel 5aeeaa6fce Apply to KMeansIndex KMeanspp the same modification as in HierarchicalClusteringIndex 2013-12-18 20:48:15 +01:00
Pierre-Emmanuel Viel 45e0e5f8e9 Pick centers in KMeans++ with a probability proportional to their distance^2, instead of simple distance, to previous centers 2013-12-18 20:48:02 +01:00
1140 changed files with 778512 additions and 369648 deletions
+1
View File
@@ -1,6 +1,7 @@
*.autosave
*.pyc
*.user
*~
.*.swp
.DS_Store
.sw[a-z]
+2
View File
@@ -0,0 +1,2 @@
[tgit]
icon = doc/opencv.ico
+1
View File
@@ -0,0 +1 @@
ippicv
+10 -10
View File
@@ -1,11 +1,11 @@
set(HAVE_FFMPEG 1)
set(HAVE_FFMPEG_CODEC 1)
set(HAVE_FFMPEG_FORMAT 1)
set(HAVE_FFMPEG_UTIL 1)
set(HAVE_FFMPEG_SWSCALE 1)
set(HAVE_GENTOO_FFMPEG 1)
set(FFMPEG_libavcodec_FOUND 1)
set(FFMPEG_libavformat_FOUND 1)
set(FFMPEG_libavutil_FOUND 1)
set(FFMPEG_libswscale_FOUND 1)
set(FFMPEG_libavresample_FOUND 1)
set(ALIASOF_libavcodec_VERSION 55.18.102)
set(ALIASOF_libavformat_VERSION 55.12.100)
set(ALIASOF_libavutil_VERSION 52.38.100)
set(ALIASOF_libswscale_VERSION 2.3.100)
set(FFMPEG_libavcodec_VERSION 55.18.102)
set(FFMPEG_libavformat_VERSION 55.12.100)
set(FFMPEG_libavutil_VERSION 52.38.100)
set(FFMPEG_libswscale_VERSION 2.3.100)
set(FFMPEG_libavresample_VERSION 1.0.1)
+1 -1
View File
@@ -210,7 +210,7 @@
#include <string>
#endif
#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)
#if defined(__linux__) || defined(__APPLE__) || defined(__MACOSX)
#include <alloca.h>
#include <emmintrin.h>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -1
View File
@@ -38,6 +38,8 @@ set_target_properties(${JASPER_LIBRARY}
PROPERTIES
OUTPUT_NAME ${JASPER_LIBRARY}
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME ${JASPER_LIBRARY}
COMPILE_PDB_NAME_DEBUG "${JASPER_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
)
@@ -46,5 +48,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
-1
View File
@@ -842,7 +842,6 @@ static int jas_cmshapmat_apply(jas_cmpxform_t *pxform, jas_cmreal_t *in,
*dst++ = a2;
}
} else {
assert(0);
while (--cnt >= 0) {
a0 = *src++;
src++;
+5 -2
View File
@@ -345,6 +345,7 @@ jas_stream_t *jas_stream_tmpfile()
{
jas_stream_t *stream;
jas_stream_fileobj_t *obj;
char *tmpname;
if (!(stream = jas_stream_create())) {
return 0;
@@ -365,10 +366,12 @@ jas_stream_t *jas_stream_tmpfile()
#ifdef _WIN32
/* Choose a file name. */
tmpnam(obj->pathname);
tmpname = tempnam(NULL, NULL);
strcpy(obj->pathname, tmpname);
free(tmpname);
/* Open the underlying file. */
if ((obj->fd = open(obj->pathname, O_CREAT | O_EXCL | O_RDWR | O_TRUNC | O_BINARY,
if ((obj->fd = open(obj->pathname, O_CREAT | O_EXCL | O_RDWR | O_TRUNC | O_BINARY | O_TEMPORARY | _O_SHORT_LIVED,
JAS_STREAM_PERMS)) < 0) {
jas_stream_destroy(stream);
return 0;
+4 -2
View File
@@ -26,11 +26,13 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif()
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wshift-negative-value) # clang
set_target_properties(${JPEG_LIBRARY}
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME ${JPEG_LIBRARY}
COMPILE_PDB_NAME_DEBUG "${JPEG_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
)
@@ -39,5 +41,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
+9 -5
View File
@@ -3,7 +3,7 @@
#
# ----------------------------------------------------------------------------
if(NEON)
if(ARM AND ENABLE_NEON AND NOT AARCH64)
project(${PNG_LIBRARY} ASM)
else()
project(${PNG_LIBRARY})
@@ -14,9 +14,11 @@ ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIR})
file(GLOB lib_srcs *.c)
file(GLOB lib_hdrs *.h)
if(NEON)
list(APPEND lib_srcs arm/filter_neon.S)
add_definitions(-DPNG_ARM_NEON)
if(ARM AND ENABLE_NEON AND NOT AARCH64)
list(APPEND lib_srcs arm/filter_neon.S arm/arm_init.c)
add_definitions(-DPNG_ARM_NEON_OPT=2)
else()
add_definitions(-DPNG_ARM_NEON_OPT=0)
endif()
# ----------------------------------------------------------------------------------
@@ -47,6 +49,8 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align)
set_target_properties(${PNG_LIBRARY}
PROPERTIES OUTPUT_NAME ${PNG_LIBRARY}
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME ${PNG_LIBRARY}
COMPILE_PDB_NAME_DEBUG "${PNG_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
)
@@ -55,5 +59,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
+42 -31
View File
@@ -10,20 +10,16 @@ this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.5.12, July 11, 2012, are
Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
Cosmin Truta
libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors
libpng versions 1.0.7, July 1, 2000, through 1.5.27, May 26, 2016, are
Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors:
Simon-Pierre Cadieux
Eric S. Raymond
Mans Rullgard
Cosmin Truta
Gilles Vollant
and with the following additions to the disclaimer:
@@ -36,18 +32,20 @@ and with the following additions to the disclaimer:
the user.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-0.96,
with the following individuals added to the list of Contributing Authors:
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
libpng-0.96, and are distributed according to the same disclaimer and
license as libpng-0.96, with the following individuals added to the list
of Contributing Authors:
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996, 1997 Andreas Dilger
Distributed according to the same disclaimer and license as libpng-0.88,
with the following individuals added to the list of Contributing Authors:
Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
and are distributed according to the same disclaimer and license as
libpng-0.88, with the following individuals added to the list of
Contributing Authors:
John Bowler
Kevin Bracey
@@ -57,7 +55,7 @@ with the following individuals added to the list of Contributing Authors:
Tom Tanner
libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
@@ -80,13 +78,13 @@ Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
@@ -94,18 +92,31 @@ supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
A "png_get_copyright" function is available, for convenient use in "about"
boxes and the like:
TRADEMARK:
printf("%s",png_get_copyright(NULL));
The name "libpng" has not been registered by the Copyright owner
as a trademark in any jurisdiction. However, because libpng has
been distributed and maintained world-wide, continually since 1995,
the Copyright owner claims "common-law trademark protection" in any
jurisdiction where common-law trademark is recognized.
Also, the PNG logo (in PNG format, of course) is supplied in the
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
OSI CERTIFICATION:
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
certification mark of the Open Source Initiative.
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
a certification mark of the Open Source Initiative. OSI has not addressed
the additional disclaimers inserted at version 1.0.7.
EXPORT CONTROL:
The Copyright owner believes that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because
it is open source, publicly available software, that does not contain
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
734.7(b).
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
July 11, 2012
May 26, 2016
+36 -25
View File
@@ -1,11 +1,11 @@
README for libpng version 1.5.12 - July 11, 2012 (shared library 15.0)
README for libpng version 1.5.27 - May 26, 2016 (shared library 15.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
Libpng comes in several distribution formats. Get libpng-*.tar.gz,
libpng-*.tar.xz or libpng-*.tar.bz2 if you want UNIX-style line endings
in the text files, or lpng*.zip if you want DOS-style line endings.
Libpng comes in several distribution formats. Get libpng-*.tar.gz or
libpng-*.tar.xz or if you want UNIX-style line endings in the text files,
or lpng*.7z or lpng*.zip if you want DOS-style line endings.
Version 0.89 was the first official release of libpng. Don't let the
fact that it's the first release fool you. The libpng library has been in
@@ -23,18 +23,25 @@ earlier versions if you are using a shared library. The type of the
png_uint_32, which will affect shared-library applications that use
this function.
To avoid problems with changes to the internals of png_info_struct,
To avoid problems with changes to the internals of the png info_struct,
new APIs have been made available in 0.95 to avoid direct application
access to info_ptr. These functions are the png_set_<chunk> and
png_get_<chunk> functions. These functions should be used when
accessing/storing the info_struct data, rather than manipulating it
directly, to avoid such problems in the future.
It is important to note that the APIs do not make current programs
It is important to note that the APIs did not make current programs
that access the info struct directly incompatible with the new
library. However, it is strongly suggested that new programs use
the new APIs (as shown in example.c and pngtest.c), and older programs
be converted to the new format, to facilitate upgrades in the future.
library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
be a transitional release, members of the png_struct and the
info_struct can still be accessed, but the compiler will issue a
warning about deprecated usage. Since libpng-1.5.0, direct access
to these structs is not allowed, and the definitions of the structs
reside in private pngstruct.h and pnginfo.h header files that are not
accessible to applications. It is strongly suggested that new
programs use the new APIs (as shown in example.c and pngtest.c), and
older programs be converted to the new format, to facilitate upgrades
in the future.
****
Additions since 0.90 include the ability to compile libpng as a
@@ -77,17 +84,21 @@ compression library that is useful for more things than just PNG files.
You can use zlib as a drop-in replacement for fread() and fwrite() if
you are so inclined.
zlib should be available at the same place that libpng is, or at.
ftp://ftp.info-zip.org/pub/infozip/zlib
zlib should be available at the same place that libpng is, or at zlib.net.
You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/documents/
This code is currently being archived at libpng.sf.net in the
[DOWNLOAD] area, and on CompuServe, Lib 20 (PNG SUPPORT)
at GO GRAPHSUP. If you can't find it in any of those places,
e-mail me, and I'll help you find it.
[DOWNLOAD] area, and at ftp://ftp.simplesystems.org. If you can't find it
in any of those places, e-mail me, and I'll help you find it.
I am not a lawyer, but I believe that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because it
is open source, publicly available software, that does not contain any
encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
If you have any code changes, requests, problems, etc., please e-mail
them to me. Also, I'd appreciate any make files or project files,
@@ -105,7 +116,7 @@ based in a large way on Guy's and Andreas' earlier work), and the PNG
development group.
Send comments/corrections/commendations to png-mng-implement at
lists.sourceforge.net (subscription required; visit
lists.sourceforge.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe) or to glennrp at users.sourceforge.net
@@ -123,7 +134,7 @@ and ...". If in doubt, send questions to me. I'll bounce them
to others, if necessary.
Please do not send suggestions on how to change PNG. We have
been discussing PNG for sixteen years now, and it is official and
been discussing PNG for twenty years now, and it is official and
finished. If you have suggestions for libpng, however, I'll
gladly listen. Even if your suggestion is not used immediately,
it may be used later.
@@ -167,23 +178,23 @@ Files in this distribution:
pngwrite.c => High-level write functions
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
arm => Contains optimized code for the ARM platform
contrib => Contributions
gregbook => source code for PNG reading and writing, from
Greg Roelofs' "PNG: The Definitive Guide",
O'Reilly, 1999
msvctest => Builds and runs pngtest using a MSVC workspace
pngminus => Simple pnm2png and png2pnm programs
pngsuite => Test images
visupng => Contains a MSVC workspace for VisualPng
libtests => Test programs
pngminim => Minimal decoder, encoder, and progressive decoder
programs demonstrating use of pngusr.dfa
pngminus => Simple pnm2png and png2pnm programs
pngsuite => Test images
visupng => Contains a MSVC workspace for VisualPng
projects => Contains project files and workspaces for
building a DLL
cbuilder5 => Contains a Borland workspace for building
libpng and zlib
visualc6 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
owatcom => Contains a WATCOM project for building libpng
visualc71 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
xcode => Contains an Apple xcode
vstudio => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
scripts => Directory containing scripts for building libpng:
(see scripts/README.txt for the list of scripts)
+232
View File
@@ -0,0 +1,232 @@
/* arm_init.c - NEON optimised filter functions
*
* Copyright (c) 2013 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
* Last changed in libpng 1.6.8 [December 19, 2013]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
* called.
*/
#define _POSIX_SOURCE 1
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_ARM_NEON_OPT > 0
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */
#include <signal.h> /* for sig_atomic_t */
#ifdef __ANDROID__
/* Linux provides access to information about CPU capabilites via
* /proc/self/auxv, however Android blocks this while still claiming to be
* Linux. The Andoid NDK, however, provides appropriate support.
*
* Documentation: http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
*/
#include <cpu-features.h>
static int
png_have_neon(png_structp png_ptr)
{
/* This is a whole lot easier than the mess below, however it is probably
* implemented as below, therefore it is better to cache the result (these
* function calls may be slow!)
*/
PNG_UNUSED(png_ptr)
return android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM &&
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
}
#elif defined(__linux__)
/* The generic __linux__ implementation requires reading /proc/self/auxv and
* looking at each element for one that records NEON capabilities.
*/
#include <unistd.h> /* for POSIX 1003.1 */
#include <errno.h> /* for EINTR */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <elf.h>
#include <asm/hwcap.h>
/* A read call may be interrupted, in which case it returns -1 and sets errno to
* EINTR if nothing was done, otherwise (if something was done) a partial read
* may result.
*/
static size_t
safe_read(png_structp png_ptr, int fd, void *buffer_in, size_t nbytes)
{
size_t ntotal = 0;
char *buffer = png_voidcast(char*, buffer_in);
while (nbytes > 0)
{
unsigned int nread;
int iread;
/* Passing nread > INT_MAX to read is implementation defined in POSIX
* 1003.1, therefore despite the unsigned argument portable code must
* limit the value to INT_MAX!
*/
if (nbytes > INT_MAX)
nread = INT_MAX;
else
nread = (unsigned int)/*SAFE*/nbytes;
iread = read(fd, buffer, nread);
if (iread == -1)
{
/* This is the devil in the details, a read can terminate early with 0
* bytes read because of EINTR, yet it still returns -1 otherwise end
* of file cannot be distinguished.
*/
if (errno != EINTR)
{
png_warning(png_ptr, "/proc read failed");
return 0; /* I.e., a permanent failure */
}
}
else if (iread < 0)
{
/* Not a valid 'read' result: */
png_warning(png_ptr, "OS /proc read bug");
return 0;
}
else if (iread > 0)
{
/* Continue reading until a permanent failure, or EOF */
buffer += iread;
nbytes -= (unsigned int)/*SAFE*/iread;
ntotal += (unsigned int)/*SAFE*/iread;
}
else
return ntotal;
}
return ntotal; /* nbytes == 0 */
}
static int
png_have_neon(png_structp png_ptr)
{
int fd = open("/proc/self/auxv", O_RDONLY);
Elf32_auxv_t aux;
/* Failsafe: failure to open means no NEON */
if (fd == -1)
{
png_warning(png_ptr, "/proc/self/auxv open failed");
return 0;
}
while (safe_read(png_ptr, fd, &aux, sizeof aux) == sizeof aux)
{
if (aux.a_type == AT_HWCAP && (aux.a_un.a_val & HWCAP_NEON) != 0)
{
close(fd);
return 1;
}
}
close(fd);
return 0;
}
#else
/* We don't know how to do a run-time check on this system */
# error "no support for run-time ARM NEON checks"
#endif /* OS checks */
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
#endif
void
png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
{
/* The switch statement is compiled in for ARM_NEON_API, the call to
* png_have_neon is compiled in for ARM_NEON_CHECK. If both are defined
* the check is only performed if the API has not set the NEON option on
* or off explicitly. In this case the check controls what happens.
*
* If the CHECK is not compiled in and the option is UNSET the behavior prior
* to 1.6.7 was to use the NEON code - this was a bug caused by having the
* wrong order of the 'ON' and 'default' cases. UNSET now defaults to OFF,
* as documented in png.h
*/
#ifdef PNG_ARM_NEON_API_SUPPORTED
switch ((pp->options >> PNG_ARM_NEON) & 3)
{
case PNG_OPTION_UNSET:
/* Allow the run-time check to execute if it has been enabled -
* thus both API and CHECK can be turned on. If it isn't supported
* this case will fall through to the 'default' below, which just
* returns.
*/
#endif /* PNG_ARM_NEON_API_SUPPORTED */
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
{
static volatile sig_atomic_t no_neon = -1; /* not checked */
if (no_neon < 0)
no_neon = !png_have_neon(pp);
if (no_neon)
return;
}
#ifdef PNG_ARM_NEON_API_SUPPORTED
break;
#endif
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifdef PNG_ARM_NEON_API_SUPPORTED
default: /* OFF or INVALID */
return;
case PNG_OPTION_ON:
/* Option turned on */
break;
}
#endif
/* IMPORTANT: any new external functions used here must be declared using
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
* 'prefix' option to configure works:
*
* ./configure --with-libpng-prefix=foobar_
*
* Verify you have got this right by running the above command, doing a build
* and examining pngprefix.h; it must contain a #define for every external
* function you add. (Notice that this happens automatically for the
* initialization function.)
*/
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon;
if (bpp == 3)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth3_neon;
}
else if (bpp == 4)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth4_neon;
}
}
#endif /* PNG_ARM_NEON_OPT > 0 */
#endif /* PNG_READ_SUPPORTED */
+3 -3
View File
@@ -1,8 +1,8 @@
diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h
index 07b2b0b..e7824b8 100644
index 8bdcccc..0f1c638 100644
--- a/3rdparty/libpng/pngpriv.h
+++ b/3rdparty/libpng/pngpriv.h
@@ -360,7 +360,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
@@ -372,7 +372,7 @@
/* Memory model/platform independent fns */
#ifndef PNG_ABORT
@@ -11,7 +11,7 @@ index 07b2b0b..e7824b8 100644
# define PNG_ABORT() ExitProcess(0)
# else
# define PNG_ABORT() abort()
@@ -378,7 +378,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
@@ -390,7 +390,7 @@
# define png_memcpy _fmemcpy
# define png_memset _fmemset
#else
+238 -178
View File
@@ -1,8 +1,8 @@
/* png.c - location for general purpose libpng functions
*
* Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.23 [July 23, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -14,7 +14,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_5_12 Your_png_h_is_not_version_1_5_12;
typedef png_libpng_version_1_5_27 Your_png_h_is_not_version_1_5_27;
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -26,15 +26,20 @@ typedef png_libpng_version_1_5_12 Your_png_h_is_not_version_1_5_12;
void PNGAPI
png_set_sig_bytes(png_structp png_ptr, int num_bytes)
{
unsigned int nb = (unsigned int)num_bytes;
png_debug(1, "in png_set_sig_bytes");
if (png_ptr == NULL)
return;
if (num_bytes > 8)
if (num_bytes < 0)
nb = 0;
if (nb > 8)
png_error(png_ptr, "Too many bytes for PNG signature");
png_ptr->sig_bytes = (png_byte)(num_bytes < 0 ? 0 : num_bytes);
png_ptr->sig_bytes = (png_byte)nb;
}
/* Checks whether the supplied bytes match the PNG signature. We allow
@@ -73,13 +78,16 @@ PNG_FUNCTION(voidpf /* PRIVATE */,
png_zalloc,(voidpf png_ptr, uInt items, uInt size),PNG_ALLOCATED)
{
png_voidp ptr;
png_structp p=(png_structp)png_ptr;
png_uint_32 save_flags=p->flags;
png_structp p;
png_uint_32 save_flags;
png_alloc_size_t num_bytes;
if (png_ptr == NULL)
return (NULL);
p=(png_structp)png_ptr;
save_flags=p->flags;
if (items > PNG_UINT_32_MAX/size)
{
png_warning (p, "Potential overflow in png_zalloc()");
@@ -146,9 +154,10 @@ png_calculate_crc(png_structp png_ptr, png_const_bytep ptr, png_size_t length)
do
{
uInt safeLength = (uInt)length;
#ifndef __COVERITY__
if (safeLength == 0)
safeLength = (uInt)-1; /* evil, but safe */
#endif
crc = crc32(crc, ptr, safeLength);
/* The following should never issue compiler warnings, if they do the
@@ -171,49 +180,51 @@ png_calculate_crc(png_structp png_ptr, png_const_bytep ptr, png_size_t length)
int
png_user_version_check(png_structp png_ptr, png_const_charp user_png_ver)
{
if (user_png_ver)
/* Libpng versions 1.0.0 and later are binary compatible if the version
* string matches through the second '.'; we must recompile any
* applications that use any older library version.
*/
if (user_png_ver != NULL)
{
int i = 0;
int i = -1;
int found_dots = 0;
do
{
if (user_png_ver[i] != png_libpng_ver[i])
i++;
if (user_png_ver[i] != PNG_LIBPNG_VER_STRING[i])
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
} while (png_libpng_ver[i++]);
if (user_png_ver[i] == '.')
found_dots++;
} while (found_dots < 2 && user_png_ver[i] != 0 &&
PNG_LIBPNG_VER_STRING[i] != 0);
}
else
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH)
if ((png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) != 0)
{
/* Libpng 0.90 and later are binary incompatible with libpng 0.89, so
* we must recompile any applications that use any older library version.
* For versions after libpng 1.0, we will be compatible, so we need
* only check the first digit.
*/
if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] ||
(user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
(user_png_ver[0] == '0' && user_png_ver[2] < '9'))
{
#ifdef PNG_WARNINGS_SUPPORTED
size_t pos = 0;
char m[128];
size_t pos = 0;
char m[128];
pos = png_safecat(m, sizeof m, pos, "Application built with libpng-");
pos = png_safecat(m, sizeof m, pos, user_png_ver);
pos = png_safecat(m, sizeof m, pos, " but running with ");
pos = png_safecat(m, sizeof m, pos, png_libpng_ver);
pos = png_safecat(m, (sizeof m), pos,
"Application built with libpng-");
pos = png_safecat(m, (sizeof m), pos, user_png_ver);
pos = png_safecat(m, (sizeof m), pos, " but running with ");
pos = png_safecat(m, (sizeof m), pos, PNG_LIBPNG_VER_STRING);
PNG_UNUSED(pos)
png_warning(png_ptr, m);
png_warning(png_ptr, m);
#endif
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
png_ptr->flags = 0;
png_ptr->flags = 0;
#endif
return 0;
}
return 0;
}
/* Success return. */
@@ -300,6 +311,8 @@ png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
png_destroy_struct(info_ptr);
info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
*ptr_ptr = info_ptr;
if (info_ptr == NULL)
return;
}
/* Set everything to 0 */
@@ -337,42 +350,43 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
#ifdef PNG_TEXT_SUPPORTED
/* Free text item num or (if num == -1) all text items */
if ((mask & PNG_FREE_TEXT) & info_ptr->free_me)
if (info_ptr->text != 0 &&
((mask & PNG_FREE_TEXT) & info_ptr->free_me) != 0)
{
if (num != -1)
{
if (info_ptr->text && info_ptr->text[num].key)
{
png_free(png_ptr, info_ptr->text[num].key);
info_ptr->text[num].key = NULL;
}
png_free(png_ptr, info_ptr->text[num].key);
info_ptr->text[num].key = NULL;
}
else
{
int i;
for (i = 0; i < info_ptr->num_text; i++)
png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, i);
png_free(png_ptr, info_ptr->text[i].key);
png_free(png_ptr, info_ptr->text);
info_ptr->text = NULL;
info_ptr->num_text=0;
info_ptr->num_text = 0;
}
}
#endif
#ifdef PNG_tRNS_SUPPORTED
/* Free any tRNS entry */
if ((mask & PNG_FREE_TRNS) & info_ptr->free_me)
if (((mask & PNG_FREE_TRNS) & info_ptr->free_me) != 0)
{
info_ptr->valid &= ~PNG_INFO_tRNS;
png_free(png_ptr, info_ptr->trans_alpha);
info_ptr->trans_alpha = NULL;
info_ptr->valid &= ~PNG_INFO_tRNS;
info_ptr->num_trans = 0;
}
#endif
#ifdef PNG_sCAL_SUPPORTED
/* Free any sCAL entry */
if ((mask & PNG_FREE_SCAL) & info_ptr->free_me)
if (((mask & PNG_FREE_SCAL) & info_ptr->free_me) != 0)
{
png_free(png_ptr, info_ptr->scal_s_width);
png_free(png_ptr, info_ptr->scal_s_height);
@@ -384,20 +398,20 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
#ifdef PNG_pCAL_SUPPORTED
/* Free any pCAL entry */
if ((mask & PNG_FREE_PCAL) & info_ptr->free_me)
if (((mask & PNG_FREE_PCAL) & info_ptr->free_me) != 0)
{
png_free(png_ptr, info_ptr->pcal_purpose);
png_free(png_ptr, info_ptr->pcal_units);
info_ptr->pcal_purpose = NULL;
info_ptr->pcal_units = NULL;
if (info_ptr->pcal_params != NULL)
{
int i;
for (i = 0; i < (int)info_ptr->pcal_nparams; i++)
{
for (i = 0; i < info_ptr->pcal_nparams; i++)
png_free(png_ptr, info_ptr->pcal_params[i]);
info_ptr->pcal_params[i] = NULL;
}
png_free(png_ptr, info_ptr->pcal_params);
info_ptr->pcal_params = NULL;
}
@@ -406,8 +420,8 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
#endif
#ifdef PNG_iCCP_SUPPORTED
/* Free any iCCP entry */
if ((mask & PNG_FREE_ICCP) & info_ptr->free_me)
/* Free any profile entry */
if (((mask & PNG_FREE_ICCP) & info_ptr->free_me) != 0)
{
png_free(png_ptr, info_ptr->iccp_name);
png_free(png_ptr, info_ptr->iccp_profile);
@@ -419,74 +433,62 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
#ifdef PNG_sPLT_SUPPORTED
/* Free a given sPLT entry, or (if num == -1) all sPLT entries */
if ((mask & PNG_FREE_SPLT) & info_ptr->free_me)
if (info_ptr->splt_palettes != 0 &&
((mask & PNG_FREE_SPLT) & info_ptr->free_me) != 0)
{
if (num != -1)
{
if (info_ptr->splt_palettes)
{
png_free(png_ptr, info_ptr->splt_palettes[num].name);
png_free(png_ptr, info_ptr->splt_palettes[num].entries);
info_ptr->splt_palettes[num].name = NULL;
info_ptr->splt_palettes[num].entries = NULL;
}
}
else
{
if (info_ptr->splt_palettes_num)
{
int i;
for (i = 0; i < (int)info_ptr->splt_palettes_num; i++)
png_free_data(png_ptr, info_ptr, PNG_FREE_SPLT, i);
png_free(png_ptr, info_ptr->splt_palettes);
info_ptr->splt_palettes = NULL;
info_ptr->splt_palettes_num = 0;
}
info_ptr->valid &= ~PNG_INFO_sPLT;
}
}
#endif
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
if (png_ptr->unknown_chunk.data)
{
png_free(png_ptr, png_ptr->unknown_chunk.data);
png_ptr->unknown_chunk.data = NULL;
}
if ((mask & PNG_FREE_UNKN) & info_ptr->free_me)
{
if (num != -1)
{
if (info_ptr->unknown_chunks)
{
png_free(png_ptr, info_ptr->unknown_chunks[num].data);
info_ptr->unknown_chunks[num].data = NULL;
}
png_free(png_ptr, info_ptr->splt_palettes[num].name);
png_free(png_ptr, info_ptr->splt_palettes[num].entries);
info_ptr->splt_palettes[num].name = NULL;
info_ptr->splt_palettes[num].entries = NULL;
}
else
{
int i;
if (info_ptr->unknown_chunks_num)
for (i = 0; i < info_ptr->splt_palettes_num; i++)
{
for (i = 0; i < info_ptr->unknown_chunks_num; i++)
png_free_data(png_ptr, info_ptr, PNG_FREE_UNKN, i);
png_free(png_ptr, info_ptr->unknown_chunks);
info_ptr->unknown_chunks = NULL;
info_ptr->unknown_chunks_num = 0;
png_free(png_ptr, info_ptr->splt_palettes[i].name);
png_free(png_ptr, info_ptr->splt_palettes[i].entries);
}
png_free(png_ptr, info_ptr->splt_palettes);
info_ptr->splt_palettes = NULL;
info_ptr->splt_palettes_num = 0;
info_ptr->valid &= ~PNG_INFO_sPLT;
}
}
#endif
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
if (info_ptr->unknown_chunks != 0 &&
((mask & PNG_FREE_UNKN) & info_ptr->free_me) != 0)
{
if (num != -1)
{
png_free(png_ptr, info_ptr->unknown_chunks[num].data);
info_ptr->unknown_chunks[num].data = NULL;
}
else
{
int i;
for (i = 0; i < info_ptr->unknown_chunks_num; i++)
png_free(png_ptr, info_ptr->unknown_chunks[i].data);
png_free(png_ptr, info_ptr->unknown_chunks);
info_ptr->unknown_chunks = NULL;
info_ptr->unknown_chunks_num = 0;
}
}
#endif
#ifdef PNG_hIST_SUPPORTED
/* Free any hIST entry */
if ((mask & PNG_FREE_HIST) & info_ptr->free_me)
if (((mask & PNG_FREE_HIST) & info_ptr->free_me) != 0)
{
png_free(png_ptr, info_ptr->hist);
info_ptr->hist = NULL;
@@ -495,9 +497,9 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
#endif
/* Free any PLTE entry that was internally allocated */
if ((mask & PNG_FREE_PLTE) & info_ptr->free_me)
if (((mask & PNG_FREE_PLTE) & info_ptr->free_me) != 0)
{
png_zfree(png_ptr, info_ptr->palette);
png_free(png_ptr, info_ptr->palette);
info_ptr->palette = NULL;
info_ptr->valid &= ~PNG_INFO_PLTE;
info_ptr->num_palette = 0;
@@ -505,16 +507,14 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* Free any image bits attached to the info structure */
if ((mask & PNG_FREE_ROWS) & info_ptr->free_me)
if (((mask & PNG_FREE_ROWS) & info_ptr->free_me) != 0)
{
if (info_ptr->row_pointers)
if (info_ptr->row_pointers != 0)
{
int row;
for (row = 0; row < (int)info_ptr->height; row++)
{
png_uint_32 row;
for (row = 0; row < info_ptr->height; row++)
png_free(png_ptr, info_ptr->row_pointers[row]);
info_ptr->row_pointers[row] = NULL;
}
png_free(png_ptr, info_ptr->row_pointers);
info_ptr->row_pointers = NULL;
}
@@ -655,14 +655,15 @@ png_get_copyright(png_const_structp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
"libpng version 1.5.12 - July 11, 2012" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2012 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"libpng version 1.5.27 - May 26, 2016" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
return "libpng version 1.5.12 - July 11, 2012\
Copyright (c) 1998-2012 Glenn Randers-Pehrson\
return "libpng version 1.5.27 - May 26, 2016\
Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
# endif
@@ -892,7 +893,8 @@ int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy)
/* Check xy and, implicitly, z. Note that wide gamut color spaces typically
* have end points with 0 tristimulus values (these are impossible end
* points, but they are used to cover the possible colors.)
* points, but they are used to cover the possible colors). We check
* xy.whitey against 5, not 0, to avoid a possible integer overflow.
*/
if (xy.redx < 0 || xy.redx > PNG_FP_1) return 1;
if (xy.redy < 0 || xy.redy > PNG_FP_1-xy.redx) return 1;
@@ -901,7 +903,7 @@ int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy)
if (xy.bluex < 0 || xy.bluex > PNG_FP_1) return 1;
if (xy.bluey < 0 || xy.bluey > PNG_FP_1-xy.bluex) return 1;
if (xy.whitex < 0 || xy.whitex > PNG_FP_1) return 1;
if (xy.whitey < 0 || xy.whitey > PNG_FP_1-xy.whitex) return 1;
if (xy.whitey < 5 || xy.whitey > PNG_FP_1-xy.whitex) return 1;
/* The reverse calculation is more difficult because the original tristimulus
* value had 9 independent values (red,green,blue)x(X,Y,Z) however only 8
@@ -1165,6 +1167,17 @@ int png_XYZ_from_xy_checked(png_structp png_ptr, png_XYZ *XYZ, png_xy xy)
}
#endif
#ifdef __GNUC__
/* This exists solely to work round a warning from GNU C. */
static int /* PRIVATE */
png_gt(size_t a, size_t b)
{
return a > b;
}
#else
# define png_gt(a,b) ((a) > (b))
#endif
void /* PRIVATE */
png_check_IHDR(png_structp png_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth,
@@ -1179,53 +1192,68 @@ png_check_IHDR(png_structp png_ptr,
png_warning(png_ptr, "Image width is zero in IHDR");
error = 1;
}
else if (width > PNG_UINT_31_MAX)
{
png_warning(png_ptr, "Invalid image width in IHDR");
error = 1;
}
else if (png_gt(width,
(PNG_SIZE_MAX >> 3) /* 8-byte RGBA pixels */
- 48 /* big_row_buf hack */
- 1 /* filter byte */
- 7*8 /* rounding width to multiple of 8 pix */
- 8)) /* extra max_pixel_depth pad */
{
/* The size of the row must be within the limits of this architecture.
* Because the read code can perform arbitrary transformations the
* maximum size is checked here. Because the code in png_read_start_row
* adds extra space "for safety's sake" in several places a conservative
* limit is used here.
*
* NOTE: it would be far better to check the size that is actually used,
* but the effect in the real world is minor and the changes are more
* extensive, therefore much more dangerous and much more difficult to
* write in a way that avoids compiler warnings.
*/
png_warning(png_ptr, "Image width is too large for this architecture");
error = 1;
}
else
{
# ifdef PNG_SET_USER_LIMITS_SUPPORTED
if (width > png_ptr->user_width_max)
# else
if (width > PNG_USER_WIDTH_MAX)
# endif
{
png_warning(png_ptr, "Image width exceeds user limit in IHDR");
error = 1;
}
}
if (height == 0)
{
png_warning(png_ptr, "Image height is zero in IHDR");
error = 1;
}
# ifdef PNG_SET_USER_LIMITS_SUPPORTED
if (width > png_ptr->user_width_max)
# else
if (width > PNG_USER_WIDTH_MAX)
# endif
{
png_warning(png_ptr, "Image width exceeds user limit in IHDR");
error = 1;
}
# ifdef PNG_SET_USER_LIMITS_SUPPORTED
if (height > png_ptr->user_height_max)
# else
if (height > PNG_USER_HEIGHT_MAX)
# endif
{
png_warning(png_ptr, "Image height exceeds user limit in IHDR");
error = 1;
}
if (width > PNG_UINT_31_MAX)
{
png_warning(png_ptr, "Invalid image width in IHDR");
error = 1;
}
if (height > PNG_UINT_31_MAX)
else if (height > PNG_UINT_31_MAX)
{
png_warning(png_ptr, "Invalid image height in IHDR");
error = 1;
}
if (width > (PNG_UINT_32_MAX
>> 3) /* 8-byte RGBA pixels */
- 48 /* bigrowbuf hack */
- 1 /* filter byte */
- 7*8 /* rounding of width to multiple of 8 pixels */
- 8) /* extra max_pixel_depth pad */
png_warning(png_ptr, "Width is too large for libpng to process pixels");
else
{
# ifdef PNG_SET_USER_LIMITS_SUPPORTED
if (height > png_ptr->user_height_max)
# else
if (height > PNG_USER_HEIGHT_MAX)
# endif
{
png_warning(png_ptr, "Image height exceeds user limit in IHDR");
error = 1;
}
}
/* Check other values */
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
@@ -1458,7 +1486,7 @@ png_check_fp_string(png_const_charp string, png_size_t size)
}
#endif /* pCAL or sCAL */
#ifdef PNG_READ_sCAL_SUPPORTED
#ifdef PNG_sCAL_SUPPORTED
# ifdef PNG_FLOATING_POINT_SUPPORTED
/* Utility used below - a simple accurate power of ten from an integral
* exponent.
@@ -1490,7 +1518,7 @@ png_pow10(int power)
}
while (power > 0);
if (recip) d = 1/d;
if (recip != 0) d = 1/d;
}
/* else power is 0 and d is 1 */
@@ -1722,7 +1750,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
/* Check for an exponent, if we don't need one we are
* done and just need to terminate the string. At
* this point exp_b10==(-1) is effectively if flag - it got
* to '-1' because of the decrement after outputing
* to '-1' because of the decrement after outputting
* the decimal point above (the exponent required is
* *not* -1!)
*/
@@ -1730,7 +1758,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
{
/* The following only happens if we didn't output the
* leading zeros above for negative exponent, so this
* doest add to the digit requirement. Note that the
* doesn't add to the digit requirement. Note that the
* two zeros here can only be output if the two leading
* zeros were *not* output, so this doesn't increase
* the output count.
@@ -1904,7 +1932,7 @@ png_fixed(png_structp png_ptr, double fp, png_const_charp text)
#endif
#if defined(PNG_READ_GAMMA_SUPPORTED) || \
defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG__READ_pHYs_SUPPORTED)
defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED)
/* muldiv functions */
/* This API takes signed arguments and rounds the result to the nearest
* integer (or, for a fixed point number - the standard argument - to
@@ -2008,7 +2036,7 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
if (s00 >= (D >> 1))
++result;
if (negative)
if (negative != 0)
result = -result;
/* Check for overflow. */
@@ -2044,26 +2072,31 @@ png_muldiv_warn(png_structp png_ptr, png_fixed_point a, png_int_32 times,
}
#endif
#ifdef PNG_READ_GAMMA_SUPPORTED /* more fixed point functions for gamma */
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED)
/* more fixed point functions for gamma and cHRM (xy/XYZ) suport. */
/* Calculate a reciprocal, return 0 on div-by-zero or overflow. */
png_fixed_point
png_reciprocal(png_fixed_point a)
{
if (a != 0)
{
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
double r = floor(1E10/a+.5);
double r = floor(1E10/a+.5);
if (r <= 2147483647. && r >= -2147483648.)
return (png_fixed_point)r;
if (r <= 2147483647. && r >= -2147483648.)
return (png_fixed_point)r;
#else
png_fixed_point res;
png_fixed_point res;
if (png_muldiv(&res, 100000, 100000, a))
return res;
if (png_muldiv(&res, 100000, 100000, a))
return res;
#endif
}
return 0; /* error/overflow */
}
#ifdef PNG_READ_GAMMA_SUPPORTED
/* A local convenience routine. */
static png_fixed_point
png_product2(png_fixed_point a, png_fixed_point b)
@@ -2085,6 +2118,7 @@ png_product2(png_fixed_point a, png_fixed_point b)
return 0; /* overflow */
}
#endif /* READ_GAMMA */
/* The inverse of the above. */
png_fixed_point
@@ -2092,17 +2126,20 @@ png_reciprocal2(png_fixed_point a, png_fixed_point b)
{
/* The required result is 1/a * 1/b; the following preserves accuracy. */
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
double r = 1E15/a;
r /= b;
r = floor(r+.5);
if (a != 0 && b != 0)
{
double r = 1E15/a;
r /= b;
r = floor(r+.5);
if (r <= 2147483647. && r >= -2147483648.)
return (png_fixed_point)r;
if (r <= 2147483647. && r >= -2147483648.)
return (png_fixed_point)r;
}
#else
/* This may overflow because the range of png_fixed_point isn't symmetric,
* but this API is only used for the product of file and screen gamma so it
* doesn't matter that the smallest number it can produce is 1/21474, not
* 1/100000
/* This may overflow because the range of png_fixed_point isn't
* symmetric, but this API is only used for the product of file and
* screen gamma so it doesn't matter that the smallest number it can
* produce is 1/21474, not 1/100000
*/
png_fixed_point res = png_product2(a, b);
@@ -2112,7 +2149,7 @@ png_reciprocal2(png_fixed_point a, png_fixed_point b)
return 0; /* overflow */
}
#endif /* READ_GAMMA */
#endif /* READ_GAMMA || cHRM */
#ifdef PNG_CHECK_cHRM_SUPPORTED
/* Added at libpng version 1.2.34 (Dec 8, 2008) and 1.4.0 (Jan 2,
@@ -2523,6 +2560,7 @@ png_gamma_significant(png_fixed_point gamma_val)
gamma_val > PNG_FP_1 + PNG_GAMMA_THRESHOLD_FIXED;
}
#ifdef PNG_16BIT_SUPPORTED
/* Internal function to build a single 16-bit table - the table consists of
* 'num' 256-entry subtables, where 'num' is determined by 'shift' - the amount
* to shift the input values right (or 16-number_of_signifiant_bits).
@@ -2571,7 +2609,7 @@ png_build_16bit_table(png_structp png_ptr, png_uint_16pp *ptable,
double d = floor(65535*pow(ig/(double)max, gamma_val*.00001)+.5);
sub_table[j] = (png_uint_16)d;
# else
if (shift)
if (shift != 0)
ig = (ig * 65535U + max_by_2)/max;
sub_table[j] = png_gamma_16bit_correct(ig, gamma_val);
@@ -2587,7 +2625,7 @@ png_build_16bit_table(png_structp png_ptr, png_uint_16pp *ptable,
{
png_uint_32 ig = (j << (8-shift)) + i;
if (shift)
if (shift != 0)
ig = (ig * 65535U + max_by_2)/max;
sub_table[j] = (png_uint_16)ig;
@@ -2595,6 +2633,7 @@ png_build_16bit_table(png_structp png_ptr, png_uint_16pp *ptable,
}
}
}
#endif
/* NOTE: this function expects the *inverse* of the overall gamma transformation
* required.
@@ -2872,3 +2911,24 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
}
#endif /* READ_GAMMA */
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
/* HARDWARE OPTION SUPPORT */
#ifdef PNG_SET_OPTION_SUPPORTED
int PNGAPI
png_set_option(png_structp png_ptr, int option, int onoff)
{
if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT &&
(option & 1) == 0)
{
int mask = 3 << option;
int setting = (2 + (onoff != 0)) << option;
int current = png_ptr->options;
png_ptr->options = (png_byte)((current & ~mask) | setting);
return (current & mask) >> option;
}
return PNG_OPTION_INVALID;
}
#endif
+291 -359
View File
@@ -1,8 +1,9 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.5.12 - July 11, 2012
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* libpng version 1.5.27, May 26, 2016
*
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -11,16 +12,152 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.5.12 - July 11, 2012: Glenn
* libpng versions 0.97, January 1998, through 1.5.27, May 26, 2016:
* Glenn Randers-Pehrson.
* See also "Contributing Authors", below.
*/
/*
* COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
*
* Note about libpng version numbers:
* If you modify libpng you may insert additional notices immediately following
* this sentence.
*
* Due to various miscommunications, unforeseen code incompatibilities
* and occasional factors outside the authors' control, version numbering
* on the library has not always been consistent and straightforward.
* The following table summarizes matters since version 0.89c, which was
* the first widely used release:
* This code is released under the libpng license.
*
* libpng versions 1.0.7, July 1, 2000, through 1.5.27, May 26, 2016, are
* Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are
* derived from libpng-1.0.6, and are distributed according to the same
* disclaimer and license as libpng-1.0.6 with the following individuals
* added to the list of Contributing Authors:
*
* Simon-Pierre Cadieux
* Eric S. Raymond
* Mans Rullgard
* Cosmin Truta
* Gilles Vollant
*
* and with the following additions to the disclaimer:
*
* There is no warranty against interference with your enjoyment of the
* library or against infringement. There is no warranty that our
* efforts or the library will fulfill any of your particular purposes
* or needs. This library is provided with all faults, and the entire
* risk of satisfactory quality, performance, accuracy, and effort is with
* the user.
*
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
* Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
* libpng-0.96, and are distributed according to the same disclaimer and
* license as libpng-0.96, with the following individuals added to the list
* of Contributing Authors:
*
* Tom Lane
* Glenn Randers-Pehrson
* Willem van Schaik
*
* libpng versions 0.89, June 1996, through 0.96, May 1997, are
* Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
* and are distributed according to the same disclaimer and license as
* libpng-0.88, with the following individuals added to the list of
* Contributing Authors:
*
* John Bowler
* Kevin Bracey
* Sam Bushell
* Magnus Holmgren
* Greg Roelofs
* Tom Tanner
*
* libpng versions 0.5, May 1995, through 0.88, January 1996, are
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* For the purposes of this copyright and license, "Contributing Authors"
* is defined as the following set of individuals:
*
* Andreas Dilger
* Dave Martindale
* Guy Eric Schalnat
* Paul Schmidt
* Tim Wegner
*
* The PNG Reference Library is supplied "AS IS". The Contributing Authors
* and Group 42, Inc. disclaim all warranties, expressed or implied,
* including, without limitation, the warranties of merchantability and of
* fitness for any purpose. The Contributing Authors and Group 42, Inc.
* assume no liability for direct, indirect, incidental, special, exemplary,
* or consequential damages, which may result from the use of the PNG
* Reference Library, even if advised of the possibility of such damage.
*
* Permission is hereby granted to use, copy, modify, and distribute this
* source code, or portions hereof, for any purpose, without fee, subject
* to the following restrictions:
*
* 1. The origin of this source code must not be misrepresented.
*
* 2. Altered versions must be plainly marked as such and must not
* be misrepresented as being the original source.
*
* 3. This Copyright notice may not be removed or altered from any
* source or altered source distribution.
*
* The Contributing Authors and Group 42, Inc. specifically permit, without
* fee, and encourage the use of this source code as a component to
* supporting the PNG file format in commercial products. If you use this
* source code in a product, acknowledgment is not required but would be
* appreciated.
*
* END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
*
* TRADEMARK:
*
* The name "libpng" has not been registered by the Copyright owner
* as a trademark in any jurisdiction. However, because libpng has
* been distributed and maintained world-wide, continually since 1995,
* the Copyright owner claims "common-law trademark protection" in any
* jurisdiction where common-law trademark is recognized.
*
* OSI CERTIFICATION:
*
* Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
* a certification mark of the Open Source Initiative. OSI has not addressed
* the additional disclaimers inserted at version 1.0.7.
*
* EXPORT CONTROL:
*
* The Copyright owner believes that the Export Control Classification
* Number (ECCN) for libpng is EAR99, which means not subject to export
* controls or International Traffic in Arms Regulations (ITAR) because
* it is open source, publicly available software, that does not contain
* any encryption software. See the EAR, paragraphs 734.3(b)(3) and
* 734.7(b).
*/
/*
* A "png_get_copyright" function is available, for convenient use in "about"
* boxes and the like:
*
* printf("%s", png_get_copyright(NULL));
*
* Also, the PNG logo (in PNG format, of course) is supplied in the
* files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
*/
/*
* The contributing authors would like to thank all those who helped
* with testing, bug fixes, and patience. This wouldn't have been
* possible without all of you.
*
* Thanks to Frank J. T. Wojcik for helping with the documentation.
*/
/* Note about libpng version numbers:
*
* Due to various miscommunications, unforeseen code incompatibilities
* and occasional factors outside the authors' control, version numbering
* on the library has not always been consistent and straightforward.
* The following table summarizes matters since version 0.89c, which was
* the first widely used release:
*
* source png.h png.h shared-lib
* version string int version
@@ -58,276 +195,46 @@
* 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible)
* 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible)
* 1.0.7 1 10007 (still compatible)
* 1.0.8beta1-4 1 10008 2.1.0.8beta1-4
* 1.0.8rc1 1 10008 2.1.0.8rc1
* 1.0.8 1 10008 2.1.0.8
* 1.0.9beta1-6 1 10009 2.1.0.9beta1-6
* 1.0.9rc1 1 10009 2.1.0.9rc1
* 1.0.9beta7-10 1 10009 2.1.0.9beta7-10
* 1.0.9rc2 1 10009 2.1.0.9rc2
* 1.0.9 1 10009 2.1.0.9
* 1.0.10beta1 1 10010 2.1.0.10beta1
* 1.0.10rc1 1 10010 2.1.0.10rc1
* 1.0.10 1 10010 2.1.0.10
* 1.0.11beta1-3 1 10011 2.1.0.11beta1-3
* 1.0.11rc1 1 10011 2.1.0.11rc1
* 1.0.11 1 10011 2.1.0.11
* 1.0.12beta1-2 2 10012 2.1.0.12beta1-2
* 1.0.12rc1 2 10012 2.1.0.12rc1
* 1.0.12 2 10012 2.1.0.12
* 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned)
* 1.2.0beta1-2 2 10200 2.1.2.0beta1-2
* 1.2.0beta3-5 3 10200 3.1.2.0beta3-5
* 1.2.0rc1 3 10200 3.1.2.0rc1
* 1.2.0 3 10200 3.1.2.0
* 1.2.1beta1-4 3 10201 3.1.2.1beta1-4
* 1.2.1rc1-2 3 10201 3.1.2.1rc1-2
* 1.2.1 3 10201 3.1.2.1
* 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6
* 1.0.13beta1 10 10013 10.so.0.1.0.13beta1
* 1.0.13rc1 10 10013 10.so.0.1.0.13rc1
* 1.2.2rc1 12 10202 12.so.0.1.2.2rc1
* 1.0.13 10 10013 10.so.0.1.0.13
* 1.2.2 12 10202 12.so.0.1.2.2
* 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6
* 1.2.3 12 10203 12.so.0.1.2.3
* 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3
* 1.0.14rc1 13 10014 10.so.0.1.0.14rc1
* 1.2.4rc1 13 10204 12.so.0.1.2.4rc1
* 1.0.14 10 10014 10.so.0.1.0.14
* 1.2.4 13 10204 12.so.0.1.2.4
* 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2
* 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3
* 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3
* 1.0.15 10 10015 10.so.0.1.0.15
* 1.2.5 13 10205 12.so.0.1.2.5
* 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4
* 1.0.16 10 10016 10.so.0.1.0.16
* 1.2.6 13 10206 12.so.0.1.2.6
* 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2
* 1.0.17rc1 10 10017 12.so.0.1.0.17rc1
* 1.2.7rc1 13 10207 12.so.0.1.2.7rc1
* 1.0.17 10 10017 12.so.0.1.0.17
* 1.2.7 13 10207 12.so.0.1.2.7
* 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5
* 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5
* 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5
* 1.0.18 10 10018 12.so.0.1.0.18
* 1.2.8 13 10208 12.so.0.1.2.8
* 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3
* 1.2.9beta4-11 13 10209 12.so.0.9[.0]
* 1.2.9rc1 13 10209 12.so.0.9[.0]
* 1.2.9 13 10209 12.so.0.9[.0]
* 1.2.10beta1-7 13 10210 12.so.0.10[.0]
* 1.2.10rc1-2 13 10210 12.so.0.10[.0]
* 1.2.10 13 10210 12.so.0.10[.0]
* 1.4.0beta1-5 14 10400 14.so.0.0[.0]
* 1.2.11beta1-4 13 10211 12.so.0.11[.0]
* 1.4.0beta7-8 14 10400 14.so.0.0[.0]
* 1.2.11 13 10211 12.so.0.11[.0]
* 1.2.12 13 10212 12.so.0.12[.0]
* 1.4.0beta9-14 14 10400 14.so.0.0[.0]
* 1.2.13 13 10213 12.so.0.13[.0]
* 1.4.0beta15-36 14 10400 14.so.0.0[.0]
* 1.4.0beta37-87 14 10400 14.so.14.0[.0]
* 1.4.0rc01 14 10400 14.so.14.0[.0]
* 1.4.0beta88-109 14 10400 14.so.14.0[.0]
* 1.4.0rc02-08 14 10400 14.so.14.0[.0]
* 1.4.0 14 10400 14.so.14.0[.0]
* 1.4.1beta01-03 14 10401 14.so.14.1[.0]
* 1.4.1rc01 14 10401 14.so.14.1[.0]
* 1.4.1beta04-12 14 10401 14.so.14.1[.0]
* 1.4.1 14 10401 14.so.14.1[.0]
* 1.4.2 14 10402 14.so.14.2[.0]
* 1.4.3 14 10403 14.so.14.3[.0]
* 1.4.4 14 10404 14.so.14.4[.0]
* 1.5.0beta01-58 15 10500 15.so.15.0[.0]
* 1.5.0rc01-07 15 10500 15.so.15.0[.0]
* 1.5.0 15 10500 15.so.15.0[.0]
* 1.5.1beta01-11 15 10501 15.so.15.1[.0]
* 1.5.1rc01-02 15 10501 15.so.15.1[.0]
* 1.5.1 15 10501 15.so.15.1[.0]
* 1.5.2beta01-03 15 10502 15.so.15.2[.0]
* 1.5.2rc01-03 15 10502 15.so.15.2[.0]
* 1.5.2 15 10502 15.so.15.2[.0]
* 1.5.3beta01-10 15 10503 15.so.15.3[.0]
* 1.5.3rc01-02 15 10503 15.so.15.3[.0]
* 1.5.3beta11 15 10503 15.so.15.3[.0]
* 1.5.3 [omitted]
* 1.5.4beta01-08 15 10504 15.so.15.4[.0]
* 1.5.4rc01 15 10504 15.so.15.4[.0]
* 1.5.4 15 10504 15.so.15.4[.0]
* 1.5.5beta01-08 15 10505 15.so.15.5[.0]
* 1.5.5rc01 15 10505 15.so.15.5[.0]
* 1.5.5 15 10505 15.so.15.5[.0]
* 1.5.6beta01-07 15 10506 15.so.15.6[.0]
* 1.5.6rc01-03 15 10506 15.so.15.6[.0]
* 1.5.6 15 10506 15.so.15.6[.0]
* 1.5.7beta01-05 15 10507 15.so.15.7[.0]
* 1.5.7rc01-03 15 10507 15.so.15.7[.0]
* 1.5.7 15 10507 15.so.15.7[.0]
* 1.5.8beta01 15 10508 15.so.15.8[.0]
* 1.5.8rc01 15 10508 15.so.15.8[.0]
* 1.5.8 15 10508 15.so.15.8[.0]
* 1.5.9beta01-02 15 10509 15.so.15.9[.0]
* 1.5.9rc01 15 10509 15.so.15.9[.0]
* 1.5.9 15 10509 15.so.15.9[.0]
* 1.5.10beta01-05 15 10510 15.so.15.10[.0]
* 1.5.10 15 10510 15.so.15.10[.0]
* 1.5.11beta01 15 10511 15.so.15.11[.0]
* 1.5.11rc01-05 15 10511 15.so.15.11[.0]
* 1.5.11 15 10511 15.so.15.11[.0]
* 1.5.12 15 10512 15.so.15.12[.0]
* ...
* 1.0.19 10 10019 10.so.0.19[.0]
* ...
* 1.2.56 13 10256 12.so.0.56[.0]
* ...
* 1.5.27 15 10527 15.so.15.27[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
* used for changes in backward compatibility, as it is intended. The
* PNG_LIBPNG_VER macro, which is not used within libpng but is available
* for applications, is an unsigned integer of the form xyyzz corresponding
* to the source version x.y.z (leading zeros in y and z). Beta versions
* were given the previous public release number plus a letter, until
* version 1.0.6j; from then on they were given the upcoming public
* release number plus "betaNN" or "rcNN".
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
* used for changes in backward compatibility, as it is intended. The
* PNG_LIBPNG_VER macro, which is not used within libpng but is available
* for applications, is an unsigned integer of the form xyyzz corresponding
* to the source version x.y.z (leading zeros in y and z). Beta versions
* were given the previous public release number plus a letter, until
* version 1.0.6j; from then on they were given the upcoming public
* release number plus "betaNN" or "rcNN".
*
* Binary incompatibility exists only when applications make direct access
* to the info_ptr or png_ptr members through png.h, and the compiled
* application is loaded with a different version of the library.
* Binary incompatibility exists only when applications make direct access
* to the info_ptr or png_ptr members through png.h, and the compiled
* application is loaded with a different version of the library.
*
* DLLNUM will change each time there are forward or backward changes
* in binary compatibility (e.g., when a new feature is added).
* DLLNUM will change each time there are forward or backward changes
* in binary compatibility (e.g., when a new feature is added).
*
* See libpng-manual.txt or libpng.3 for more information. The PNG
* specification is available as a W3C Recommendation and as an ISO
* Specification, <http://www.w3.org/TR/2003/REC-PNG-20031110/
*/
/*
* COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
*
* If you modify libpng you may insert additional notices immediately following
* this sentence.
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.5.12, July 11, 2012, are
* Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
*
* Cosmin Truta
*
* libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
* Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.0.6
* with the following individuals added to the list of Contributing Authors:
*
* Simon-Pierre Cadieux
* Eric S. Raymond
* Gilles Vollant
*
* and with the following additions to the disclaimer:
*
* There is no warranty against interference with your enjoyment of the
* library or against infringement. There is no warranty that our
* efforts or the library will fulfill any of your particular purposes
* or needs. This library is provided with all faults, and the entire
* risk of satisfactory quality, performance, accuracy, and effort is with
* the user.
*
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-0.96,
* with the following individuals added to the list of Contributing Authors:
*
* Tom Lane
* Glenn Randers-Pehrson
* Willem van Schaik
*
* libpng versions 0.89, June 1996, through 0.96, May 1997, are
* Copyright (c) 1996, 1997 Andreas Dilger
* Distributed according to the same disclaimer and license as libpng-0.88,
* with the following individuals added to the list of Contributing Authors:
*
* John Bowler
* Kevin Bracey
* Sam Bushell
* Magnus Holmgren
* Greg Roelofs
* Tom Tanner
*
* libpng versions 0.5, May 1995, through 0.88, January 1996, are
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
*
* For the purposes of this copyright and license, "Contributing Authors"
* is defined as the following set of individuals:
*
* Andreas Dilger
* Dave Martindale
* Guy Eric Schalnat
* Paul Schmidt
* Tim Wegner
*
* The PNG Reference Library is supplied "AS IS". The Contributing Authors
* and Group 42, Inc. disclaim all warranties, expressed or implied,
* including, without limitation, the warranties of merchantability and of
* fitness for any purpose. The Contributing Authors and Group 42, Inc.
* assume no liability for direct, indirect, incidental, special, exemplary,
* or consequential damages, which may result from the use of the PNG
* Reference Library, even if advised of the possibility of such damage.
*
* Permission is hereby granted to use, copy, modify, and distribute this
* source code, or portions hereof, for any purpose, without fee, subject
* to the following restrictions:
*
* 1. The origin of this source code must not be misrepresented.
*
* 2. Altered versions must be plainly marked as such and must not
* be misrepresented as being the original source.
*
* 3. This Copyright notice may not be removed or altered from
* any source or altered source distribution.
*
* The Contributing Authors and Group 42, Inc. specifically permit, without
* fee, and encourage the use of this source code as a component to
* supporting the PNG file format in commercial products. If you use this
* source code in a product, acknowledgment is not required but would be
* appreciated.
*/
/*
* A "png_get_copyright" function is available, for convenient use in "about"
* boxes and the like:
*
* printf("%s", png_get_copyright(NULL));
*
* Also, the PNG logo (in PNG format, of course) is supplied in the
* files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
*/
/*
* Libpng is OSI Certified Open Source Software. OSI Certified is a
* certification mark of the Open Source Initiative.
*/
/*
* The contributing authors would like to thank all those who helped
* with testing, bug fixes, and patience. This wouldn't have been
* possible without all of you.
*
* Thanks to Frank J. T. Wojcik for helping with the documentation.
* See libpng.txt or libpng.3 for more information. The PNG specification
* is available as a W3C Recommendation and as an ISO Specification,
* <http://www.w3.org/TR/2003/REC-PNG-20031110/
*/
/*
* Y2K compliance in libpng:
* =========================
*
* July 11, 2012
* May 26, 2016
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.5.12 are Y2K compliant. It is my belief that
* upward through 1.5.27 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant.
*
* Libpng only has two year fields. One is a 2-byte unsigned integer
@@ -379,16 +286,18 @@
/* This is not the place to learn how to use libpng. The file libpng-manual.txt
* describes how to use libpng, and the file example.c summarizes it
* with some code on which to build. This file is useful for looking
* at the actual function definitions and structure components.
* at the actual function definitions and structure components. If that
* file has been stripped from your copy of libpng, you can find it at
* <http://www.libpng.org/pub/png/libpng-manual.txt>
*
* If you just need to read a PNG file and don't want to read the documentation
* skip to the end of this file and read the section entitled 'simplified API'.
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.5.12"
#define PNG_LIBPNG_VER_STRING "1.5.27"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.5.12 - July 11, 2012\n"
" libpng version 1.5.27 - May 26, 2016\n"
#define PNG_LIBPNG_VER_SONUM 15
#define PNG_LIBPNG_VER_DLLNUM 15
@@ -396,7 +305,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 5
#define PNG_LIBPNG_VER_RELEASE 12
#define PNG_LIBPNG_VER_RELEASE 27
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
@@ -427,7 +336,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
#define PNG_LIBPNG_VER 10512 /* 1.5.12 */
#define PNG_LIBPNG_VER 10527 /* 1.5.27 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -460,7 +369,7 @@
/* Machine specific configuration. */
# include "pngconf.h"
#endif
#endif /* PNG_VERSION_INFO_ONLY */
/*
* Added at libpng-1.2.8
@@ -549,7 +458,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef char* png_libpng_version_1_5_12;
typedef char* png_libpng_version_1_5_27;
/* Three color definitions. The order of the red, green, and blue, (and the
* exact size) is not important, although the size of the fields need to
@@ -813,22 +722,22 @@ typedef png_info FAR * FAR * png_infopp;
* data in the info_struct to be written into the output file. The values
* of the PNG_INFO_<chunk> defines should NOT be changed.
*/
#define PNG_INFO_gAMA 0x0001
#define PNG_INFO_sBIT 0x0002
#define PNG_INFO_cHRM 0x0004
#define PNG_INFO_PLTE 0x0008
#define PNG_INFO_tRNS 0x0010
#define PNG_INFO_bKGD 0x0020
#define PNG_INFO_hIST 0x0040
#define PNG_INFO_pHYs 0x0080
#define PNG_INFO_oFFs 0x0100
#define PNG_INFO_tIME 0x0200
#define PNG_INFO_pCAL 0x0400
#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */
#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */
#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */
#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */
#define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */
#define PNG_INFO_gAMA 0x0001U
#define PNG_INFO_sBIT 0x0002U
#define PNG_INFO_cHRM 0x0004U
#define PNG_INFO_PLTE 0x0008U
#define PNG_INFO_tRNS 0x0010U
#define PNG_INFO_bKGD 0x0020U
#define PNG_INFO_hIST 0x0040U
#define PNG_INFO_pHYs 0x0080U
#define PNG_INFO_oFFs 0x0100U
#define PNG_INFO_tIME 0x0200U
#define PNG_INFO_pCAL 0x0400U
#define PNG_INFO_sRGB 0x0800U /* GR-P, 0.96a */
#define PNG_INFO_iCCP 0x1000U /* ESR, 1.0.6 */
#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */
#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */
#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */
/* This is used for the transformation routines, as some of them
* change these values for the row. It also should enable using
@@ -1020,11 +929,13 @@ PNG_EXPORTA(5, png_structp, png_create_write_struct,
png_error_ptr warn_fn),
PNG_ALLOCATED);
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,
(png_const_structp png_ptr));
PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structp png_ptr,
png_size_t size));
#endif /* WRITE_CUSTOMIZE_COMPRESSION */
/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp
* match up.
@@ -1158,9 +1069,9 @@ PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structp png_ptr));
#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/
PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structp png_ptr,
int error_action, double red, double green));
int error_action, double red, double green))
PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structp png_ptr,
int error_action, png_fixed_point red, png_fixed_point green));
int error_action, png_fixed_point red, png_fixed_point green))
PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structp
png_ptr));
@@ -1228,9 +1139,9 @@ PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
#define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */
PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structp png_ptr, int mode,
double output_gamma));
double output_gamma))
PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structp png_ptr,
int mode, png_fixed_point output_gamma));
int mode, png_fixed_point output_gamma))
#endif
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)
@@ -1453,10 +1364,10 @@ PNG_EXPORT(46, void, png_set_invert_mono, (png_structp png_ptr));
*/
PNG_FP_EXPORT(47, void, png_set_background, (png_structp png_ptr,
png_const_color_16p background_color, int background_gamma_code,
int need_expand, double background_gamma));
int need_expand, double background_gamma))
PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structp png_ptr,
png_const_color_16p background_color, int background_gamma_code,
int need_expand, png_fixed_point background_gamma));
int need_expand, png_fixed_point background_gamma))
#endif
#ifdef PNG_READ_BACKGROUND_SUPPORTED
# define PNG_BACKGROUND_GAMMA_UNKNOWN 0
@@ -1471,7 +1382,7 @@ PNG_EXPORT(229, void, png_set_scale_16, (png_structp png_ptr));
#endif
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
#define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */
#define PNG_READ_16_TO_8_SUPPORTED /* Name prior to 1.5.4 */
/* Strip the second byte of information from a 16-bit depth file. */
PNG_EXPORT(48, void, png_set_strip_16, (png_structp png_ptr));
#endif
@@ -1505,9 +1416,9 @@ PNG_EXPORT(49, void, png_set_quantize,
*/
PNG_FP_EXPORT(50, void, png_set_gamma,
(png_structp png_ptr, double screen_gamma,
double override_file_gamma));
double override_file_gamma))
PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structp png_ptr,
png_fixed_point screen_gamma, png_fixed_point override_file_gamma));
png_fixed_point screen_gamma, png_fixed_point override_file_gamma))
#endif
#ifdef PNG_WRITE_FLUSH_SUPPORTED
@@ -1623,8 +1534,8 @@ PNG_EXPORT(67, void, png_set_filter,
#define PNG_FILTER_UP 0x20
#define PNG_FILTER_AVG 0x40
#define PNG_FILTER_PAETH 0x80
#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \
PNG_FILTER_AVG | PNG_FILTER_PAETH)
#define PNG_FAST_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP)
#define PNG_ALL_FILTERS (PNG_FAST_FILTERS | PNG_FILTER_AVG | PNG_FILTER_PAETH)
/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.
* These defines should NOT be changed.
@@ -1636,47 +1547,17 @@ PNG_EXPORT(67, void, png_set_filter,
#define PNG_FILTER_VALUE_PAETH 4
#define PNG_FILTER_VALUE_LAST 5
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */
/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_
* defines, either the default (minimum-sum-of-absolute-differences), or
* the experimental method (weighted-minimum-sum-of-absolute-differences).
*
* Weights are factors >= 1.0, indicating how important it is to keep the
* filter type consistent between rows. Larger numbers mean the current
* filter is that many times as likely to be the same as the "num_weights"
* previous filters. This is cumulative for each previous row with a weight.
* There needs to be "num_weights" values in "filter_weights", or it can be
* NULL if the weights aren't being specified. Weights have no influence on
* the selection of the first row filter. Well chosen weights can (in theory)
* improve the compression for a given image.
*
* Costs are factors >= 1.0 indicating the relative decoding costs of a
* filter type. Higher costs indicate more decoding expense, and are
* therefore less likely to be selected over a filter with lower computational
* costs. There needs to be a value in "filter_costs" for each valid filter
* type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't
* setting the costs. Costs try to improve the speed of decompression without
* unduly increasing the compressed image size.
*
* A negative weight or cost indicates the default value is to be used, and
* values in the range [0.0, 1.0) indicate the value is to remain unchanged.
* The default values for both weights and costs are currently 1.0, but may
* change if good general weighting/cost heuristics can be found. If both
* the weights and costs are set to 1.0, this degenerates the WEIGHTED method
* to the UNWEIGHTED method, but with added encoding time/computation.
*/
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */
PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structp png_ptr,
int heuristic_method, int num_weights, png_const_doublep filter_weights,
png_const_doublep filter_costs));
png_const_doublep filter_costs))
PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
(png_structp png_ptr,
int heuristic_method, int num_weights, png_const_fixed_point_p
filter_weights, png_const_fixed_point_p filter_costs));
filter_weights, png_const_fixed_point_p filter_costs))
#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
/* Heuristic used for row filter selection. These defines should NOT be
* changed.
*/
/* The following are no longer used and will be removed from libpng-1.7: */
#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */
#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */
#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */
@@ -1690,6 +1571,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
* for PNG images, and do considerably fewer caclulations. In the future,
* these values may not correspond directly to the zlib compression levels.
*/
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
PNG_EXPORT(69, void, png_set_compression_level,
(png_structp png_ptr, int level));
@@ -1707,7 +1589,7 @@ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structp png_ptr,
PNG_EXPORT(73, void, png_set_compression_method, (png_structp png_ptr,
int method));
#endif
#endif /* WRITE_CUSTOMIZE_COMPRESSION */
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
/* Also set zlib parameters for compressing non-IDAT chunks */
@@ -1729,6 +1611,7 @@ PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structp
PNG_EXPORT(226, void, png_set_text_compression_method, (png_structp png_ptr,
int method));
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
#endif /* WRITE */
/* These next functions are called for input/output, memory, and error
* handling. They are in the file pngrio.c, pngwio.c, and pngerror.c,
@@ -1940,6 +1823,8 @@ PNG_EXPORTA(103, void, png_chunk_error, (png_structp png_ptr,
#else
/* Fatal error in PNG image of libpng - can't continue */
PNG_EXPORTA(104, void, png_err, (png_structp png_ptr), PNG_NORETURN);
# define png_error(s1,s2) png_err(s1)
# define png_chunk_error(s1,s2) png_err(s1)
#endif
#ifdef PNG_WARNINGS_SUPPORTED
@@ -1950,6 +1835,9 @@ PNG_EXPORT(105, void, png_warning, (png_structp png_ptr,
/* Non-fatal error in libpng, chunk name is prepended to message. */
PNG_EXPORT(106, void, png_chunk_warning, (png_structp png_ptr,
png_const_charp warning_message));
#else
# define png_warning(s1,s2) ((void)(s1))
# define png_chunk_warning(s1,s2) ((void)(s1))
#endif
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
@@ -2053,9 +1941,9 @@ PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter,
/* Returns pixel aspect ratio, computed from pHYs chunk data. */
PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio,
(png_const_structp png_ptr, png_const_infop info_ptr));
(png_const_structp png_ptr, png_const_infop info_ptr))
PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed,
(png_const_structp png_ptr, png_const_infop info_ptr));
(png_const_structp png_ptr, png_const_infop info_ptr))
/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels,
@@ -2088,11 +1976,11 @@ PNG_EXPORT(132, void, png_set_bKGD, (png_structp png_ptr, png_infop info_ptr,
PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structp png_ptr,
png_const_infop info_ptr, double *white_x, double *white_y, double *red_x,
double *red_y, double *green_x, double *green_y, double *blue_x,
double *blue_y));
double *blue_y))
PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_structp png_ptr,
png_const_infop info_ptr, double *red_X, double *red_Y, double *red_Z,
double *green_X, double *green_Y, double *green_Z, double *blue_X,
double *blue_Y, double *blue_Z));
double *blue_Y, double *blue_Z))
#ifdef PNG_FIXED_POINT_SUPPORTED /* Otherwise not implemented */
PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,
(png_const_structp png_ptr,
@@ -2100,7 +1988,7 @@ PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,
png_fixed_point *int_white_y, png_fixed_point *int_red_x,
png_fixed_point *int_red_y, png_fixed_point *int_green_x,
png_fixed_point *int_green_y, png_fixed_point *int_blue_x,
png_fixed_point *int_blue_y));
png_fixed_point *int_blue_y))
#endif
PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,
(png_structp png_ptr, png_const_infop info_ptr,
@@ -2108,46 +1996,46 @@ PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,
png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
png_fixed_point *int_blue_Z));
png_fixed_point *int_blue_Z))
#endif
#ifdef PNG_cHRM_SUPPORTED
PNG_FP_EXPORT(135, void, png_set_cHRM,
(png_structp png_ptr, png_infop info_ptr,
double white_x, double white_y, double red_x, double red_y, double green_x,
double green_y, double blue_x, double blue_y));
double green_y, double blue_x, double blue_y))
PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_structp png_ptr,
png_infop info_ptr, double red_X, double red_Y, double red_Z,
double green_X, double green_Y, double green_Z, double blue_X,
double blue_Y, double blue_Z));
double blue_Y, double blue_Z))
PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_white_x,
png_fixed_point int_white_y, png_fixed_point int_red_x,
png_fixed_point int_red_y, png_fixed_point int_green_x,
png_fixed_point int_green_y, png_fixed_point int_blue_x,
png_fixed_point int_blue_y));
png_fixed_point int_blue_y))
PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,
png_fixed_point int_red_Z, png_fixed_point int_green_X,
png_fixed_point int_green_Y, png_fixed_point int_green_Z,
png_fixed_point int_blue_X, png_fixed_point int_blue_Y,
png_fixed_point int_blue_Z));
png_fixed_point int_blue_Z))
#endif
#ifdef PNG_gAMA_SUPPORTED
PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA,
(png_const_structp png_ptr, png_const_infop info_ptr,
double *file_gamma));
double *file_gamma))
PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed,
(png_const_structp png_ptr, png_const_infop info_ptr,
png_fixed_point *int_file_gamma));
png_fixed_point *int_file_gamma))
#endif
#ifdef PNG_gAMA_SUPPORTED
PNG_FP_EXPORT(139, void, png_set_gAMA, (png_structp png_ptr,
png_infop info_ptr, double file_gamma));
png_infop info_ptr, double file_gamma))
PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_file_gamma));
png_infop info_ptr, png_fixed_point int_file_gamma))
#endif
#ifdef PNG_hIST_SUPPORTED
@@ -2313,7 +2201,7 @@ PNG_EXPORT(167, void, png_set_tRNS,
#ifdef PNG_sCAL_SUPPORTED
PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL,
(png_const_structp png_ptr, png_const_infop info_ptr,
int *unit, double *width, double *height));
int *unit, double *width, double *height))
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
/* NOTE: this API is currently implemented using floating point arithmetic,
* consequently it can only be used on systems with floating point support.
@@ -2323,7 +2211,7 @@ PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL,
PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed,
(png_structp png_ptr, png_const_infop info_ptr, int *unit,
png_fixed_point *width,
png_fixed_point *height));
png_fixed_point *height))
#endif
PNG_EXPORT(169, png_uint_32, png_get_sCAL_s,
(png_const_structp png_ptr, png_const_infop info_ptr,
@@ -2331,10 +2219,10 @@ PNG_EXPORT(169, png_uint_32, png_get_sCAL_s,
PNG_FP_EXPORT(170, void, png_set_sCAL,
(png_structp png_ptr, png_infop info_ptr,
int unit, double width, double height));
int unit, double width, double height))
PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_structp png_ptr,
png_infop info_ptr, int unit, png_fixed_point width,
png_fixed_point height));
png_fixed_point height))
PNG_EXPORT(171, void, png_set_sCAL_s,
(png_structp png_ptr, png_infop info_ptr,
int unit, png_const_charp swidth, png_const_charp sheight));
@@ -2447,17 +2335,17 @@ PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch,
(png_const_structp png_ptr, png_const_infop info_ptr));
PNG_FP_EXPORT(196, float, png_get_x_offset_inches,
(png_const_structp png_ptr, png_const_infop info_ptr));
(png_const_structp png_ptr, png_const_infop info_ptr))
#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed,
(png_structp png_ptr, png_const_infop info_ptr));
(png_structp png_ptr, png_const_infop info_ptr))
#endif
PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structp png_ptr,
png_const_infop info_ptr));
png_const_infop info_ptr))
#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,
(png_structp png_ptr, png_const_infop info_ptr));
(png_structp png_ptr, png_const_infop info_ptr))
#endif
# ifdef PNG_pHYs_SUPPORTED
@@ -2640,15 +2528,59 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
# define png_get_int_32(buf) \
((png_int_32)((*(buf) & 0x80) \
? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \
? -((png_int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \
: (png_int_32)png_get_uint_32(buf)))
#endif
#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
PNG_EXPORT(234, void, png_set_check_for_invalid_index, (png_structp png_ptr,
int allowed));
# ifdef PNG_GET_PALETTE_MAX_SUPPORTED
PNG_EXPORT(235, int, png_get_palette_max, (png_const_structp png_ptr,
png_const_infop info_ptr));
# endif
#endif /* CHECK_FOR_INVALID_INDEX */
/*******************************************************************************
* IMPLEMENTATION OPTIONS
*******************************************************************************
*
* Support for arbitrary implementation-specific optimizations. The API allows
* particular options to be turned on or off. 'Option' is the number of the
* option and 'onoff' is 0 (off) or non-0 (on). The value returned is given
* by the PNG_OPTION_ defines below.
*
* HARDWARE: normally hardware capabilites, such as the Intel SSE instructions,
* are detected at run time, however sometimes it may be impossible
* to do this in user mode, in which case it is necessary to discover
* the capabilities in an OS specific way. Such capabilities are
* listed here when libpng has support for them and must be turned
* ON by the application if present.
*
* SOFTWARE: sometimes software optimizations actually result in performance
* decrease on some architectures or systems, or with some sets of
* PNG images. 'Software' options allow such optimizations to be
* selected at run time.
*/
#ifdef PNG_SET_OPTION_SUPPORTED
#ifdef PNG_ARM_NEON_API_SUPPORTED
# define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */
#endif
#define PNG_OPTION_NEXT 2 /* Next option - numbers must be even */
/* Return values: NOTE: there are four values and 'off' is *not* zero */
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */
#define PNG_OPTION_INVALID 1 /* Option number out of range */
#define PNG_OPTION_OFF 2
#define PNG_OPTION_ON 3
PNG_EXPORT(236, int, png_set_option, (png_structp png_ptr, int option,
int onoff));
#endif
/*******************************************************************************
* END OF HARDWARE OPTIONS
******************************************************************************/
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project
* defs
@@ -2659,7 +2591,7 @@ PNG_EXPORT(234, void, png_set_check_for_invalid_index, (png_structp png_ptr,
* scripts/symbols.def as well.
*/
#ifdef PNG_EXPORT_LAST_ORDINAL
PNG_EXPORT_LAST_ORDINAL(234);
PNG_EXPORT_LAST_ORDINAL(236);
#endif
#ifdef __cplusplus
+34 -32
View File
@@ -1,9 +1,9 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.5.12 - July 11, 2012
* libpng version 1.5.27, May 26, 2016
*
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -11,9 +11,7 @@
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
*/
/* Any machine specific code is near the front of this file, so if you
* Any machine specific code is near the front of this file, so if you
* are configuring libpng for a machine, you may want to read the section
* starting here down to where it starts to typedef png_color, png_text,
* and png_info.
@@ -177,18 +175,16 @@
* ==========================
* This code is used at build time to find PNG_IMPEXP, the API settings
* and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
* import processing is possible. On Windows/x86 systems it also sets
* import processing is possible. On Windows systems it also sets
* compiler-specific macros to the values required to change the calling
* conventions of the various functions.
*/
#if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
defined(_M_X64) || defined(_M_IA64) )
/* Windows system (DOS doesn't support DLLs) running on x86/x64. Includes
* builds under Cygwin or MinGW. Also includes Watcom builds but these need
* special treatment because they are not compatible with GCC or Visual C
* because of different calling conventions.
#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
* MinGW on any architecture currently supported by Windows. Also includes
* Watcom builds but these need special treatment because they are not
* compatible with GCC or Visual C because of different calling conventions.
*/
# if PNG_API_RULE == 2
/* If this line results in an error, either because __watcall is not
@@ -199,9 +195,12 @@
# define PNGCAPI __watcall
# endif
# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))
# define PNGCAPI __cdecl
# if PNG_API_RULE == 1
/* If this line results in an error __stdcall is not understood and
* PNG_API_RULE should not have been set to '1'.
*/
# define PNGAPI __stdcall
# endif
# else
@@ -239,7 +238,7 @@
# endif
# endif /* compiler */
#else /* !Windows/x86 */
#else /* !Windows */
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
# define PNGAPI _System
# else /* !Windows/x86 && !OS/2 */
@@ -337,6 +336,7 @@
* functions in png.h will generate compiler warnings. Added at libpng
* version 1.2.41.
*/
# if defined(__GNUC__)
# ifndef PNG_USE_RESULT
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
@@ -344,21 +344,23 @@
# ifndef PNG_NORETURN
# define PNG_NORETURN __attribute__((__noreturn__))
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __attribute__((__deprecated__))
# endif
# ifndef PNG_PRIVATE
# if 0 /* Doesn't work so we use deprecated instead*/
# define PNG_PRIVATE \
__attribute__((warning("This function is not exported by libpng.")))
# else
# define PNG_PRIVATE \
__attribute__((__deprecated__))
# if __GNUC__ >= 3
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
# endif
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __attribute__((__deprecated__))
# endif
# ifndef PNG_PRIVATE
# if 0 /* Doesn't work so we use deprecated instead*/
# define PNG_PRIVATE \
__attribute__((warning("This function is not exported by libpng.")))
# else
# define PNG_PRIVATE \
__attribute__((__deprecated__))
# endif
# endif
# endif /* __GNUC__ >= 3 */
# endif /* __GNUC__ */
# if defined(_MSC_VER) && (_MSC_VER >= 1300)
@@ -400,7 +402,7 @@
#ifndef PNG_FP_EXPORT /* A floating point API. */
# ifdef PNG_FLOATING_POINT_SUPPORTED
# define PNG_FP_EXPORT(ordinal, type, name, args)\
PNG_EXPORT(ordinal, type, name, args)
PNG_EXPORT(ordinal, type, name, args);
# else /* No floating point APIs */
# define PNG_FP_EXPORT(ordinal, type, name, args)
# endif
@@ -408,7 +410,7 @@
#ifndef PNG_FIXED_EXPORT /* A fixed point API. */
# ifdef PNG_FIXED_POINT_SUPPORTED
# define PNG_FIXED_EXPORT(ordinal, type, name, args)\
PNG_EXPORT(ordinal, type, name, args)
PNG_EXPORT(ordinal, type, name, args);
# else /* No fixed point APIs */
# define PNG_FIXED_EXPORT(ordinal, type, name, args)
# endif
+9 -13
View File
@@ -1,12 +1,11 @@
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Last changed in libpng 1.5.18 [February 6, 2014]
* Copyright (c) 1998-2002,2004,2006-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.0 [January 6, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -25,7 +24,7 @@
* (actually ((void)0)).
*
* level: level of detail of message, starting at 0. A level 'n'
* message is preceded by 'n' tab characters (not implemented
* message is preceded by 'n' 3-space indentations (not implemented
* on Microsoft compilers unless PNG_DEBUG_FILE is also
* defined, to allow debug DLL compilation with no standard IO).
* message: a printf(3) style text string. A trailing '\n' is added
@@ -77,32 +76,29 @@
# endif /* PNG_DEBUG_FILE */
# if (PNG_DEBUG > 1)
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on
* non-ISO compilers
*/
# ifdef __STDC__
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
(num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\
} while (0)
# endif
# else /* __STDC __ */
+8 -5
View File
@@ -1,8 +1,8 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
* Last changed in libpng 1.5.8 [February 1, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Last changed in libpng 1.5.19 [August 21, 2014]
* Copyright (c) 1998-2002,2004,2006-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -161,7 +161,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
case PNG_NUMBER_FORMAT_02u:
/* Expects at least 2 digits. */
mincount = 2;
/* fall through */
/* FALL THROUGH */
case PNG_NUMBER_FORMAT_u:
*--end = digits[number % 10];
@@ -171,7 +171,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
case PNG_NUMBER_FORMAT_02x:
/* This format expects at least two digits */
mincount = 2;
/* fall through */
/* FALL THROUGH */
case PNG_NUMBER_FORMAT_x:
*--end = digits[number & 0xf];
@@ -193,7 +193,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
* drop the decimal point. If the number is a true zero handle that
* here.
*/
if (output)
if (output != 0)
*--end = '.';
else if (number == 0) /* and !output */
*--end = '0';
@@ -578,6 +578,9 @@ png_longjmp,(png_structp png_ptr, int val),PNG_NORETURN)
png_ptr->longjmp_fn(png_ptr->longjmp_buffer, val);
# endif
}
#else
PNG_UNUSED(png_ptr);
PNG_UNUSED(val);
#endif
/* Here if not setjmp support or if png_ptr is null. */
PNG_ABORT();
+56 -10
View File
@@ -1,8 +1,8 @@
/* pngget.c - retrieval of values from info struct
*
* Last changed in libpng 1.5.7 [December 15, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Last changed in libpng 1.5.19 [August 21, 2014]
* Copyright (c) 1998-2002,2004,2006-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -123,6 +123,9 @@ png_get_x_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)
return (info_ptr->x_pixels_per_unit);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@@ -140,6 +143,9 @@ png_get_y_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)
return (info_ptr->y_pixels_per_unit);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@@ -157,6 +163,9 @@ png_get_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
info_ptr->x_pixels_per_unit == info_ptr->y_pixels_per_unit)
return (info_ptr->x_pixels_per_unit);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@@ -175,6 +184,9 @@ png_get_pixel_aspect_ratio(png_const_structp png_ptr, png_const_infop info_ptr)
return ((float)((float)info_ptr->y_pixels_per_unit
/(float)info_ptr->x_pixels_per_unit));
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return ((float)0.0);
@@ -203,6 +215,9 @@ png_get_pixel_aspect_ratio_fixed(png_const_structp png_ptr,
(png_int_32)info_ptr->x_pixels_per_unit))
return res;
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return 0;
@@ -220,6 +235,9 @@ png_get_x_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER)
return (info_ptr->x_offset);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@@ -236,6 +254,9 @@ png_get_y_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER)
return (info_ptr->y_offset);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@@ -252,6 +273,9 @@ png_get_x_offset_pixels(png_const_structp png_ptr, png_const_infop info_ptr)
if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL)
return (info_ptr->x_offset);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@@ -268,6 +292,9 @@ png_get_y_offset_pixels(png_const_structp png_ptr, png_const_infop info_ptr)
if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL)
return (info_ptr->y_offset);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@@ -646,7 +673,7 @@ png_get_gAMA(png_const_structp png_ptr, png_const_infop info_ptr,
png_fixed_point igamma;
png_uint_32 ok = png_get_gAMA_fixed(png_ptr, info_ptr, &igamma);
if (ok)
if (ok != 0)
*file_gamma = png_float(png_ptr, igamma, "png_get_gAMA");
return ok;
@@ -683,7 +710,7 @@ png_get_iCCP(png_const_structp png_ptr, png_const_infop info_ptr,
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)
&& name != NULL && compression_type != NULL && profile != NULL &&
proflen != NULL)
proflen != NULL)
{
*name = info_ptr->iccp_name;
*profile = info_ptr->iccp_profile;
@@ -741,14 +768,20 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
{
png_debug1(1, "in %s retrieval function", "IHDR");
if (png_ptr == NULL || info_ptr == NULL || width == NULL ||
height == NULL || bit_depth == NULL || color_type == NULL)
if (png_ptr == NULL || info_ptr == NULL)
return (0);
*width = info_ptr->width;
*height = info_ptr->height;
*bit_depth = info_ptr->bit_depth;
*color_type = info_ptr->color_type;
if (width != NULL)
*width = info_ptr->width;
if (height != NULL)
*height = info_ptr->height;
if (bit_depth != NULL)
*bit_depth = info_ptr->bit_depth;
if (color_type != NULL)
*color_type = info_ptr->color_type;
if (compression_type != NULL)
*compression_type = info_ptr->compression_type;
@@ -1121,4 +1154,17 @@ png_get_io_chunk_name (png_structp png_ptr)
}
#endif /* ?PNG_IO_STATE_SUPPORTED */
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
# ifdef PNG_GET_PALETTE_MAX_SUPPORTED
int PNGAPI
png_get_palette_max(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return png_ptr->num_palette_max;
return (-1);
}
# endif
#endif
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
+3 -4
View File
@@ -1,12 +1,11 @@
/* pnginfo.h - header file for PNG reference library
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Last changed in libpng 1.5.0 [January 6, 2011]
* Copyright (c) 1998-2002,2004,2006-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.0 [January 6, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -242,7 +241,7 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
#ifdef PNG_sPLT_SUPPORTED
/* Data on sPLT chunks (there may be more than one). */
png_sPLT_tp splt_palettes;
png_uint_32 splt_palettes_num;
int splt_palettes_num;
#endif
#ifdef PNG_sCAL_SUPPORTED
+79 -78
View File
@@ -1,48 +1,28 @@
/* libpng STANDARD API DEFINITION */
/* 1.5.27 STANDARD API DEFINITION */
/* pnglibconf.h - library build configuration */
/* Libpng 1.5.12 - July 11, 2012 */
/* libpng version 1.5.27 - May 26, 2016 */
/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */
/* Copyright (c) 2011-2015 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
/* For conditions of distribution and use, see the disclaimer */
/* and license in png.h */
/* pnglibconf.h */
/* Machine generated file: DO NOT EDIT */
/* Derived from: scripts/pnglibconf.dfa */
/* If you edit this file by hand you must obey the rules expressed in */
/* pnglibconf.dfa with respect to the dependencies between the following */
/* symbols. It is much better to generate a new file using */
/* scripts/libpngconf.mak */
#ifndef PNGLCONF_H
#define PNGLCONF_H
/* settings */
#define PNG_API_RULE 0
#define PNG_CALLOC_SUPPORTED
#define PNG_COST_SHIFT 3
#define PNG_DEFAULT_READ_MACROS 1
#define PNG_GAMMA_THRESHOLD_FIXED 5000
#define PNG_MAX_GAMMA_8 11
#define PNG_QUANTIZE_BLUE_BITS 5
#define PNG_QUANTIZE_GREEN_BITS 5
#define PNG_QUANTIZE_RED_BITS 5
#define PNG_sCAL_PRECISION 5
#define PNG_WEIGHT_SHIFT 8
#define PNG_ZBUF_SIZE 8192
/* end of settings */
/* options */
#define PNG_16BIT_SUPPORTED
#define PNG_ALIGN_MEMORY_SUPPORTED
#define PNG_ALIGNED_MEMORY_SUPPORTED
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
#define PNG_BENIGN_ERRORS_SUPPORTED
#define PNG_bKGD_SUPPORTED
#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
#define PNG_CHECK_cHRM_SUPPORTED
#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_cHRM_SUPPORTED
#define PNG_CHECK_cHRM_SUPPORTED
#define PNG_CONSOLE_IO_SUPPORTED
#define PNG_CONVERT_tIME_SUPPORTED
#define PNG_EASY_ACCESS_SUPPORTED
@@ -51,18 +31,12 @@
#define PNG_FIXED_POINT_SUPPORTED
#define PNG_FLOATING_ARITHMETIC_SUPPORTED
#define PNG_FLOATING_POINT_SUPPORTED
#define PNG_gAMA_SUPPORTED
#define PNG_GET_PALETTE_MAX_SUPPORTED
#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
#define PNG_hIST_SUPPORTED
#define PNG_iCCP_SUPPORTED
#define PNG_INCH_CONVERSIONS_SUPPORTED
#define PNG_INFO_IMAGE_SUPPORTED
#define PNG_IO_STATE_SUPPORTED
#define PNG_iTXt_SUPPORTED
#define PNG_MNG_FEATURES_SUPPORTED
#define PNG_oFFs_SUPPORTED
#define PNG_pCAL_SUPPORTED
#define PNG_pHYs_SUPPORTED
#define PNG_POINTER_INDEXING_SUPPORTED
#define PNG_PROGRESSIVE_READ_SUPPORTED
#define PNG_READ_16BIT_SUPPORTED
@@ -70,68 +44,62 @@
#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_READ_BACKGROUND_SUPPORTED
#define PNG_READ_BGR_SUPPORTED
#define PNG_READ_bKGD_SUPPORTED
#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_READ_cHRM_SUPPORTED
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
#define PNG_READ_COMPRESSED_TEXT_SUPPORTED
#define PNG_READ_EXPAND_16_SUPPORTED
#define PNG_READ_EXPAND_SUPPORTED
#define PNG_READ_FILLER_SUPPORTED
#define PNG_READ_gAMA_SUPPORTED
#define PNG_READ_GAMMA_SUPPORTED
#define PNG_READ_GET_PALETTE_MAX_SUPPORTED
#define PNG_READ_GRAY_TO_RGB_SUPPORTED
#define PNG_READ_hIST_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED
#define PNG_READ_INTERLACING_SUPPORTED
#define PNG_READ_INT_FUNCTIONS_SUPPORTED
#define PNG_READ_INVERT_ALPHA_SUPPORTED
#define PNG_READ_INVERT_SUPPORTED
#define PNG_READ_iTXt_SUPPORTED
#define PNG_READ_oFFs_SUPPORTED
#define PNG_READ_OPT_PLTE_SUPPORTED
#define PNG_READ_PACK_SUPPORTED
#define PNG_READ_PACKSWAP_SUPPORTED
#define PNG_READ_pCAL_SUPPORTED
#define PNG_READ_pHYs_SUPPORTED
#define PNG_READ_PACK_SUPPORTED
#define PNG_READ_QUANTIZE_SUPPORTED
#define PNG_READ_RGB_TO_GRAY_SUPPORTED
#define PNG_READ_sBIT_SUPPORTED
#define PNG_READ_SCALE_16_TO_8_SUPPORTED
#define PNG_READ_sCAL_SUPPORTED
#define PNG_READ_SHIFT_SUPPORTED
#define PNG_READ_sPLT_SUPPORTED
#define PNG_READ_sRGB_SUPPORTED
#define PNG_READ_STRIP_16_TO_8_SUPPORTED
#define PNG_READ_STRIP_ALPHA_SUPPORTED
#define PNG_READ_SUPPORTED
#define PNG_READ_SWAP_ALPHA_SUPPORTED
#define PNG_READ_SWAP_SUPPORTED
#define PNG_READ_tEXt_SUPPORTED
#define PNG_READ_TEXT_SUPPORTED
#define PNG_READ_tIME_SUPPORTED
#define PNG_READ_TRANSFORMS_SUPPORTED
#define PNG_READ_tRNS_SUPPORTED
#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_READ_USER_CHUNKS_SUPPORTED
#define PNG_READ_USER_TRANSFORM_SUPPORTED
#define PNG_READ_bKGD_SUPPORTED
#define PNG_READ_cHRM_SUPPORTED
#define PNG_READ_gAMA_SUPPORTED
#define PNG_READ_hIST_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED
#define PNG_READ_iTXt_SUPPORTED
#define PNG_READ_oFFs_SUPPORTED
#define PNG_READ_pCAL_SUPPORTED
#define PNG_READ_pHYs_SUPPORTED
#define PNG_READ_sBIT_SUPPORTED
#define PNG_READ_sCAL_SUPPORTED
#define PNG_READ_sPLT_SUPPORTED
#define PNG_READ_sRGB_SUPPORTED
#define PNG_READ_tEXt_SUPPORTED
#define PNG_READ_tIME_SUPPORTED
#define PNG_READ_tRNS_SUPPORTED
#define PNG_READ_zTXt_SUPPORTED
/*#undef PNG_SAFE_LIMITS_SUPPORTED*/
#define PNG_SAVE_INT_32_SUPPORTED
#define PNG_sBIT_SUPPORTED
#define PNG_sCAL_SUPPORTED
#define PNG_SEQUENTIAL_READ_SUPPORTED
#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
#define PNG_SETJMP_SUPPORTED
/*#undef PNG_SET_OPTION_SUPPORTED*/
#define PNG_SET_USER_LIMITS_SUPPORTED
#define PNG_sPLT_SUPPORTED
#define PNG_sRGB_SUPPORTED
#define PNG_STDIO_SUPPORTED
#define PNG_tEXt_SUPPORTED
#define PNG_TEXT_SUPPORTED
#define PNG_TIME_RFC1123_SUPPORTED
#define PNG_tIME_SUPPORTED
#define PNG_tRNS_SUPPORTED
#define PNG_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_USER_CHUNKS_SUPPORTED
#define PNG_USER_LIMITS_SUPPORTED
@@ -142,45 +110,78 @@
#define PNG_WRITE_16BIT_SUPPORTED
#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_WRITE_BGR_SUPPORTED
#define PNG_WRITE_bKGD_SUPPORTED
#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_WRITE_cHRM_SUPPORTED
#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
#define PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
#define PNG_WRITE_FILLER_SUPPORTED
#define PNG_WRITE_FILTER_SUPPORTED
#define PNG_WRITE_FLUSH_SUPPORTED
#define PNG_WRITE_gAMA_SUPPORTED
#define PNG_WRITE_hIST_SUPPORTED
#define PNG_WRITE_iCCP_SUPPORTED
#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED
#define PNG_WRITE_INTERLACING_SUPPORTED
#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
#define PNG_WRITE_INVERT_SUPPORTED
#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
#define PNG_WRITE_PACKSWAP_SUPPORTED
#define PNG_WRITE_PACK_SUPPORTED
#define PNG_WRITE_SHIFT_SUPPORTED
#define PNG_WRITE_SUPPORTED
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
#define PNG_WRITE_SWAP_SUPPORTED
#define PNG_WRITE_TEXT_SUPPORTED
#define PNG_WRITE_TRANSFORMS_SUPPORTED
#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_WRITE_USER_TRANSFORM_SUPPORTED
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_bKGD_SUPPORTED
#define PNG_WRITE_cHRM_SUPPORTED
#define PNG_WRITE_gAMA_SUPPORTED
#define PNG_WRITE_hIST_SUPPORTED
#define PNG_WRITE_iCCP_SUPPORTED
#define PNG_WRITE_iTXt_SUPPORTED
#define PNG_WRITE_oFFs_SUPPORTED
#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
#define PNG_WRITE_PACK_SUPPORTED
#define PNG_WRITE_PACKSWAP_SUPPORTED
#define PNG_WRITE_pCAL_SUPPORTED
#define PNG_WRITE_pHYs_SUPPORTED
#define PNG_WRITE_sBIT_SUPPORTED
#define PNG_WRITE_sCAL_SUPPORTED
#define PNG_WRITE_SHIFT_SUPPORTED
#define PNG_WRITE_sPLT_SUPPORTED
#define PNG_WRITE_sRGB_SUPPORTED
#define PNG_WRITE_SUPPORTED
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
#define PNG_WRITE_SWAP_SUPPORTED
#define PNG_WRITE_tEXt_SUPPORTED
#define PNG_WRITE_TEXT_SUPPORTED
#define PNG_WRITE_tIME_SUPPORTED
#define PNG_WRITE_TRANSFORMS_SUPPORTED
#define PNG_WRITE_tRNS_SUPPORTED
#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_WRITE_USER_TRANSFORM_SUPPORTED
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_zTXt_SUPPORTED
#define PNG_bKGD_SUPPORTED
#define PNG_cHRM_SUPPORTED
#define PNG_gAMA_SUPPORTED
#define PNG_hIST_SUPPORTED
#define PNG_iCCP_SUPPORTED
#define PNG_iTXt_SUPPORTED
#define PNG_oFFs_SUPPORTED
#define PNG_pCAL_SUPPORTED
#define PNG_pHYs_SUPPORTED
#define PNG_sBIT_SUPPORTED
#define PNG_sCAL_SUPPORTED
#define PNG_sPLT_SUPPORTED
#define PNG_sRGB_SUPPORTED
#define PNG_tEXt_SUPPORTED
#define PNG_tIME_SUPPORTED
#define PNG_tRNS_SUPPORTED
#define PNG_zTXt_SUPPORTED
/* end of options */
/* settings */
#define PNG_API_RULE 0
#define PNG_DEFAULT_READ_MACROS 1
#define PNG_GAMMA_THRESHOLD_FIXED 5000
#define PNG_MAX_GAMMA_8 11
#define PNG_QUANTIZE_BLUE_BITS 5
#define PNG_QUANTIZE_GREEN_BITS 5
#define PNG_QUANTIZE_RED_BITS 5
#define PNG_USER_CHUNK_CACHE_MAX 1000
#define PNG_USER_CHUNK_MALLOC_MAX 8000000
#define PNG_USER_HEIGHT_MAX 1000000
#define PNG_USER_WIDTH_MAX 1000000
#define PNG_ZBUF_SIZE 8192
#define PNG_sCAL_PRECISION 5
/* end of settings */
#endif /* PNGLCONF_H */
+6 -6
View File
@@ -1,8 +1,8 @@
/* pngmem.c - stub functions for memory allocation
*
* Last changed in libpng 1.5.7 [December 15, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Last changed in libpng 1.5.13 [September 27, 2012]
* Copyright (c) 1998-2002,2004,2006-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -56,7 +56,7 @@ png_create_struct_2,(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr),
if (malloc_fn != NULL)
{
png_struct dummy_struct;
memset(&dummy_struct, 0, sizeof dummy_struct);
png_memset(&dummy_struct, 0, sizeof dummy_struct);
dummy_struct.mem_ptr=mem_ptr;
struct_ptr = (*(malloc_fn))(&dummy_struct, (png_alloc_size_t)size);
}
@@ -90,7 +90,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
if (free_fn != NULL)
{
png_struct dummy_struct;
memset(&dummy_struct, 0, sizeof dummy_struct);
png_memset(&dummy_struct, 0, sizeof dummy_struct);
dummy_struct.mem_ptr=mem_ptr;
(*(free_fn))(&dummy_struct, struct_ptr);
return;
@@ -102,7 +102,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
}
/* Allocate memory. For reasonable files, size should never exceed
* 64K. However, zlib may allocate more then 64K if you don't tell
* 64K. However, zlib may allocate more than 64K if you don't tell
* it not to. See zconf.h and png.h for more information. zlib does
* need to allocate exactly 64K, so whatever you call here must
* have the ability to do that.
@@ -475,7 +475,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
}
/* Allocate memory. For reasonable files, size should never exceed
* 64K. However, zlib may allocate more then 64K if you don't tell
* 64K. However, zlib may allocate more than 64K if you don't tell
* it not to. See zconf.h and png.h for more information. zlib does
* need to allocate exactly 64K, so whatever you call here must
* have the ability to do that.
+20 -108
View File
@@ -1,8 +1,8 @@
/* pngpread.c - read a png file in push mode
*
* Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.23 [July 23, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -19,7 +19,6 @@
#define PNG_READ_SIG_MODE 0
#define PNG_READ_CHUNK_MODE 1
#define PNG_READ_IDAT_MODE 2
#define PNG_SKIP_MODE 3
#define PNG_READ_tEXt_MODE 4
#define PNG_READ_zTXt_MODE 5
#define PNG_READ_DONE_MODE 6
@@ -49,7 +48,7 @@ png_process_data_pause(png_structp png_ptr, int save)
/* It's easiest for the caller if we do the save, then the caller doesn't
* have to supply the same data again:
*/
if (save)
if (save != 0)
png_push_save_buffer(png_ptr);
else
{
@@ -71,32 +70,15 @@ png_process_data_pause(png_structp png_ptr, int save)
png_uint_32 PNGAPI
png_process_data_skip(png_structp png_ptr)
{
png_uint_32 remaining = 0;
if (png_ptr != NULL && png_ptr->process_mode == PNG_SKIP_MODE &&
png_ptr->skip_length > 0)
{
/* At the end of png_process_data the buffer size must be 0 (see the loop
* above) so we can detect a broken call here:
*/
if (png_ptr->buffer_size != 0)
png_error(png_ptr,
"png_process_data_skip called inside png_process_data");
/* If is impossible for there to be a saved buffer at this point -
* otherwise we could not be in SKIP mode. This will also happen if
* png_process_skip is called inside png_process_data (but only very
* rarely.)
*/
if (png_ptr->save_buffer_size != 0)
png_error(png_ptr, "png_process_data_skip called with saved data");
remaining = png_ptr->skip_length;
png_ptr->skip_length = 0;
png_ptr->process_mode = PNG_READ_CHUNK_MODE;
}
return remaining;
/* TODO: Deprecate and remove this API.
* Somewhere the implementation of this seems to have been lost,
* or abandoned. It was only to support some internal back-door access
* to png_struct) in libpng-1.4.x.
*/
png_warning(png_ptr,
"png_process_data_skip is not implemented in any current version"
" of libpng");
return 0;
}
/* What we do with the incoming data depends on what we were previously
@@ -128,12 +110,6 @@ png_process_some_data(png_structp png_ptr, png_infop info_ptr)
break;
}
case PNG_SKIP_MODE:
{
png_push_crc_finish(png_ptr);
break;
}
default:
{
png_ptr->buffer_size = 0;
@@ -151,7 +127,7 @@ png_process_some_data(png_structp png_ptr, png_infop info_ptr)
void /* PRIVATE */
png_push_read_sig(png_structp png_ptr, png_infop info_ptr)
{
png_size_t num_checked = png_ptr->sig_bytes,
png_size_t num_checked = png_ptr->sig_bytes, /* SAFE, does not exceed 8 */
num_to_check = 8 - num_checked;
if (png_ptr->buffer_size < num_to_check)
@@ -564,76 +540,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
}
void /* PRIVATE */
png_push_crc_skip(png_structp png_ptr, png_uint_32 skip)
{
png_ptr->process_mode = PNG_SKIP_MODE;
png_ptr->skip_length = skip;
}
void /* PRIVATE */
png_push_crc_finish(png_structp png_ptr)
{
if (png_ptr->skip_length && png_ptr->save_buffer_size)
{
png_size_t save_size = png_ptr->save_buffer_size;
png_uint_32 skip_length = png_ptr->skip_length;
/* We want the smaller of 'skip_length' and 'save_buffer_size', but
* they are of different types and we don't know which variable has the
* fewest bits. Carefully select the smaller and cast it to the type of
* the larger - this cannot overflow. Do not cast in the following test
* - it will break on either 16 or 64 bit platforms.
*/
if (skip_length < save_size)
save_size = (png_size_t)skip_length;
else
skip_length = (png_uint_32)save_size;
png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size);
png_ptr->skip_length -= skip_length;
png_ptr->buffer_size -= save_size;
png_ptr->save_buffer_size -= save_size;
png_ptr->save_buffer_ptr += save_size;
}
if (png_ptr->skip_length && png_ptr->current_buffer_size)
{
png_size_t save_size = png_ptr->current_buffer_size;
png_uint_32 skip_length = png_ptr->skip_length;
/* We want the smaller of 'skip_length' and 'current_buffer_size', here,
* the same problem exists as above and the same solution.
*/
if (skip_length < save_size)
save_size = (png_size_t)skip_length;
else
skip_length = (png_uint_32)save_size;
png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size);
png_ptr->skip_length -= skip_length;
png_ptr->buffer_size -= save_size;
png_ptr->current_buffer_size -= save_size;
png_ptr->current_buffer_ptr += save_size;
}
if (!png_ptr->skip_length)
{
if (png_ptr->buffer_size < 4)
{
png_push_save_buffer(png_ptr);
return;
}
png_crc_finish(png_ptr, 0);
png_ptr->process_mode = PNG_READ_CHUNK_MODE;
}
}
void PNGCBAPI
png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
{
@@ -897,6 +803,12 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
*/
ret = inflate(&png_ptr->zstream, Z_SYNC_FLUSH);
/* Hack, added in 1.5.18: the progressive reader does not reset
* png_ptr->zstream, so any attempt to use it after the last IDAT fails
* (silently). This allows the read code to do the reset when required.
*/
png_ptr->flags |= PNG_FLAG_ZSTREAM_PROGRESSIVE;
/* Check for any failure before proceeding. */
if (ret != Z_OK && ret != Z_STREAM_END)
{
@@ -1285,7 +1197,7 @@ png_progressive_combine_row (png_structp png_ptr, png_bytep old_row,
* it must be png_ptr->row_buf+1
*/
if (new_row != NULL)
png_combine_row(png_ptr, old_row, 1/*display*/);
png_combine_row(png_ptr, old_row, 1/*blocky display*/);
}
#endif /* PNG_READ_INTERLACING_SUPPORTED */
+165 -79
View File
@@ -1,13 +1,11 @@
/* pngpriv.h - private declarations for use inside libpng
*
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.26 [December 17, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.10 [March 29, 2012]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -39,6 +37,7 @@
*/
#define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
#ifndef PNG_VERSION_INFO_ONLY
/* This is required for the definition of abort(), used as a last ditch
* error handler when all else fails.
*/
@@ -46,6 +45,7 @@
/* This is used to find 'offsetof', used below for alignment tests. */
#include <stddef.h>
#endif /* !PNG_VERSION_INFO_ONLY */
#define PNGLIB_BUILD /*libpng is being built, not used*/
@@ -125,14 +125,59 @@
#endif
#include "png.h"
#include "pnginfo.h"
#include "pngstruct.h"
/* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */
#ifndef PNG_DLL_EXPORT
# define PNG_DLL_EXPORT
#endif
/* Compile time options.
* =====================
* In a multi-arch build the compiler may compile the code several times for the
* same object module, producing different binaries for different architectures.
* When this happens configure-time setting of the target host options cannot be
* done and this interferes with the handling of the ARM NEON optimizations, and
* possibly other similar optimizations. Put additional tests here; in general
* this is needed when the same option can be changed at both compile time and
* run time depending on the target OS (i.e. iOS vs Android.)
*
* NOTE: symbol prefixing does not pass $(CFLAGS) to the preprocessor, because
* this is not possible with certain compilers (Oracle SUN OS CC), as a result
* it is necessary to ensure that all extern functions that *might* be used
* regardless of $(CFLAGS) get declared in this file. The test on __ARM_NEON__
* below is one example of this behavior because it is controlled by the
* presence or not of -mfpu=neon on the GCC command line, it is possible to do
* this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely
* do this.
*/
#ifndef PNG_ARM_NEON_OPT
/* ARM NEON optimizations are being controlled by the compiler settings,
* typically the target FPU. If the FPU has been set to NEON (-mfpu=neon
* with GCC) then the compiler will define __ARM_NEON__ and we can rely
* unconditionally on NEON instructions not crashing, otherwise we must
* disable use of NEON instructions.
*
* NOTE: at present these optimizations depend on 'ALIGNED_MEMORY', so they
* can only be turned on automatically if that is supported too. If
* PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail
* to compile with an appropriate #error if ALIGNED_MEMORY has been turned
* off.
*/
# if defined(__ARM_NEON__) && defined(PNG_ALIGNED_MEMORY_SUPPORTED)
# define PNG_ARM_NEON_OPT 2
# else
# define PNG_ARM_NEON_OPT 0
# endif
#endif
#if PNG_ARM_NEON_OPT > 0
/* NEON optimizations are to be at least considered by libpng, so enable the
* callbacks to do this.
*/
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon
#endif
/* SECURITY and SAFETY:
*
* By default libpng is built without any internal limits on image size,
@@ -143,44 +188,6 @@
* real system capabilities.
*/
#ifdef PNG_SAFE_LIMITS_SUPPORTED
/* 'safe' limits */
# ifndef PNG_USER_WIDTH_MAX
# define PNG_USER_WIDTH_MAX 1000000
# endif
# ifndef PNG_USER_HEIGHT_MAX
# define PNG_USER_HEIGHT_MAX 1000000
# endif
# ifndef PNG_USER_CHUNK_CACHE_MAX
# define PNG_USER_CHUNK_CACHE_MAX 128
# endif
# ifndef PNG_USER_CHUNK_MALLOC_MAX
# define PNG_USER_CHUNK_MALLOC_MAX 8000000
# endif
#else
/* values for no limits */
# ifndef PNG_USER_WIDTH_MAX
# define PNG_USER_WIDTH_MAX 0x7fffffff
# endif
# ifndef PNG_USER_HEIGHT_MAX
# define PNG_USER_HEIGHT_MAX 0x7fffffff
# endif
# ifndef PNG_USER_CHUNK_CACHE_MAX
# define PNG_USER_CHUNK_CACHE_MAX 0
# endif
# ifndef PNG_USER_CHUNK_MALLOC_MAX
# define PNG_USER_CHUNK_MALLOC_MAX 0
# endif
#endif
/* This is used for 16 bit gamma tables - only the top level pointers are const,
* this could be changed:
*/
typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
/* Added at libpng-1.2.9 */
/* Moved to pngpriv.h at libpng-1.5.0 */
/* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure"
* script. We may need it here to get the correct configuration on things
* like limits.
@@ -191,9 +198,11 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
# endif
#endif
/* Moved to pngpriv.h at libpng-1.5.0 */
/* NOTE: some of these may have been used in external applications as
* these definitions were exposed in pngconf.h prior to 1.5.
/* SECURITY and SAFETY:
*
* libpng is built with support for internal limits on image dimensions and
* memory usage. These are documented in scripts/pnglibconf.dfa of the
* source and recorded in the machine generated header file pnglibconf.h.
*/
/* If you are running on a machine where you cannot allocate more
@@ -211,6 +220,11 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
# define PNG_MAX_MALLOC_64K
#endif
/* Moved to pngpriv.h at libpng-1.5.0 */
/* NOTE: some of these may have been used in external applications as
* these definitions were exposed in pngconf.h prior to 1.5.
*/
#ifndef PNG_UNUSED
/* Unused formal parameter warnings are silenced using the following macro
* which is expected to have no bad effects on performance (optimizing
@@ -246,7 +260,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
/* Modern compilers support restrict, but assume not for anything not
* recognized here:
*/
# if defined __GNUC__ || defined _MSC_VER || defined __WATCOMC__
# if defined(__GNUC__) || defined(_MSC_VER) || defined(__WATCOMC__)
# define PNG_RESTRICT restrict
# else
# define PNG_RESTRICT
@@ -260,8 +274,6 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
#ifdef PNG_WARNINGS_SUPPORTED
# define PNG_WARNING_PARAMETERS(p) png_warning_parameters p;
#else
# define png_warning(s1,s2) ((void)(s1))
# define png_chunk_warning(s1,s2) ((void)(s1))
# define png_warning_parameter(p,number,string) ((void)0)
# define png_warning_parameter_unsigned(p,number,format,value) ((void)0)
# define png_warning_parameter_signed(p,number,format,value) ((void)0)
@@ -269,8 +281,6 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
# define PNG_WARNING_PARAMETERS(p)
#endif
#ifndef PNG_ERROR_TEXT_SUPPORTED
# define png_error(s1,s2) png_err(s1)
# define png_chunk_error(s1,s2) png_err(s1)
# define png_fixed_error(s1,s2) png_err(s1)
#endif
@@ -308,6 +318,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
# define PNGFAPI /* PRIVATE */
#endif
#ifndef PNG_VERSION_INFO_ONLY
/* Other defines specific to compilers can go here. Try to keep
* them inside an appropriate ifdef/endif pair for portability.
*/
@@ -352,6 +363,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
defined(_WIN32) || defined(__WIN32__)
# include <windows.h> /* defines _WINDOWS_ macro */
#endif
#endif /* !PNG_VERSION_INFO_ONLY */
/* Moved here around 1.5.0beta36 from pngconf.h */
/* Users may want to use these so they are not private. Any library
@@ -383,7 +395,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
# define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strlen lstrlenA
# define png_memcmp memcmp
# define png_memcpy CopyMemory
# define png_memcpy memcpy
# define png_memset memset
# else
# define CVT_PTR(ptr) (ptr)
@@ -416,7 +428,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
#if PNG_ALIGN_TYPE == PNG_ALIGN_SIZE
/* This is used because in some compiler implementations non-aligned
* structure members are supported, so the offsetof approach below fails.
* Set PNG_ALIGN_TO_SIZE=0 for compiler combinations where unaligned access
* Set PNG_ALIGN_SIZE=0 for compiler combinations where unaligned access
* is good for performance. Do not do this unless you have tested the result
* and understand it.
*/
@@ -505,10 +517,6 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
#define PNG_STRUCT_PNG 0x0001
#define PNG_STRUCT_INFO 0x0002
/* Scaling factor for filter heuristic weighting calculations */
#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT))
#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT))
/* Flags for the png_ptr->flags rather than declaring a byte for each one */
#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001
#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002
@@ -531,7 +539,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000
#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000
#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000
/* 0x200000 unused */
#define PNG_FLAG_ZSTREAM_PROGRESSIVE 0x200000
/* 0x400000 unused */
#define PNG_FLAG_BENIGN_ERRORS_WARN 0x800000 /* Added to libpng-1.4.0 */
#define PNG_FLAG_ZTXT_CUSTOM_STRATEGY 0x1000000 /* 5 lines added */
@@ -617,8 +625,10 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
#define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\
((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0))
#else
#ifndef PNG_VERSION_INFO_ONLY
PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp,
png_const_charp text));
#endif /* !PNG_VERSION_INFO_ONLY */
#endif
#endif
@@ -692,6 +702,18 @@ PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp,
#define PNG_GAMMA_MAC_INVERSE 65909
#define PNG_GAMMA_sRGB_INVERSE 45455
/* Almost everything below is C specific; the #defines above can be used in
* non-C code (so long as it is C-preprocessed) the rest of this stuff cannot.
*/
#ifndef PNG_VERSION_INFO_ONLY
#include "pngstruct.h"
#include "pnginfo.h"
/* This is used for 16 bit gamma tables -- only the top level pointers are
* const; this could be changed:
*/
typedef const png_uint_16p * png_const_uint_16pp;
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
#ifdef __cplusplus
@@ -823,10 +845,8 @@ PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr));
# ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma));
# endif
# ifdef PNG_FIXED_POINT_SUPPORTED
PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr,
png_fixed_point file_gamma));
# endif
#endif
#ifdef PNG_WRITE_sBIT_SUPPORTED
@@ -881,13 +901,6 @@ PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr,
png_const_uint_16p hist, int num_hist));
#endif
/* Chunks that have keywords */
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr,
png_const_charp key, png_charpp new_key));
#endif
#ifdef PNG_WRITE_tEXt_SUPPORTED
PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_const_charp key,
png_const_charp text, png_size_t text_len));
@@ -993,8 +1006,8 @@ PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
/* Unfilter a row: check the filter value before calling this, there is no point
* calling it for PNG_FILTER_VALUE_NONE.
*/
PNG_EXTERN void png_read_filter_row PNGARG((png_structp pp, png_row_infop row_info,
png_bytep row, png_const_bytep prev_row, int filter));
PNG_EXTERN void png_read_filter_row PNGARG((png_structp pp, png_row_infop
row_info, png_bytep row, png_const_bytep prev_row, int filter));
PNG_EXTERN void png_read_filter_row_up_neon PNGARG((png_row_infop row_info,
png_bytep row, png_const_bytep prev_row));
@@ -1293,9 +1306,6 @@ PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr,
PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr,
png_infop info_ptr));
PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
png_uint_32 length));
PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
png_bytep buffer, png_size_t buffer_length));
@@ -1491,14 +1501,16 @@ PNG_EXTERN void png_formatted_warning(png_structp png_ptr,
/* ASCII to FP interfaces, currently only implemented if sCAL
* support is required.
*/
#if defined(PNG_READ_sCAL_SUPPORTED)
#ifdef PNG_sCAL_SUPPORTED
/* MAX_DIGITS is actually the maximum number of characters in an sCAL
* width or height, derived from the precision (number of significant
* digits - a build time settable option) and assumpitions about the
* maximum ridiculous exponent.
*/
#define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/)
#endif
#ifdef PNG_sCAL_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_EXTERN void png_ascii_from_fp PNGARG((png_structp png_ptr, png_charp ascii,
png_size_t size, double fp, unsigned int precision));
@@ -1583,14 +1595,14 @@ PNG_EXTERN void png_ascii_from_fixed PNGARG((png_structp png_ptr,
#define PNG_FP_IS_POSITIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_Z_MASK)
#define PNG_FP_IS_NEGATIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_NZ_MASK)
/* The actual parser. This can be called repeatedly, it updates
/* The actual parser. This can be called repeatedly. It updates
* the index into the string and the state variable (which must
* be initialzed to 0). It returns a result code, as above. There
* be initialized to 0). It returns a result code, as above. There
* is no point calling the parser any more if it fails to advance to
* the end of the string - it is stuck on an invalid character (or
* terminated by '\0').
*
* Note that the pointer will consume an E or even an E+ then leave
* Note that the pointer will consume an E or even an E+ and then leave
* a 'maybe' state even though a preceding integer.fraction is valid.
* The PNG_FP_WAS_VALID flag indicates that a preceding substring was
* a valid number. It's possible to recover from this by calling
@@ -1629,7 +1641,7 @@ PNG_EXTERN png_fixed_point png_muldiv_warn PNGARG((png_structp png_ptr,
png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by));
#endif
#ifdef PNG_READ_GAMMA_SUPPORTED
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED)
/* Calculate a reciprocal - used for gamma values. This returns
* 0 if the argument is 0 in order to maintain an undefined value,
* there are no warnings.
@@ -1664,7 +1676,80 @@ PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr,
int bit_depth));
#endif
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
/* Missing declarations if FIXED_POINT is *not* supported - fixed properly
* in libpng 1.6
*/
#ifndef PNG_FIXED_POINT_SUPPORTED
#ifdef PNG_cHRM_SUPPORTED
PNG_EXTERN png_uint_32 png_get_cHRM_XYZ_fixed PNGARG(
(png_structp png_ptr, png_const_infop info_ptr,
png_fixed_point *int_red_X, png_fixed_point *int_red_Y,
png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
png_fixed_point *int_blue_Z));
PNG_EXTERN void png_set_cHRM_XYZ_fixed PNGARG((png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,
png_fixed_point int_red_Z, png_fixed_point int_green_X,
png_fixed_point int_green_Y, png_fixed_point int_green_Z,
png_fixed_point int_blue_X, png_fixed_point int_blue_Y,
png_fixed_point int_blue_Z));
PNG_EXTERN void png_set_cHRM_fixed PNGARG((png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_white_x,
png_fixed_point int_white_y, png_fixed_point int_red_x,
png_fixed_point int_red_y, png_fixed_point int_green_x,
png_fixed_point int_green_y, png_fixed_point int_blue_x,
png_fixed_point int_blue_y));
#endif
#ifdef PNG_gAMA_SUPPORTED
PNG_EXTERN png_uint_32 png_get_gAMA_fixed PNGARG(
(png_const_structp png_ptr, png_const_infop info_ptr,
png_fixed_point *int_file_gamma));
PNG_EXTERN void png_set_gAMA_fixed PNGARG((png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_file_gamma));
#endif
#ifdef PNG_READ_BACKGROUND_SUPPORTED
PNG_EXTERN void png_set_background_fixed PNGARG((png_structp png_ptr,
png_const_color_16p background_color, int background_gamma_code,
int need_expand, png_fixed_point background_gamma));
#endif
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
PNG_EXTERN void png_set_alpha_mode_fixed PNGARG((png_structp png_ptr,
int mode, png_fixed_point output_gamma));
#endif
#ifdef PNG_READ_GAMMA_SUPPORTED
PNG_EXTERN void png_set_gamma_fixed PNGARG((png_structp png_ptr,
png_fixed_point screen_gamma, png_fixed_point override_file_gamma));
#endif
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
PNG_EXTERN void png_set_rgb_to_gray_fixed PNGARG((png_structp png_ptr,
int error_action, png_fixed_point red, png_fixed_point green));
#endif
#endif /* FIX MISSING !FIXED_POINT DECLARATIONS */
/* These are initialization functions for hardware specific PNG filter
* optimizations; list these here then select the appropriate one at compile
* time using the macro PNG_FILTER_OPTIMIZATIONS. If the macro is not defined
* the generic code is used.
*/
#ifdef PNG_FILTER_OPTIMIZATIONS
PNG_EXTERN void PNG_FILTER_OPTIMIZATIONS(png_structp png_ptr, unsigned int bpp);
/* Just declare the optimization that will be used */
#else
/* List *all* the possible optimizations here - this branch is required if
* the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in
* CFLAGS in place of CPPFLAGS *and* uses symbol prefixing.
*/
PNG_EXTERN void png_init_filter_functions_neon(png_structp png_ptr,
unsigned int bpp);
#endif
/* Maintainer: Put new private prototypes here ^ */
#include "pngdebug.h"
@@ -1672,4 +1757,5 @@ PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr,
}
#endif
#endif /* PNG_VERSION_INFO_ONLY */
#endif /* PNGPRIV_H */
+13 -20
View File
@@ -1,8 +1,8 @@
/* pngread.c - read a PNG file
*
* Last changed in libpng 1.5.10 [March 8, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.23 [July 23, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -100,7 +100,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
if (!png_user_version_check(png_ptr, user_png_ver))
png_cleanup_needed = 1;
if (!png_cleanup_needed)
if (png_cleanup_needed == 0)
{
/* Initialize zbuf - compression buffer */
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
@@ -114,7 +114,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
png_ptr->zstream.zfree = png_zfree;
png_ptr->zstream.opaque = (voidpf)png_ptr;
if (!png_cleanup_needed)
if (png_cleanup_needed == 0)
{
switch (inflateInit(&png_ptr->zstream))
{
@@ -141,7 +141,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
}
}
if (png_cleanup_needed)
if (png_cleanup_needed != 0)
{
/* Clean up PNG structure and deallocate any memory. */
png_free(png_ptr, png_ptr->zbuf);
@@ -559,7 +559,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
if (ret == Z_STREAM_END)
{
if (png_ptr->zstream.avail_out || png_ptr->zstream.avail_in ||
png_ptr->idat_size)
png_ptr->idat_size)
png_benign_error(png_ptr, "Extra compressed data");
png_ptr->mode |= PNG_AFTER_IDAT;
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
@@ -617,7 +617,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Blow up interlaced rows to full size */
if (png_ptr->interlaced &&
(png_ptr->transformations & PNG_INTERLACE))
(png_ptr->transformations & PNG_INTERLACE))
{
if (png_ptr->pass < 6)
png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass,
@@ -1119,9 +1119,8 @@ png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn)
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
#ifdef PNG_INFO_IMAGE_SUPPORTED
void PNGAPI
png_read_png(png_structp png_ptr, png_infop info_ptr,
int transforms,
voidp params)
png_read_png(png_structp png_ptr, png_infop info_ptr, int transforms,
voidp params)
{
int row;
@@ -1191,7 +1190,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
if (transforms & PNG_TRANSFORM_EXPAND)
if ((png_ptr->bit_depth < 8) ||
(png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ||
(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)))
(info_ptr->valid & PNG_INFO_tRNS))
png_set_expand(png_ptr);
#endif
@@ -1210,14 +1209,8 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
* [0,65535] to the original [0,7] or [0,31], or whatever range the
* colors were originally in:
*/
if ((transforms & PNG_TRANSFORM_SHIFT)
&& png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT))
{
png_color_8p sig_bit;
png_get_sBIT(png_ptr, info_ptr, &sig_bit);
png_set_shift(png_ptr, sig_bit);
}
if ((transforms & PNG_TRANSFORM_SHIFT) && (info_ptr->valid & PNG_INFO_sBIT))
png_set_shift(png_ptr, &info_ptr->sig_bit);
#endif
#ifdef PNG_READ_BGR_SUPPORTED
@@ -1287,7 +1280,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
for (row = 0; row < (int)info_ptr->height; row++)
info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr,
png_get_rowbytes(png_ptr, info_ptr));
png_get_rowbytes(png_ptr, info_ptr));
}
png_read_image(png_ptr, info_ptr->row_pointers);
+2 -2
View File
@@ -2,7 +2,7 @@
/* pngrio.c - functions for data input
*
* Last changed in libpng 1.5.0 [January 6, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Copyright (c) 1998-2002,2004,2006-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -26,7 +26,7 @@
* reads from a file pointer. Note that this routine sometimes gets called
* with very small lengths, so you should implement some kind of simple
* buffering if you are using unbuffered reads. This should never be asked
* to read more then 64K on a 16 bit machine.
* to read more than 64K on a 16 bit machine.
*/
void /* PRIVATE */
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
+125 -85
View File
@@ -1,8 +1,8 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
* Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.24 [November 12, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -114,7 +114,7 @@ png_set_background_fixed(png_structp png_ptr,
png_sizeof(png_color_16));
png_ptr->background_gamma = background_gamma;
png_ptr->background_gamma_type = (png_byte)(background_gamma_code);
if (need_expand)
if (need_expand != 0)
png_ptr->transformations |= PNG_BACKGROUND_EXPAND;
else
png_ptr->transformations &= ~PNG_BACKGROUND_EXPAND;
@@ -194,8 +194,10 @@ translate_gamma_flags(png_structp png_ptr, png_fixed_point output_gamma,
*/
# ifdef PNG_READ_sRGB_SUPPORTED
png_ptr->flags |= PNG_FLAG_ASSUME_sRGB;
# else
PNG_UNUSED(png_ptr)
# endif
if (is_screen)
if (is_screen != 0)
output_gamma = PNG_GAMMA_sRGB;
else
output_gamma = PNG_GAMMA_sRGB_INVERSE;
@@ -204,7 +206,7 @@ translate_gamma_flags(png_structp png_ptr, png_fixed_point output_gamma,
else if (output_gamma == PNG_GAMMA_MAC_18 ||
output_gamma == PNG_FP_1 / PNG_GAMMA_MAC_18)
{
if (is_screen)
if (is_screen != 0)
output_gamma = PNG_GAMMA_MAC_OLD;
else
output_gamma = PNG_GAMMA_MAC_INVERSE;
@@ -329,7 +331,7 @@ png_set_alpha_mode_fixed(png_structp png_ptr, int mode,
/* Finally, if pre-multiplying, set the background fields to achieve the
* desired result.
*/
if (compose)
if (compose != 0)
{
/* And obtain alpha pre-multiplication by composing on black: */
png_memset(&png_ptr->background, 0, sizeof png_ptr->background);
@@ -389,7 +391,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
png_ptr->transformations |= PNG_QUANTIZE;
if (!full_quantize)
if (full_quantize == 0)
{
int i;
@@ -444,12 +446,12 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
}
}
if (done)
if (done != 0)
break;
}
/* Swap the palette around, and set up a table, if necessary */
if (full_quantize)
if (full_quantize != 0)
{
int j = num_palette;
@@ -632,7 +634,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
num_new_palette--;
palette[png_ptr->index_to_palette[j]]
= palette[num_new_palette];
if (!full_quantize)
if (full_quantize == 0)
{
int k;
@@ -700,7 +702,7 @@ png_set_quantize(png_structp png_ptr, png_colorp palette,
}
png_ptr->num_palette = (png_uint_16)num_palette;
if (full_quantize)
if (full_quantize != 0)
{
int i;
png_bytep distance;
@@ -969,7 +971,7 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
png_uint_16 red_int, green_int;
/* NOTE: this calculation does not round, but this behavior is retained
* for consistency, the inaccuracy is very small. The code here always
* for consistency; the inaccuracy is very small. The code here always
* overwrites the coefficients, regardless of whether they have been
* defaulted or set already.
*/
@@ -1068,7 +1070,7 @@ png_gamma_threshold(png_fixed_point screen_gamma, png_fixed_point file_gamma)
* the palette.
*/
/*For the moment 'png_init_palette_transformations' and
/* For the moment 'png_init_palette_transformations' and
* 'png_init_rgb_transformations' only do some flag canceling optimizations.
* The intent is that these two routines should have palette or rgb operations
* extracted from 'png_init_read_transformations'.
@@ -1093,25 +1095,31 @@ png_init_palette_transformations(png_structp png_ptr)
/* Ignore if all the entries are opaque (unlikely!) */
for (i=0; i<png_ptr->num_trans; ++i)
{
if (png_ptr->trans_alpha[i] == 255)
continue;
else if (png_ptr->trans_alpha[i] == 0)
input_has_transparency = 1;
else
{
input_has_transparency = 1;
input_has_alpha = 1;
break;
}
}
}
/* If no alpha we can optimize. */
if (!input_has_alpha)
if (input_has_alpha == 0)
{
/* Any alpha means background and associative alpha processing is
* required, however if the alpha is 0 or 1 throughout OPTIIMIZE_ALPHA
* required, however if the alpha is 0 or 1 throughout OPTIMIZE_ALPHA
* and ENCODE_ALPHA are irrelevant.
*/
png_ptr->transformations &= ~PNG_ENCODE_ALPHA;
png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA;
if (!input_has_transparency)
if (input_has_transparency == 0)
png_ptr->transformations &= ~(PNG_COMPOSE | PNG_BACKGROUND_EXPAND);
}
@@ -1167,10 +1175,10 @@ png_init_rgb_transformations(png_structp png_ptr)
int input_has_transparency = png_ptr->num_trans > 0;
/* If no alpha we can optimize. */
if (!input_has_alpha)
if (input_has_alpha == 0)
{
/* Any alpha means background and associative alpha processing is
* required, however if the alpha is 0 or 1 throughout OPTIIMIZE_ALPHA
* required, however if the alpha is 0 or 1 throughout OPTIMIZE_ALPHA
* and ENCODE_ALPHA are irrelevant.
*/
# ifdef PNG_READ_ALPHA_MODE_SUPPORTED
@@ -1178,7 +1186,7 @@ png_init_rgb_transformations(png_structp png_ptr)
png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA;
# endif
if (!input_has_transparency)
if (input_has_transparency == 0)
png_ptr->transformations &= ~(PNG_COMPOSE | PNG_BACKGROUND_EXPAND);
}
@@ -1221,7 +1229,7 @@ png_init_rgb_transformations(png_structp png_ptr)
default:
case 8:
/* Already 8 bits, fall through */
/* FALL THROUGH (already 8 bits) */
case 16:
/* Already a full 16 bits */
@@ -1304,7 +1312,7 @@ png_init_read_transformations(png_structp png_ptr)
* the code immediately below if the transform can be handled outside the
* row loop.
*/
if (gamma_correction)
if (gamma_correction != 0)
png_ptr->transformations |= PNG_GAMMA;
else
@@ -1313,7 +1321,7 @@ png_init_read_transformations(png_structp png_ptr)
#endif
/* Certain transformations have the effect of preventing other
* transformations that happen afterward in png_do_read_transformations,
* transformations that happen afterward in png_do_read_transformations;
* resolve the interdependencies here. From the code of
* png_do_read_transformations the order is:
*
@@ -1702,11 +1710,11 @@ png_init_read_transformations(png_structp png_ptr)
g_sig = png_gamma_significant(g);
gs_sig = png_gamma_significant(gs);
if (g_sig)
if (g_sig != 0)
png_ptr->background_1.gray = png_gamma_correct(png_ptr,
png_ptr->background.gray, g);
if (gs_sig)
if (gs_sig != 0)
png_ptr->background.gray = png_gamma_correct(png_ptr,
png_ptr->background.gray, gs);
@@ -1715,7 +1723,7 @@ png_init_read_transformations(png_structp png_ptr)
(png_ptr->background.red != png_ptr->background.gray))
{
/* RGB or RGBA with color background */
if (g_sig)
if (g_sig != 0)
{
png_ptr->background_1.red = png_gamma_correct(png_ptr,
png_ptr->background.red, g);
@@ -1727,7 +1735,7 @@ png_init_read_transformations(png_structp png_ptr)
png_ptr->background.blue, g);
}
if (gs_sig)
if (gs_sig != 0)
{
png_ptr->background.red = png_gamma_correct(png_ptr,
png_ptr->background.red, gs);
@@ -1898,6 +1906,9 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
info_ptr->bit_depth = 8;
info_ptr->num_trans = 0;
if (png_ptr->palette == NULL)
png_error (png_ptr, "Palette is NULL in indexed image");
}
else
{
@@ -2045,10 +2056,10 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
if (png_ptr->transformations & PNG_USER_TRANSFORM)
{
if (info_ptr->bit_depth < png_ptr->user_transform_depth)
if (png_ptr->user_transform_depth)
info_ptr->bit_depth = png_ptr->user_transform_depth;
if (info_ptr->channels < png_ptr->user_transform_channels)
if (png_ptr->user_transform_channels)
info_ptr->channels = png_ptr->user_transform_channels;
}
#endif
@@ -2067,7 +2078,7 @@ defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
png_ptr->info_rowbytes = info_ptr->rowbytes;
#ifndef PNG_READ_EXPAND_SUPPORTED
if (png_ptr)
if (png_ptr != NULL)
return;
#endif
}
@@ -2144,7 +2155,7 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info)
png_do_rgb_to_gray(png_ptr, row_info,
png_ptr->row_buf + 1);
if (rgb_error)
if (rgb_error != 0)
{
png_ptr->rgb_to_gray_status=1;
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
@@ -2198,8 +2209,8 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info)
png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
#endif
#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
(defined PNG_READ_ALPHA_MODE_SUPPORTED)
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
if (png_ptr->transformations & PNG_COMPOSE)
png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr);
#endif
@@ -2210,8 +2221,8 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info)
/* Because RGB_TO_GRAY does the gamma transform. */
!(png_ptr->transformations & PNG_RGB_TO_GRAY) &&
#endif
#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
(defined PNG_READ_ALPHA_MODE_SUPPORTED)
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
/* Because PNG_COMPOSE does the gamma transform if there is something to
* do (if there is an alpha channel or transparency.)
*/
@@ -2522,7 +2533,7 @@ png_do_unshift(png_row_infop row_info, png_bytep row,
have_shift = 1;
}
if (!have_shift)
if (have_shift == 0)
return;
}
@@ -2958,13 +2969,13 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
png_bytep dp = sp + (png_size_t)row_width * 2;
for (i = 1; i < row_width; i++)
{
*(--dp) = hi_filler;
*(--dp) = lo_filler;
*(--dp) = hi_filler;
*(--dp) = *(--sp);
*(--dp) = *(--sp);
}
*(--dp) = hi_filler;
*(--dp) = lo_filler;
*(--dp) = hi_filler;
row_info->channels = 2;
row_info->pixel_depth = 32;
row_info->rowbytes = row_width * 4;
@@ -2979,8 +2990,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
{
*(--dp) = *(--sp);
*(--dp) = *(--sp);
*(--dp) = hi_filler;
*(--dp) = lo_filler;
*(--dp) = hi_filler;
}
row_info->channels = 2;
row_info->pixel_depth = 32;
@@ -3039,8 +3050,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
png_bytep dp = sp + (png_size_t)row_width * 2;
for (i = 1; i < row_width; i++)
{
*(--dp) = hi_filler;
*(--dp) = lo_filler;
*(--dp) = hi_filler;
*(--dp) = *(--sp);
*(--dp) = *(--sp);
*(--dp) = *(--sp);
@@ -3048,8 +3059,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
*(--dp) = *(--sp);
*(--dp) = *(--sp);
}
*(--dp) = hi_filler;
*(--dp) = lo_filler;
*(--dp) = hi_filler;
row_info->channels = 4;
row_info->pixel_depth = 64;
row_info->rowbytes = row_width * 8;
@@ -3068,8 +3079,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
*(--dp) = *(--sp);
*(--dp) = *(--sp);
*(--dp) = *(--sp);
*(--dp) = hi_filler;
*(--dp) = lo_filler;
*(--dp) = hi_filler;
}
row_info->channels = 4;
@@ -3283,7 +3294,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
*(dp++) = red;
}
if (have_alpha)
if (have_alpha != 0)
*(dp++) = *(sp++);
}
}
@@ -3312,7 +3323,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
else
*(dp++) = red;
if (have_alpha)
if (have_alpha != 0)
*(dp++) = *(sp++);
}
}
@@ -3330,11 +3341,17 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
for (i = 0; i < row_width; i++)
{
png_uint_16 red, green, blue, w;
#if 0 /* Coverity doesn't like this */
red = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2;
green = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2;
blue = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2;
#else
png_byte hi,lo;
hi=*(sp)++; lo=*(sp)++; red = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++; green = (png_uint_16)((hi << 8) | (lo));
hi=*(sp)++; lo=*(sp)++; blue = (png_uint_16)((hi << 8) | (lo));
#endif
if (red == green && red == blue)
{
if (png_ptr->gamma_16_table != NULL)
@@ -3364,7 +3381,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
*(dp++) = (png_byte)((w>>8) & 0xff);
*(dp++) = (png_byte)(w & 0xff);
if (have_alpha)
if (have_alpha != 0)
{
*(dp++) = *(sp++);
*(dp++) = *(sp++);
@@ -3398,7 +3415,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
*(dp++) = (png_byte)((gray16>>8) & 0xff);
*(dp++) = (png_byte)(gray16 & 0xff);
if (have_alpha)
if (have_alpha != 0)
{
*(dp++) = *(sp++);
*(dp++) = *(sp++);
@@ -3477,8 +3494,8 @@ png_build_grayscale_palette(int bit_depth, png_colorp palette)
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
(defined PNG_READ_ALPHA_MODE_SUPPORTED)
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
/* Replace any alpha or transparency with the supplied background color.
* "background" is already in the screen gamma, while "background_1" is
* at a gamma of 1.0. Paletted files have already been taken care of.
@@ -3524,7 +3541,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
*sp |= (png_byte)(png_ptr->background.gray << shift);
}
if (!shift)
if (shift == 0)
{
shift = 7;
sp++;
@@ -3561,7 +3578,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
*sp |= (png_byte)(g << shift);
}
if (!shift)
if (shift == 0)
{
shift = 6;
sp++;
@@ -3586,7 +3603,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
*sp |= (png_byte)(png_ptr->background.gray << shift);
}
if (!shift)
if (shift == 0)
{
shift = 6;
sp++;
@@ -3624,7 +3641,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
*sp |= (png_byte)(g << shift);
}
if (!shift)
if (shift == 0)
{
shift = 4;
sp++;
@@ -3649,7 +3666,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
*sp |= (png_byte)(png_ptr->background.gray << shift);
}
if (!shift)
if (shift == 0)
{
shift = 4;
sp++;
@@ -3705,8 +3722,10 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
if (v == png_ptr->trans_color.gray)
{
/* Background is already in screen gamma */
*sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
*sp = (png_byte)((png_ptr->background.gray >> 8)
& 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.gray
& 0xff);
}
else
@@ -3729,8 +3748,10 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
if (v == png_ptr->trans_color.gray)
{
*sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
*sp = (png_byte)((png_ptr->background.gray >> 8)
& 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.gray
& 0xff);
}
}
}
@@ -3810,9 +3831,12 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
/* Background is already in screen gamma */
*sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
*(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff);
*(sp + 3) = (png_byte)(png_ptr->background.green & 0xff);
*(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff);
*(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
& 0xff);
*(sp + 3) = (png_byte)(png_ptr->background.green
& 0xff);
*(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
& 0xff);
*(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
}
@@ -3853,9 +3877,12 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
{
*sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
*(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff);
*(sp + 3) = (png_byte)(png_ptr->background.green & 0xff);
*(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff);
*(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
& 0xff);
*(sp + 3) = (png_byte)(png_ptr->background.green
& 0xff);
*(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
& 0xff);
*(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
}
}
@@ -3892,7 +3919,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
v = gamma_to_1[*sp];
png_composite(w, v, a, png_ptr->background_1.gray);
if (!optimize)
if (optimize == 0)
w = gamma_from_1[w];
*sp = w;
}
@@ -3910,7 +3937,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
*sp = (png_byte)png_ptr->background.gray;
else if (a < 0xff)
png_composite(*sp, *sp, a, png_ptr->background_1.gray);
png_composite(*sp, *sp, a, png_ptr->background.gray);
}
}
}
@@ -3938,7 +3965,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
else if (a == 0)
{
/* Background is already in screen gamma */
*sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff);
*sp = (png_byte)((png_ptr->background.gray >> 8)
& 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
}
@@ -3948,7 +3976,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
g = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
png_composite_16(v, g, a, png_ptr->background_1.gray);
if (optimize)
if (optimize != 0)
w = v;
else
w = gamma_16_from_1[(v&0xff) >> gamma_shift][v >> 8];
@@ -3968,7 +3996,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
if (a == 0)
{
*sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff);
*sp = (png_byte)((png_ptr->background.gray >> 8)
& 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff);
}
@@ -3977,7 +4006,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
png_uint_16 g, v;
g = (png_uint_16)(((*sp) << 8) + *(sp + 1));
png_composite_16(v, g, a, png_ptr->background_1.gray);
png_composite_16(v, g, a, png_ptr->background.gray);
*sp = (png_byte)((v >> 8) & 0xff);
*(sp + 1) = (png_byte)(v & 0xff);
}
@@ -4021,17 +4050,17 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
v = gamma_to_1[*sp];
png_composite(w, v, a, png_ptr->background_1.red);
if (!optimize) w = gamma_from_1[w];
if (optimize == 0) w = gamma_from_1[w];
*sp = w;
v = gamma_to_1[*(sp + 1)];
png_composite(w, v, a, png_ptr->background_1.green);
if (!optimize) w = gamma_from_1[w];
if (optimize == 0) w = gamma_from_1[w];
*(sp + 1) = w;
v = gamma_to_1[*(sp + 2)];
png_composite(w, v, a, png_ptr->background_1.blue);
if (!optimize) w = gamma_from_1[w];
if (optimize == 0) w = gamma_from_1[w];
*(sp + 2) = w;
}
}
@@ -4098,9 +4127,12 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
/* Background is already in screen gamma */
*sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
*(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff);
*(sp + 3) = (png_byte)(png_ptr->background.green & 0xff);
*(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff);
*(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
& 0xff);
*(sp + 3) = (png_byte)(png_ptr->background.green
& 0xff);
*(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
& 0xff);
*(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
}
@@ -4110,23 +4142,26 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp];
png_composite_16(w, v, a, png_ptr->background_1.red);
if (!optimize)
w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8];
if (optimize == 0)
w = gamma_16_from_1[((w&0xff) >> gamma_shift)]
[w >> 8];
*sp = (png_byte)((w >> 8) & 0xff);
*(sp + 1) = (png_byte)(w & 0xff);
v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)];
png_composite_16(w, v, a, png_ptr->background_1.green);
if (!optimize)
w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8];
if (optimize == 0)
w = gamma_16_from_1[((w&0xff) >> gamma_shift)]
[w >> 8];
*(sp + 2) = (png_byte)((w >> 8) & 0xff);
*(sp + 3) = (png_byte)(w & 0xff);
v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)];
png_composite_16(w, v, a, png_ptr->background_1.blue);
if (!optimize)
w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8];
if (optimize == 0)
w = gamma_16_from_1[((w&0xff) >> gamma_shift)]
[w >> 8];
*(sp + 4) = (png_byte)((w >> 8) & 0xff);
*(sp + 5) = (png_byte)(w & 0xff);
@@ -4147,9 +4182,12 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr)
{
*sp = (png_byte)((png_ptr->background.red >> 8) & 0xff);
*(sp + 1) = (png_byte)(png_ptr->background.red & 0xff);
*(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff);
*(sp + 3) = (png_byte)(png_ptr->background.green & 0xff);
*(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff);
*(sp + 2) = (png_byte)((png_ptr->background.green >> 8)
& 0xff);
*(sp + 3) = (png_byte)(png_ptr->background.green
& 0xff);
*(sp + 4) = (png_byte)((png_ptr->background.blue >> 8)
& 0xff);
*(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff);
}
@@ -4725,7 +4763,9 @@ png_do_expand(png_row_infop row_info, png_bytep row,
{
if (row_info->bit_depth == 8)
{
gray = gray & 0xff;
/* NOTE: prior to libpng 1.5.14 this cleared out the top bits of
* 'gray', however if those are set it is an error.
*/
sp = row + (png_size_t)row_width - 1;
dp = row + (png_size_t)(row_width << 1) - 1;
+97 -103
View File
@@ -1,8 +1,8 @@
/* pngrutil.c - utilities to read a PNG file
*
* Last changed in libpng 1.5.10 [March 8, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.25 [December 3, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -18,8 +18,6 @@
#ifdef PNG_READ_SUPPORTED
#define png_strtod(p,a,b) strtod(a,b)
png_uint_32 PNGAPI
png_get_uint_31(png_structp png_ptr, png_const_bytep buf)
{
@@ -91,7 +89,13 @@ png_get_int_32)(png_const_bytep buf)
return uval;
uval = (uval ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */
return -(png_int_32)uval;
if ((uval & 0x80000000) == 0) /* no overflow */
return -(png_int_32)uval;
/* The following has to be safe; this function only gets called on PNG data
* and if we get here that data is invalid. 0 is the most safe value and
* if not then an attacker would surely just generate a PNG with 0 instead.
*/
return 0;
}
/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */
@@ -211,7 +215,7 @@ png_crc_finish(png_structp png_ptr, png_uint_32 skip)
png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
}
if (i)
if (i != 0)
{
png_crc_read(png_ptr, png_ptr->zbuf, i);
}
@@ -267,7 +271,7 @@ png_crc_error(png_structp png_ptr)
/* The chunk CRC must be serialized in a single I/O call. */
png_read_data(png_ptr, crc_bytes, 4);
if (need_crc)
if (need_crc != 0)
{
crc = png_get_uint_32(crc_bytes);
return ((int)(crc != png_ptr->crc));
@@ -284,6 +288,17 @@ png_inflate(png_structp png_ptr, png_bytep data, png_size_t size,
{
png_size_t count = 0;
/* HACK: added in libpng 1.5.18: the progressive reader always leaves
* png_ptr->zstream in a non-reset state. This causes a reset if it needs to
* be used again. This only copes with that one specific error; see libpng
* 1.6 for a better solution.
*/
if ((png_ptr->flags & PNG_FLAG_ZSTREAM_PROGRESSIVE) != 0)
{
(void)inflateReset(&png_ptr->zstream);
png_ptr->flags &= ~PNG_FLAG_ZSTREAM_PROGRESSIVE;
}
/* zlib can't necessarily handle more than 65535 bytes at once (i.e. it can't
* even necessarily handle 65536 bytes) because the type uInt is "16 bits or
* more". Consequently it is necessary to chunk the input to zlib. This
@@ -596,7 +611,7 @@ void /* PRIVATE */
png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
png_color palette[PNG_MAX_PALETTE_LENGTH];
int num, i;
int max_palette_length, num, i;
#ifdef PNG_POINTER_INDEXING_SUPPORTED
png_colorp pal_ptr;
#endif
@@ -649,8 +664,22 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
}
}
/* The cast is safe because 'length' is less than 3*PNG_MAX_PALETTE_LENGTH */
num = (int)length / 3;
/* If the palette has 256 or fewer entries but is too large for the bit
* depth, we don't issue an error, to preserve the behavior of previous
* libpng versions. We silently truncate the unused extra palette entries
* here.
*/
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
max_palette_length = (1 << png_ptr->bit_depth);
else
max_palette_length = PNG_MAX_PALETTE_LENGTH;
if (num > max_palette_length)
num = max_palette_length;
#ifdef PNG_POINTER_INDEXING_SUPPORTED
for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++)
{
@@ -683,7 +712,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
#endif
{
png_crc_finish(png_ptr, 0);
png_crc_finish(png_ptr, (int) length - num * 3);
}
#ifndef PNG_READ_OPT_PLTE_SUPPORTED
@@ -1298,7 +1327,7 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
/* There should be at least one zero (the compression type byte)
* following the separator, and we should be on it
*/
if (profile >= png_ptr->chunkdata + slength - 1)
if (slength < 1U || profile >= png_ptr->chunkdata + slength - 1U)
{
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL;
@@ -1309,7 +1338,7 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
/* Compression_type should always be zero */
compression_type = *profile++;
if (compression_type)
if (compression_type != 0)
{
png_warning(png_ptr, "Ignoring nonzero compression type in iCCP chunk");
compression_type = 0x00; /* Reset it to zero (libpng-1.0.6 through 1.0.8
@@ -1447,7 +1476,8 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
++entry_start;
/* A sample depth should follow the separator, and we should be on it */
if (entry_start > (png_bytep)png_ptr->chunkdata + slength - 2)
if (slength < 2U ||
entry_start > (png_bytep)png_ptr->chunkdata + slength - 2U)
{
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL;
@@ -1976,7 +2006,7 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
/* We need to have at least 12 bytes after the purpose string
* in order to get the parameter information.
*/
if (endptr <= buf + 12)
if (endptr - buf <= 12)
{
png_warning(png_ptr, "Invalid pCAL data");
png_free(png_ptr, png_ptr->chunkdata);
@@ -2309,7 +2339,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_ptr->chunkdata = NULL;
png_free(png_ptr, text_ptr);
if (ret)
if (ret != 0)
png_warning(png_ptr, "Insufficient memory to process text chunk");
}
#endif
@@ -2388,7 +2418,7 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
/* Empty loop */ ;
/* zTXt must have some text after the chunkdataword */
if (text >= png_ptr->chunkdata + slength - 2)
if (slength < 2U || text >= png_ptr->chunkdata + slength - 2U)
{
png_warning(png_ptr, "Truncated zTXt chunk");
png_free(png_ptr, png_ptr->chunkdata);
@@ -2439,7 +2469,7 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL;
if (ret)
if (ret != 0)
png_error(png_ptr, "Insufficient memory to store zTXt chunk");
}
#endif
@@ -2452,7 +2482,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_textp text_ptr;
png_charp key, lang, text, lang_key;
int comp_flag;
int comp_type = 0;
int comp_type;
int ret;
png_size_t slength, prefix_len, data_len;
@@ -2525,7 +2555,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
* keyword
*/
if (lang >= png_ptr->chunkdata + slength - 3)
if (slength < 3U || lang >= png_ptr->chunkdata + slength - 3U)
{
png_warning(png_ptr, "Truncated iTXt chunk");
png_free(png_ptr, png_ptr->chunkdata);
@@ -2533,18 +2563,30 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
return;
}
else
{
comp_flag = *lang++;
comp_type = *lang++;
}
comp_flag = *lang++;
comp_type = *lang++;
if (comp_type || (comp_flag && comp_flag != PNG_TEXT_COMPRESSION_zTXt))
/* 1.5.14: The spec says "for uncompressed text decoders shall ignore [the
* compression type]". The compression flag shall be 0 (no compression) or
* 1 (compressed with method 0 - deflate.)
*/
if (comp_flag/*compressed*/ != 0)
{
png_warning(png_ptr, "Unknown iTXt compression type or method");
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL;
return;
if (comp_flag != 1)
{
png_warning(png_ptr, "invalid iTXt compression flag");
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL;
return;
}
if (comp_type != 0)
{
png_warning(png_ptr, "unknown iTXt compression type");
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL;
return;
}
}
for (lang_key = lang; *lang_key; lang_key++)
@@ -2577,7 +2619,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
key=png_ptr->chunkdata;
if (comp_flag)
if (comp_flag/*compressed*/)
png_decompress_chunk(png_ptr, comp_type,
(size_t)length, prefix_len, &data_len);
@@ -2595,7 +2637,8 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
return;
}
text_ptr->compression = (int)comp_flag + 1;
text_ptr->compression =
(comp_flag ? PNG_ITXT_COMPRESSION_zTXt : PNG_ITXT_COMPRESSION_NONE);
text_ptr->lang_key = png_ptr->chunkdata + (lang_key - key);
text_ptr->lang = png_ptr->chunkdata + (lang - key);
text_ptr->itxt_length = data_len;
@@ -2609,7 +2652,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL;
if (ret)
if (ret != 0)
png_error(png_ptr, "Insufficient memory to store iTXt chunk");
}
#endif
@@ -2786,7 +2829,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
{
unsigned int pixel_depth = png_ptr->transformed_pixel_depth;
png_const_bytep sp = png_ptr->row_buf + 1;
png_uint_32 row_width = png_ptr->width;
png_alloc_size_t row_width = png_ptr->width;
unsigned int pass = png_ptr->pass;
png_bytep end_ptr = 0;
png_byte end_byte = 0;
@@ -2938,7 +2981,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
# define S_MASKS(d,s) { S_MASK(0,d,s), S_MASK(1,d,s), S_MASK(2,d,s),\
S_MASK(3,d,s), S_MASK(4,d,s), S_MASK(5,d,s) }
# define B_MASKS(d,s) { B_MASK(1,d,s), S_MASK(3,d,s), S_MASK(5,d,s) }
# define B_MASKS(d,s) { B_MASK(1,d,s), B_MASK(3,d,s), B_MASK(5,d,s) }
# define DEPTH_INDEX(d) ((d)==1?0:((d)==2?1:2))
@@ -3049,7 +3092,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
}
/* Work out the bytes to copy. */
if (display)
if (display != 0)
{
/* When doing the 'block' algorithm the pixel in the pass gets
* replicated to adjacent pixels. This is why the even (0,2,4,6)
@@ -3059,7 +3102,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
/* But don't allow this number to exceed the actual row width. */
if (bytes_to_copy > row_width)
bytes_to_copy = row_width;
bytes_to_copy = (unsigned int)/*SAFE*/row_width;
}
else /* normal row; Adam7 only ever gives us one pixel to copy. */
@@ -3151,7 +3194,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
{
png_uint_32p dp32 = (png_uint_32p)dp;
png_const_uint_32p sp32 = (png_const_uint_32p)sp;
unsigned int skip = (bytes_to_jump-bytes_to_copy) /
size_t skip = (bytes_to_jump-bytes_to_copy) /
sizeof (png_uint_32);
do
@@ -3192,7 +3235,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
{
png_uint_16p dp16 = (png_uint_16p)dp;
png_const_uint_16p sp16 = (png_const_uint_16p)sp;
unsigned int skip = (bytes_to_jump-bytes_to_copy) /
size_t skip = (bytes_to_jump-bytes_to_copy) /
sizeof (png_uint_16);
do
@@ -3237,7 +3280,7 @@ png_combine_row(png_structp png_ptr, png_bytep dp, int display)
dp += bytes_to_jump;
row_width -= bytes_to_jump;
if (bytes_to_copy > row_width)
bytes_to_copy = row_width;
bytes_to_copy = (unsigned int)/*SAFE*/row_width;
}
}
@@ -3476,7 +3519,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
for (i = 0; i < row_info->width; i++)
{
png_byte v[8];
png_byte v[8]; /* SAFE; pixel_depth does not exceed 64 */
int j;
png_memcpy(v, sp, pixel_bytes);
@@ -3660,66 +3703,6 @@ png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row,
}
}
#ifdef PNG_ARM_NEON
#if defined __linux__ && !defined __ANDROID__
#include <stdio.h>
#include <elf.h>
#include <asm/hwcap.h>
static int png_have_hwcap(unsigned cap)
{
FILE *f = fopen("/proc/self/auxv", "r");
Elf32_auxv_t aux;
int have_cap = 0;
if (!f)
return 0;
while (fread(&aux, sizeof(aux), 1, f) > 0)
{
if (aux.a_type == AT_HWCAP &&
aux.a_un.a_val & cap)
{
have_cap = 1;
break;
}
}
fclose(f);
return have_cap;
}
#endif /* __linux__ */
static void
png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
{
#if defined __linux__ && !defined __ANDROID__
if (!png_have_hwcap(HWCAP_NEON))
return;
#endif
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon;
if (bpp == 3)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth3_neon;
}
else if (bpp == 4)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth4_neon;
}
}
#endif /* PNG_ARM_NEON */
static void
png_init_filter_functions(png_structp pp)
{
@@ -3735,8 +3718,16 @@ png_init_filter_functions(png_structp pp)
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth_multibyte_pixel;
#ifdef PNG_ARM_NEON
png_init_filter_functions_neon(pp, bpp);
#ifdef PNG_FILTER_OPTIMIZATIONS
/* To use this define PNG_FILTER_OPTIMIZATIONS as the name of a function to
* call to install hardware optimizations for the above functions; simply
* replace whatever elements of the pp->read_filter[] array with a hardware
* specific (or, for that matter, generic) optimization.
*
* To see an example of this examine what configure.ac does when
* --enable-arm-neon is specified on the command line.
*/
PNG_FILTER_OPTIMIZATIONS(pp, bpp);
#endif
}
@@ -3744,10 +3735,13 @@ void /* PRIVATE */
png_read_filter_row(png_structp pp, png_row_infop row_info, png_bytep row,
png_const_bytep prev_row, int filter)
{
if (pp->read_filter[0] == NULL)
png_init_filter_functions(pp);
if (filter > PNG_FILTER_VALUE_NONE && filter < PNG_FILTER_VALUE_LAST)
{
if (pp->read_filter[0] == NULL)
png_init_filter_functions(pp);
pp->read_filter[filter-1](row_info, row, prev_row);
}
}
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+189 -59
View File
@@ -1,8 +1,8 @@
/* pngset.c - storage of image information into info struct
*
* Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.26 [December 17, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -20,6 +20,60 @@
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) ||\
defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification,
* and if invalid, correct the keyword rather than discarding the entire
* chunk. The PNG 1.0 specification requires keywords 1-79 characters in
* length, forbids leading or trailing whitespace, multiple internal spaces,
* and the non-break space (0x80) from ISO 8859-1. Returns keyword length.
*
* The 'new_key' buffer must be 80 characters in size (for the keyword plus a
* trailing '\0'). If this routine returns 0 then there was no keyword, or a
* valid one could not be generated, and the caller must handle the error by not
* setting the keyword.
*/
static png_uint_32
png_check_keyword(png_const_charp key, png_bytep new_key)
{
png_uint_32 key_len = 0;
int space = 1;
if (key == NULL)
{
*new_key = 0;
return 0;
}
while (*key && key_len < 79)
{
png_byte ch = (png_byte)*key++;
if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/))
*new_key++ = ch, ++key_len, space = 0;
else if (space == 0)
{
/* A space or an invalid character when one wasn't seen immediately
* before; output just a space.
*/
*new_key++ = 32, ++key_len, space = 1;
}
}
if (key_len > 0 && space != 0) /* trailing space */
--key_len, --new_key;
/* Terminate the keyword */
*new_key = 0;
if (key_len == 0)
return 0;
return key_len;
}
#endif /* TEXT || pCAL || iCCP || sPLT */
#ifdef PNG_bKGD_SUPPORTED
void PNGAPI
png_set_bKGD(png_structp png_ptr, png_infop info_ptr,
@@ -123,12 +177,12 @@ png_set_cHRM_XYZ(png_structp png_ptr, png_infop info_ptr, double red_X,
png_fixed(png_ptr, red_X, "cHRM Red X"),
png_fixed(png_ptr, red_Y, "cHRM Red Y"),
png_fixed(png_ptr, red_Z, "cHRM Red Z"),
png_fixed(png_ptr, green_X, "cHRM Red X"),
png_fixed(png_ptr, green_Y, "cHRM Red Y"),
png_fixed(png_ptr, green_Z, "cHRM Red Z"),
png_fixed(png_ptr, blue_X, "cHRM Red X"),
png_fixed(png_ptr, blue_Y, "cHRM Red Y"),
png_fixed(png_ptr, blue_Z, "cHRM Red Z"));
png_fixed(png_ptr, green_X, "cHRM Green X"),
png_fixed(png_ptr, green_Y, "cHRM Green Y"),
png_fixed(png_ptr, green_Z, "cHRM Green Z"),
png_fixed(png_ptr, blue_X, "cHRM Blue X"),
png_fixed(png_ptr, blue_Y, "cHRM Blue Y"),
png_fixed(png_ptr, blue_Z, "cHRM Blue Z"));
}
# endif /* PNG_FLOATING_POINT_SUPPORTED */
@@ -252,16 +306,7 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth);
/* Check for potential overflow */
if (width >
(PNG_UINT_32_MAX >> 3) /* 8-byte RRGGBBAA pixels */
- 48 /* bigrowbuf hack */
- 1 /* filter byte */
- 7*8 /* rounding of width to multiple of 8 pixels */
- 8) /* extra max_pixel_depth pad */
info_ptr->rowbytes = 0;
else
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
}
#ifdef PNG_oFFs_SUPPORTED
@@ -287,6 +332,7 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type,
int nparams, png_const_charp units, png_charpp params)
{
png_byte new_purpose[80];
png_size_t length;
int i;
@@ -295,7 +341,15 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
if (png_ptr == NULL || info_ptr == NULL)
return;
length = png_strlen(purpose) + 1;
length = png_check_keyword(purpose, new_purpose);
if (length == 0)
{
png_warning(png_ptr, "pCAL: invalid purpose keyword");
return;
}
++length;
png_debug1(3, "allocating purpose for info (%lu bytes)",
(unsigned long)length);
@@ -318,7 +372,7 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
return;
}
png_memcpy(info_ptr->pcal_purpose, purpose, length);
png_memcpy(info_ptr->pcal_purpose, new_purpose, length);
png_debug(3, "storing X0, X1, type, and nparams in info");
info_ptr->pcal_X0 = X0;
@@ -517,12 +571,17 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
png_const_colorp palette, int num_palette)
{
png_uint_32 max_palette_length;
png_debug1(1, "in %s storage function", "PLTE");
if (png_ptr == NULL || info_ptr == NULL)
return;
if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH)
max_palette_length = (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
(1 << info_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH;
if (num_palette < 0 || num_palette > (int) max_palette_length)
{
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
png_error(png_ptr, "Invalid palette length");
@@ -541,8 +600,8 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);
/* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead
* of num_palette entries, in case of an invalid PNG file that has
* too-large sample values.
* of num_palette entries, in case of an invalid PNG file or incorrect
* call to png_set_PLTE() with too-large sample values.
*/
png_ptr->palette = (png_colorp)png_calloc(png_ptr,
PNG_MAX_PALETTE_LENGTH * png_sizeof(png_color));
@@ -618,6 +677,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
png_const_charp name, int compression_type,
png_const_bytep profile, png_uint_32 proflen)
{
png_byte new_name[80];
png_charp new_iccp_name;
png_bytep new_iccp_profile;
png_size_t length;
@@ -627,7 +687,15 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL)
return;
length = png_strlen(name)+1;
length = png_check_keyword(name, new_name);
if (length == 0)
{
png_warning(png_ptr, "iCCP: invalid keyword");
return;
}
++length;
new_iccp_name = (png_charp)png_malloc_warn(png_ptr, length);
if (new_iccp_name == NULL)
@@ -636,7 +704,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
return;
}
png_memcpy(new_iccp_name, name, length);
png_memcpy(new_iccp_name, new_name, length);
new_iccp_profile = (png_bytep)png_malloc_warn(png_ptr, proflen);
if (new_iccp_profile == NULL)
@@ -671,7 +739,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_const_textp text_ptr,
int ret;
ret = png_set_text_2(png_ptr, info_ptr, text_ptr, num_text);
if (ret)
if (ret != 0)
png_error(png_ptr, "Insufficient memory to store text");
}
@@ -680,8 +748,9 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
png_const_textp text_ptr, int num_text)
{
int i;
size_t element_size;
png_debug1(1, "in %lx storage function", png_ptr == NULL ? "unexpected" :
png_debug1(1, "in %lx storage function", png_ptr == NULL ? 0xabadca11 :
(unsigned long)png_ptr->chunk_name);
if (png_ptr == NULL || info_ptr == NULL || num_text == 0)
@@ -690,6 +759,18 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
/* Make sure we have enough space in the "text" array in info_struct
* to hold all of the incoming text_ptr objects.
*/
element_size=png_sizeof(png_text);
if (num_text < 0 ||
num_text > INT_MAX - info_ptr->num_text - 8 ||
(unsigned int)/*SAFE*/(num_text +/*SAFE*/
info_ptr->num_text + 8) >=
PNG_SIZE_MAX/element_size)
{
png_warning(png_ptr, "too many text chunks");
return(0);
}
if (info_ptr->num_text + num_text > info_ptr->max_text)
{
int old_max_text = info_ptr->max_text;
@@ -739,6 +820,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
}
for (i = 0; i < num_text; i++)
{
png_byte new_key[80], new_lang[80];
png_size_t text_length, key_len;
png_size_t lang_len, lang_key_len;
png_textp textp = &(info_ptr->text[info_ptr->num_text]);
@@ -753,7 +835,13 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
continue;
}
key_len = png_strlen(text_ptr[i].key);
key_len = png_check_keyword(text_ptr[i].key, new_key);
if (key_len == 0)
{
png_warning(png_ptr, "invalid text keyword");
continue;
}
if (text_ptr[i].compression <= 0)
{
@@ -766,8 +854,9 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
{
/* Set iTXt data */
/* Zero length language is OK */
if (text_ptr[i].lang != NULL)
lang_len = png_strlen(text_ptr[i].lang);
lang_len = png_check_keyword(text_ptr[i].lang, new_lang);
else
lang_len = 0;
@@ -815,7 +904,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
(key_len + lang_len + lang_key_len + text_length + 4),
textp->key);
png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len));
png_memcpy(textp->key, new_key, (png_size_t)(key_len));
*(textp->key + key_len) = '\0';
if (text_ptr[i].compression > 0)
@@ -836,7 +925,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
textp->text = textp->key + key_len + 1;
}
if (text_length)
if (text_length != 0)
png_memcpy(textp->text, text_ptr[i].text,
(png_size_t)(text_length));
@@ -897,6 +986,12 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
if (png_ptr == NULL || info_ptr == NULL)
return;
if (num_trans < 0 || num_trans > PNG_MAX_PALETTE_LENGTH)
{
png_warning(png_ptr, "Ignoring invalid num_trans value");
return;
}
if (trans_alpha != NULL)
{
/* It may not actually be necessary to set png_ptr->trans_alpha here;
@@ -916,16 +1011,19 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
if (trans_color != NULL)
{
int sample_max = (1 << info_ptr->bit_depth);
if (info_ptr->bit_depth < 16)
{
unsigned int sample_max = (1U << info_ptr->bit_depth) - 1U;
if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
(int)trans_color->gray > sample_max) ||
(info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
((int)trans_color->red > sample_max ||
(int)trans_color->green > sample_max ||
(int)trans_color->blue > sample_max)))
png_warning(png_ptr,
"tRNS chunk has out-of-range samples for bit_depth");
if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
trans_color->gray > sample_max) ||
(info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
(trans_color->red > sample_max ||
trans_color->green > sample_max ||
trans_color->blue > sample_max)))
png_warning(png_ptr,
"tRNS chunk has out-of-range samples for bit_depth");
}
png_memcpy(&(info_ptr->trans_color), trans_color,
png_sizeof(png_color_16));
@@ -958,14 +1056,25 @@ png_set_sPLT(png_structp png_ptr,
*/
{
png_sPLT_tp np;
int i;
int i, j;
size_t element_size;
if (png_ptr == NULL || info_ptr == NULL)
return;
np = (png_sPLT_tp)png_malloc_warn(png_ptr,
(info_ptr->splt_palettes_num + nentries) *
(png_size_t)png_sizeof(png_sPLT_t));
element_size = png_sizeof(png_sPLT_t);
if (nentries < 0 ||
nentries > INT_MAX-info_ptr->splt_palettes_num ||
(unsigned int)/*SAFE*/(nentries +/*SAFE*/
info_ptr->splt_palettes_num) >=
PNG_SIZE_MAX/element_size)
np=NULL;
else
np = (png_sPLT_tp)png_malloc_warn(png_ptr,
(info_ptr->splt_palettes_num + nentries) *
(png_size_t)png_sizeof(png_sPLT_t));
if (np == NULL)
{
@@ -979,13 +1088,22 @@ png_set_sPLT(png_structp png_ptr,
png_free(png_ptr, info_ptr->splt_palettes);
info_ptr->splt_palettes=NULL;
for (i = 0; i < nentries; i++)
for (i = j = 0; i < nentries; i++)
{
png_sPLT_tp to = np + info_ptr->splt_palettes_num + i;
png_sPLT_tp to = np + info_ptr->splt_palettes_num + j;
png_const_sPLT_tp from = entries + i;
png_byte new_name[80];
png_size_t length;
length = png_strlen(from->name) + 1;
length = png_check_keyword(from->name, new_name);
if (length == 0)
{
png_warning(png_ptr, "sPLT: invalid keyword");
continue;
}
++length; /* for trailing '\0' */
to->name = (png_charp)png_malloc_warn(png_ptr, length);
if (to->name == NULL)
@@ -995,7 +1113,7 @@ png_set_sPLT(png_structp png_ptr,
continue;
}
png_memcpy(to->name, from->name, length);
png_memcpy(to->name, new_name, length);
to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr,
from->nentries * png_sizeof(png_sPLT_entry));
@@ -1013,10 +1131,11 @@ png_set_sPLT(png_structp png_ptr,
to->nentries = from->nentries;
to->depth = from->depth;
++j;
}
info_ptr->splt_palettes = np;
info_ptr->splt_palettes_num += nentries;
info_ptr->splt_palettes_num = j;
info_ptr->valid |= PNG_INFO_sPLT;
info_ptr->free_me |= PNG_FREE_SPLT;
}
@@ -1029,13 +1148,23 @@ png_set_unknown_chunks(png_structp png_ptr,
{
png_unknown_chunkp np;
int i;
size_t element_size;
if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0)
return;
np = (png_unknown_chunkp)png_malloc_warn(png_ptr,
(png_size_t)(info_ptr->unknown_chunks_num + num_unknowns) *
png_sizeof(png_unknown_chunk));
element_size = png_sizeof(png_unknown_chunk);
if (num_unknowns < 0 ||
num_unknowns > INT_MAX-info_ptr->unknown_chunks_num ||
(unsigned int)/*SAFE*/(num_unknowns +/*SAFE*/
info_ptr->unknown_chunks_num) >=
PNG_SIZE_MAX/element_size)
np=NULL;
else
np = (png_unknown_chunkp)png_malloc_warn(png_ptr,
(png_size_t)(info_ptr->unknown_chunks_num + num_unknowns) *
png_sizeof(png_unknown_chunk));
if (np == NULL)
{
@@ -1198,11 +1327,12 @@ png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
info_ptr->row_pointers = row_pointers;
if (row_pointers)
if (row_pointers != NULL)
info_ptr->valid |= PNG_INFO_IDAT;
}
#endif
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
void PNGAPI
png_set_compression_buffer_size(png_structp png_ptr, png_size_t size)
{
@@ -1230,6 +1360,7 @@ png_set_compression_buffer_size(png_structp png_ptr, png_size_t size)
png_ptr->zstream.avail_out = 0;
png_ptr->zstream.avail_in = 0;
}
#endif /* WRITE_CUSTOMIZE_COMPRESSION */
void PNGAPI
png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
@@ -1248,7 +1379,7 @@ png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
{
/* Images with dimensions larger than these limits will be
* rejected by png_set_IHDR(). To accept any PNG datastream
* regardless of dimensions, set both limits to 0x7ffffffL.
* regardless of dimensions, set both limits to 0x7fffffffL.
*/
if (png_ptr == NULL)
return;
@@ -1262,7 +1393,7 @@ void PNGAPI
png_set_chunk_cache_max (png_structp png_ptr,
png_uint_32 user_chunk_cache_max)
{
if (png_ptr)
if (png_ptr != NULL)
png_ptr->user_chunk_cache_max = user_chunk_cache_max;
}
@@ -1271,7 +1402,7 @@ void PNGAPI
png_set_chunk_malloc_max (png_structp png_ptr,
png_alloc_size_t user_chunk_malloc_max)
{
if (png_ptr)
if (png_ptr != NULL)
png_ptr->user_chunk_malloc_max = user_chunk_malloc_max;
}
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
@@ -1283,7 +1414,7 @@ png_set_benign_errors(png_structp png_ptr, int allowed)
{
png_debug(1, "in png_set_benign_errors");
if (allowed)
if (allowed != 0)
png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN;
else
@@ -1300,12 +1431,11 @@ png_set_check_for_invalid_index(png_structp png_ptr, int allowed)
{
png_debug(1, "in png_set_check_for_invalid_index");
if (allowed)
if (allowed != 0)
png_ptr->num_palette_max = 0;
else
png_ptr->num_palette_max = -1;
}
#endif
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
+8 -13
View File
@@ -1,12 +1,11 @@
/* pngstruct.h - header file for PNG reference library
*
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.23 [July 23, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.9 [February 18, 2012]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -237,16 +236,6 @@ struct png_struct_def
png_uint_16p hist; /* histogram */
#endif
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
png_byte heuristic_method; /* heuristic for row filter selection */
png_byte num_prev_filters; /* number of weights for previous rows */
png_bytep prev_filters; /* filter type(s) of previous row(s) */
png_uint_16p filter_weights; /* weight(s) for previous line(s) */
png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */
png_uint_16p filter_costs; /* relative filter calculation cost */
png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */
#endif
#ifdef PNG_TIME_RFC1123_SUPPORTED
/* This is going to be unused in libpng16 and removed from libpng17 */
char time_buffer[29]; /* String to hold RFC 1123 time text */
@@ -352,7 +341,13 @@ struct png_struct_def
/* New member added in libpng-1.5.6 */
png_bytep big_prev_row;
/* New member added in libpng-1.5.7 */
void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info,
png_bytep row, png_const_bytep prev_row);
/* Options */
#ifdef PNG_SET_OPTION_SUPPORTED
png_byte options; /* On/off state (up to 4 options) */
#endif
};
#endif /* PNGSTRUCT_H */
+6 -6
View File
@@ -1,8 +1,8 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
* Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.19 [August 21, 2014]
* Copyright (c) 1998-2002,2004,2006-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -452,7 +452,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
{
if (row_info->bit_depth == 8)
{
if (at_start) /* Skip initial filler */
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channel and, for sp, the filler */
sp += 2, ++dp;
@@ -466,7 +466,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
else if (row_info->bit_depth == 16)
{
if (at_start) /* Skip initial filler */
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channel and, for sp, the filler */
sp += 4, dp += 2;
@@ -492,7 +492,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
{
if (row_info->bit_depth == 8)
{
if (at_start) /* Skip initial filler */
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channels and, for sp, the filler */
sp += 4, dp += 3;
@@ -506,7 +506,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
else if (row_info->bit_depth == 16)
{
if (at_start) /* Skip initial filler */
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channels and, for sp, the filler */
sp += 8, dp += 6;
+4 -2
View File
@@ -1,8 +1,8 @@
/* pngwio.c - functions for data output
*
* Last changed in libpng 1.5.0 [January 6, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Last changed in libpng 1.5.18 [February 6, 2014]
* Copyright (c) 1998-2002,2004,2006-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -207,6 +207,8 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
# else
png_ptr->output_flush_fn = output_flush_fn;
# endif
#else
PNG_UNUSED(output_flush_fn)
#endif /* PNG_WRITE_FLUSH_SUPPORTED */
/* It is an error to read while writing a png file */
+99 -315
View File
@@ -1,8 +1,8 @@
/* pngwrite.c - general routines to write a PNG file
*
* Last changed in libpng 1.5.11 [June 14, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.23 [July 23, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -34,85 +34,87 @@ png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
{
/* Write PNG signature */
png_write_sig(png_ptr);
/* Write PNG signature */
png_write_sig(png_ptr);
#ifdef PNG_MNG_FEATURES_SUPPORTED
if ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) && \
(png_ptr->mng_features_permitted))
{
png_warning(png_ptr, "MNG features are not allowed in a PNG datastream");
png_ptr->mng_features_permitted = 0;
}
if ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) && \
(png_ptr->mng_features_permitted))
{
png_warning(png_ptr,
"MNG features are not allowed in a PNG datastream");
png_ptr->mng_features_permitted = 0;
}
#endif
/* Write IHDR information. */
png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height,
info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type,
info_ptr->filter_type,
/* Write IHDR information. */
png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height,
info_ptr->bit_depth, info_ptr->color_type,
info_ptr->compression_type, info_ptr->filter_type,
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
info_ptr->interlace_type);
info_ptr->interlace_type
#else
0);
0
#endif
/* The rest of these check to see if the valid field has the appropriate
* flag set, and if it does, writes the chunk.
*/
);
/* The rest of these check to see if the valid field has the appropriate
* flag set, and if it does, writes the chunk.
*/
#ifdef PNG_WRITE_gAMA_SUPPORTED
if (info_ptr->valid & PNG_INFO_gAMA)
png_write_gAMA_fixed(png_ptr, info_ptr->gamma);
if (info_ptr->valid & PNG_INFO_gAMA)
png_write_gAMA_fixed(png_ptr, info_ptr->gamma);
#endif
#ifdef PNG_WRITE_sRGB_SUPPORTED
if (info_ptr->valid & PNG_INFO_sRGB)
png_write_sRGB(png_ptr, (int)info_ptr->srgb_intent);
if (info_ptr->valid & PNG_INFO_sRGB)
png_write_sRGB(png_ptr, (int)info_ptr->srgb_intent);
#endif
#ifdef PNG_WRITE_iCCP_SUPPORTED
if (info_ptr->valid & PNG_INFO_iCCP)
png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_COMPRESSION_TYPE_BASE,
(png_charp)info_ptr->iccp_profile, (int)info_ptr->iccp_proflen);
if (info_ptr->valid & PNG_INFO_iCCP)
png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_COMPRESSION_TYPE_BASE,
(png_charp)info_ptr->iccp_profile, (int)info_ptr->iccp_proflen);
#endif
#ifdef PNG_WRITE_sBIT_SUPPORTED
if (info_ptr->valid & PNG_INFO_sBIT)
png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type);
if (info_ptr->valid & PNG_INFO_sBIT)
png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type);
#endif
#ifdef PNG_WRITE_cHRM_SUPPORTED
if (info_ptr->valid & PNG_INFO_cHRM)
png_write_cHRM_fixed(png_ptr,
info_ptr->x_white, info_ptr->y_white,
info_ptr->x_red, info_ptr->y_red,
info_ptr->x_green, info_ptr->y_green,
info_ptr->x_blue, info_ptr->y_blue);
if (info_ptr->valid & PNG_INFO_cHRM)
png_write_cHRM_fixed(png_ptr,
info_ptr->x_white, info_ptr->y_white,
info_ptr->x_red, info_ptr->y_red,
info_ptr->x_green, info_ptr->y_green,
info_ptr->x_blue, info_ptr->y_blue);
#endif
#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
if (info_ptr->unknown_chunks_num)
{
png_unknown_chunk *up;
png_debug(5, "writing extra chunks");
for (up = info_ptr->unknown_chunks;
up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
up++)
if (info_ptr->unknown_chunks_num)
{
int keep = png_handle_as_unknown(png_ptr, up->name);
png_unknown_chunk *up;
if (keep != PNG_HANDLE_CHUNK_NEVER &&
up->location &&
!(up->location & PNG_HAVE_PLTE) &&
!(up->location & PNG_HAVE_IDAT) &&
!(up->location & PNG_AFTER_IDAT) &&
((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
(png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
png_debug(5, "writing extra chunks");
for (up = info_ptr->unknown_chunks;
up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
up++)
{
if (up->size == 0)
png_warning(png_ptr, "Writing zero-length unknown chunk");
int keep = png_handle_as_unknown(png_ptr, up->name);
png_write_chunk(png_ptr, up->name, up->data, up->size);
if (keep != PNG_HANDLE_CHUNK_NEVER &&
up->location &&
!(up->location & PNG_HAVE_PLTE) &&
!(up->location & PNG_HAVE_IDAT) &&
!(up->location & PNG_AFTER_IDAT) &&
((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
(png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
{
if (up->size == 0)
png_warning(png_ptr, "Writing zero-length unknown chunk");
png_write_chunk(png_ptr, up->name, up->data, up->size);
}
}
}
}
#endif
png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE;
}
@@ -223,11 +225,14 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
info_ptr->text[i].lang,
info_ptr->text[i].lang_key,
info_ptr->text[i].text);
/* Mark this chunk as written */
if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
else
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
#else
png_warning(png_ptr, "Unable to write international text");
png_warning(png_ptr, "Unable to write international text");
#endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
}
/* If we want a compressed text chunk */
@@ -238,11 +243,11 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
png_write_zTXt(png_ptr, info_ptr->text[i].key,
info_ptr->text[i].text, 0,
info_ptr->text[i].compression);
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
#else
png_warning(png_ptr, "Unable to write compressed text");
#endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
}
else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
@@ -340,11 +345,11 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
info_ptr->text[i].lang,
info_ptr->text[i].lang_key,
info_ptr->text[i].text);
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
#else
png_warning(png_ptr, "Unable to write international text");
#endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
}
else if (info_ptr->text[i].compression >= PNG_TEXT_COMPRESSION_zTXt)
@@ -354,11 +359,11 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
png_write_zTXt(png_ptr, info_ptr->text[i].key,
info_ptr->text[i].text, 0,
info_ptr->text[i].compression);
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
#else
png_warning(png_ptr, "Unable to write compressed text");
#endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
}
else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
@@ -367,12 +372,11 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
/* Write uncompressed chunk */
png_write_tEXt(png_ptr, info_ptr->text[i].key,
info_ptr->text[i].text, 0);
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
#else
png_warning(png_ptr, "Unable to write uncompressed text");
#endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
}
}
#endif
@@ -420,7 +424,6 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
}
#ifdef PNG_CONVERT_tIME_SUPPORTED
/* "tm" structure is not supported on WindowsCE */
void PNGAPI
png_convert_from_struct_tm(png_timep ptime, PNG_CONST struct tm FAR * ttime)
{
@@ -456,9 +459,6 @@ png_create_write_struct,(png_const_charp user_png_ver, png_voidp error_ptr,
warn_fn, NULL, NULL, NULL));
}
/* Alternate initialize png_ptr structure, and allocate any memory needed */
static void png_reset_filter_heuristics(png_structp png_ptr); /* forward decl */
PNG_FUNCTION(png_structp,PNGAPI
png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
@@ -500,14 +500,13 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
*/
#ifdef USE_FAR_KEYWORD
if (setjmp(tmp_jmpbuf))
png_memcpy(png_jmpbuf(png_ptr), tmp_jmpbuf, png_sizeof(jmp_buf));
PNG_ABORT();
#else
if (setjmp(png_jmpbuf(png_ptr))) /* sets longjmp to match setjmp */
#endif
#ifdef USE_FAR_KEYWORD
png_memcpy(png_jmpbuf(png_ptr), tmp_jmpbuf, png_sizeof(jmp_buf));
#endif
PNG_ABORT();
#endif
#endif
#ifdef PNG_USER_MEM_SUPPORTED
png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn);
@@ -520,7 +519,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
/* Initialize zbuf - compression buffer */
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
if (!png_cleanup_needed)
if (png_cleanup_needed == 0)
{
png_ptr->zbuf = (png_bytep)png_malloc_warn(png_ptr,
png_ptr->zbuf_size);
@@ -528,7 +527,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
png_cleanup_needed = 1;
}
if (png_cleanup_needed)
if (png_cleanup_needed != 0)
{
/* Clean up PNG structure and deallocate any memory. */
png_free(png_ptr, png_ptr->zbuf);
@@ -544,10 +543,6 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
png_set_write_fn(png_ptr, NULL, NULL, NULL);
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
png_reset_filter_heuristics(png_ptr);
#endif
return (png_ptr);
}
@@ -764,7 +759,7 @@ png_write_row(png_structp png_ptr, png_const_bytep row)
{
png_do_write_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass);
/* This should always get caught above, but still ... */
if (!(row_info.width))
if (row_info.width == 0)
{
png_write_finish_row(png_ptr);
return;
@@ -864,7 +859,7 @@ png_write_flush(png_structp png_ptr)
png_error(png_ptr, "zlib error");
}
if (!(png_ptr->zstream.avail_out))
if ((png_ptr->zstream.avail_out) == 0)
{
/* Write the IDAT and reset the zlib output buffer */
png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
@@ -982,13 +977,6 @@ png_write_destroy(png_structp png_ptr)
png_free(png_ptr, png_ptr->paeth_row);
#endif
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
/* Use this to save a little code space, it doesn't free the filter_costs */
png_reset_filter_heuristics(png_ptr);
png_free(png_ptr, png_ptr->filter_costs);
png_free(png_ptr, png_ptr->inv_filter_costs);
#endif
#ifdef PNG_SETJMP_SUPPORTED
/* Reset structure */
png_memcpy(tmp_jmp, png_ptr->longjmp_buffer, png_sizeof(jmp_buf));
@@ -1042,6 +1030,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
case 5:
case 6:
case 7: png_warning(png_ptr, "Unknown row filter for method 0");
/* FALL THROUGH */
#endif /* PNG_WRITE_FILTER_SUPPORTED */
case PNG_FILTER_VALUE_NONE:
png_ptr->do_filter = PNG_FILTER_NONE; break;
@@ -1078,6 +1067,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
*/
if (png_ptr->row_buf != NULL)
{
png_ptr->do_filter = PNG_FILTER_NONE;
#ifdef PNG_WRITE_FILTER_SUPPORTED
if ((png_ptr->do_filter & PNG_FILTER_SUB) && png_ptr->sub_row == NULL)
{
@@ -1138,8 +1128,8 @@ png_set_filter(png_structp png_ptr, int method, int filters)
}
if (png_ptr->do_filter == PNG_NO_FILTERS)
#endif /* PNG_WRITE_FILTER_SUPPORTED */
png_ptr->do_filter = PNG_FILTER_NONE;
#endif /* PNG_WRITE_FILTER_SUPPORTED */
}
}
else
@@ -1153,122 +1143,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
* filtered data going to zlib more consistent, hopefully resulting in
* better compression.
*/
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* GRR 970116 */
/* Convenience reset API. */
static void
png_reset_filter_heuristics(png_structp png_ptr)
{
/* Clear out any old values in the 'weights' - this must be done because if
* the app calls set_filter_heuristics multiple times with different
* 'num_weights' values we would otherwise potentially have wrong sized
* arrays.
*/
png_ptr->num_prev_filters = 0;
png_ptr->heuristic_method = PNG_FILTER_HEURISTIC_UNWEIGHTED;
if (png_ptr->prev_filters != NULL)
{
png_bytep old = png_ptr->prev_filters;
png_ptr->prev_filters = NULL;
png_free(png_ptr, old);
}
if (png_ptr->filter_weights != NULL)
{
png_uint_16p old = png_ptr->filter_weights;
png_ptr->filter_weights = NULL;
png_free(png_ptr, old);
}
if (png_ptr->inv_filter_weights != NULL)
{
png_uint_16p old = png_ptr->inv_filter_weights;
png_ptr->inv_filter_weights = NULL;
png_free(png_ptr, old);
}
/* Leave the filter_costs - this array is fixed size. */
}
static int
png_init_filter_heuristics(png_structp png_ptr, int heuristic_method,
int num_weights)
{
if (png_ptr == NULL)
return 0;
/* Clear out the arrays */
png_reset_filter_heuristics(png_ptr);
/* Check arguments; the 'reset' function makes the correct settings for the
* unweighted case, but we must handle the weight case by initializing the
* arrays for the caller.
*/
if (heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int i;
if (num_weights > 0)
{
png_ptr->prev_filters = (png_bytep)png_malloc(png_ptr,
(png_uint_32)(png_sizeof(png_byte) * num_weights));
/* To make sure that the weighting starts out fairly */
for (i = 0; i < num_weights; i++)
{
png_ptr->prev_filters[i] = 255;
}
png_ptr->filter_weights = (png_uint_16p)png_malloc(png_ptr,
(png_uint_32)(png_sizeof(png_uint_16) * num_weights));
png_ptr->inv_filter_weights = (png_uint_16p)png_malloc(png_ptr,
(png_uint_32)(png_sizeof(png_uint_16) * num_weights));
for (i = 0; i < num_weights; i++)
{
png_ptr->inv_filter_weights[i] =
png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR;
}
/* Safe to set this now */
png_ptr->num_prev_filters = (png_byte)num_weights;
}
/* If, in the future, there are other filter methods, this would
* need to be based on png_ptr->filter.
*/
if (png_ptr->filter_costs == NULL)
{
png_ptr->filter_costs = (png_uint_16p)png_malloc(png_ptr,
(png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr,
(png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
}
for (i = 0; i < PNG_FILTER_VALUE_LAST; i++)
{
png_ptr->inv_filter_costs[i] =
png_ptr->filter_costs[i] = PNG_COST_FACTOR;
}
/* All the arrays are inited, safe to set this: */
png_ptr->heuristic_method = PNG_FILTER_HEURISTIC_WEIGHTED;
/* Return the 'ok' code. */
return 1;
}
else if (heuristic_method == PNG_FILTER_HEURISTIC_DEFAULT ||
heuristic_method == PNG_FILTER_HEURISTIC_UNWEIGHTED)
{
return 1;
}
else
{
png_warning(png_ptr, "Unknown filter heuristic method");
return 0;
}
}
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */
/* Provide floating and fixed point APIs */
#ifdef PNG_FLOATING_POINT_SUPPORTED
void PNGAPI
@@ -1276,52 +1151,11 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
int num_weights, png_const_doublep filter_weights,
png_const_doublep filter_costs)
{
png_debug(1, "in png_set_filter_heuristics");
/* The internal API allocates all the arrays and ensures that the elements of
* those arrays are set to the default value.
*/
if (!png_init_filter_heuristics(png_ptr, heuristic_method, num_weights))
return;
/* If using the weighted method copy in the weights. */
if (heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int i;
for (i = 0; i < num_weights; i++)
{
if (filter_weights[i] <= 0.0)
{
png_ptr->inv_filter_weights[i] =
png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR;
}
else
{
png_ptr->inv_filter_weights[i] =
(png_uint_16)(PNG_WEIGHT_FACTOR*filter_weights[i]+.5);
png_ptr->filter_weights[i] =
(png_uint_16)(PNG_WEIGHT_FACTOR/filter_weights[i]+.5);
}
}
/* Here is where we set the relative costs of the different filters. We
* should take the desired compression level into account when setting
* the costs, so that Paeth, for instance, has a high relative cost at low
* compression levels, while it has a lower relative cost at higher
* compression settings. The filter types are in order of increasing
* relative cost, so it would be possible to do this with an algorithm.
*/
for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) if (filter_costs[i] >= 1.0)
{
png_ptr->inv_filter_costs[i] =
(png_uint_16)(PNG_COST_FACTOR / filter_costs[i] + .5);
png_ptr->filter_costs[i] =
(png_uint_16)(PNG_COST_FACTOR * filter_costs[i] + .5);
}
}
PNG_UNUSED(png_ptr)
PNG_UNUSED(heuristic_method)
PNG_UNUSED(num_weights)
PNG_UNUSED(filter_weights)
PNG_UNUSED(filter_costs)
}
#endif /* FLOATING_POINT */
@@ -1331,67 +1165,16 @@ png_set_filter_heuristics_fixed(png_structp png_ptr, int heuristic_method,
int num_weights, png_const_fixed_point_p filter_weights,
png_const_fixed_point_p filter_costs)
{
png_debug(1, "in png_set_filter_heuristics_fixed");
/* The internal API allocates all the arrays and ensures that the elements of
* those arrays are set to the default value.
*/
if (!png_init_filter_heuristics(png_ptr, heuristic_method, num_weights))
return;
/* If using the weighted method copy in the weights. */
if (heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int i;
for (i = 0; i < num_weights; i++)
{
if (filter_weights[i] <= 0)
{
png_ptr->inv_filter_weights[i] =
png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR;
}
else
{
png_ptr->inv_filter_weights[i] = (png_uint_16)
((PNG_WEIGHT_FACTOR*filter_weights[i]+PNG_FP_HALF)/PNG_FP_1);
png_ptr->filter_weights[i] = (png_uint_16)((PNG_WEIGHT_FACTOR*
PNG_FP_1+(filter_weights[i]/2))/filter_weights[i]);
}
}
/* Here is where we set the relative costs of the different filters. We
* should take the desired compression level into account when setting
* the costs, so that Paeth, for instance, has a high relative cost at low
* compression levels, while it has a lower relative cost at higher
* compression settings. The filter types are in order of increasing
* relative cost, so it would be possible to do this with an algorithm.
*/
for (i = 0; i < PNG_FILTER_VALUE_LAST; i++)
if (filter_costs[i] >= PNG_FP_1)
{
png_uint_32 tmp;
/* Use a 32 bit unsigned temporary here because otherwise the
* intermediate value will be a 32 bit *signed* integer (ANSI rules)
* and this will get the wrong answer on division.
*/
tmp = PNG_COST_FACTOR*PNG_FP_1 + (filter_costs[i]/2);
tmp /= filter_costs[i];
png_ptr->inv_filter_costs[i] = (png_uint_16)tmp;
tmp = PNG_COST_FACTOR * filter_costs[i] + PNG_FP_HALF;
tmp /= PNG_FP_1;
png_ptr->filter_costs[i] = (png_uint_16)tmp;
}
}
PNG_UNUSED(png_ptr)
PNG_UNUSED(heuristic_method)
PNG_UNUSED(num_weights)
PNG_UNUSED(filter_weights)
PNG_UNUSED(filter_costs)
}
#endif /* FIXED_POINT */
#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
#endif /* WRITE_WEIGHTED_FILTER */
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
void PNGAPI
png_set_compression_level(png_structp png_ptr, int level)
{
@@ -1470,6 +1253,7 @@ png_set_compression_method(png_structp png_ptr, int method)
png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD;
png_ptr->zlib_method = method;
}
#endif /* WRITE_CUSTOMIZE_COMPRESSION */
/* The following were added to libpng-1.5.4 */
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
@@ -1527,10 +1311,10 @@ png_set_text_compression_window_bits(png_structp png_ptr, int window_bits)
#ifndef WBITS_8_OK
/* Avoid libpng bug with 256-byte windows */
if (window_bits == 8)
{
png_warning(png_ptr, "Text compression window is being reset to 512");
window_bits = 9;
}
{
png_warning(png_ptr, "Text compression window is being reset to 512");
window_bits = 9;
}
#endif
png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_WINDOW_BITS;
+16 -4
View File
@@ -1,8 +1,8 @@
/* pngwtran.c - transforms the data in a row for PNG writers
*
* Last changed in libpng 1.5.6 [November 3, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Copyright (c) 1998-2002,2004,2006-2012 Glenn Randers-Pehrson
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -45,8 +45,20 @@ png_do_write_transformations(png_structp png_ptr, png_row_infop row_info)
#ifdef PNG_WRITE_FILLER_SUPPORTED
if (png_ptr->transformations & PNG_FILLER)
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
!(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
{
if (png_ptr->color_type & (PNG_COLOR_MASK_ALPHA|PNG_COLOR_MASK_PALETTE))
{
/* GA, RGBA or palette; in any of these cases libpng will not do the
* the correct thing (whatever that might be).
*/
png_warning(png_ptr, "incorrect png_set_filler call ignored");
png_ptr->transformations &= ~PNG_FILLER;
}
else
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
!(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
}
#endif
#ifdef PNG_WRITE_PACKSWAP_SUPPORTED
+53 -552
View File
@@ -1,8 +1,8 @@
/* pngwutil.c - utilities to write a PNG file
*
* Last changed in libpng 1.5.10 [March 8, 2012]
* Copyright (c) 1998-2012 Glenn Randers-Pehrson
* Last changed in libpng 1.5.26 [December 17, 2015]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -30,19 +30,20 @@ png_save_uint_32(png_bytep buf, png_uint_32 i)
}
#ifdef PNG_SAVE_INT_32_SUPPORTED
/* The png_save_int_32 function assumes integers are stored in two's
* complement format. If this isn't the case, then this routine needs to
* be modified to write data in two's complement format. Note that,
* the following works correctly even if png_int_32 has more than 32 bits
* (compare the more complex code required on read for sign extention.)
/* PNG signed integers are saved in 32-bit 2's complement format. ANSI C-90
* defines a cast of a signed integer to an unsigned integer either to preserve
* the value, if it is positive, or to calculate:
*
* (UNSIGNED_MAX+1) + integer
*
* Where UNSIGNED_MAX is the appropriate maximum unsigned value, so when the
* negative integral value is added the result will be an unsigned value
* correspnding to the 2's complement representation.
*/
void PNGAPI
png_save_int_32(png_bytep buf, png_int_32 i)
{
buf[0] = (png_byte)((i >> 24) & 0xff);
buf[1] = (png_byte)((i >> 16) & 0xff);
buf[2] = (png_byte)((i >> 8) & 0xff);
buf[3] = (png_byte)(i & 0xff);
png_save_uint_32(buf, i);
}
#endif
@@ -315,6 +316,7 @@ png_zlib_release(png_structp png_ptr)
if (ret != Z_OK)
{
#ifdef PNG_WARNINGS_SUPPORTED
png_const_charp err;
PNG_WARNING_PARAMETERS(p)
@@ -349,6 +351,7 @@ png_zlib_release(png_structp png_ptr)
png_formatted_warning(png_ptr, p,
"zlib failed to reset compressor: @1(@2): @3");
#endif
}
}
@@ -460,24 +463,21 @@ png_text_compress(png_structp png_ptr,
old_ptr = comp->output_ptr;
comp->output_ptr = (png_bytepp)png_malloc(png_ptr,
(png_alloc_size_t)
(comp->max_output_ptr * png_sizeof(png_charpp)));
(comp->max_output_ptr * png_sizeof(png_bytep)));
png_memcpy(comp->output_ptr, old_ptr, old_max
* png_sizeof(png_charp));
* png_sizeof(png_bytep));
png_free(png_ptr, old_ptr);
}
else
comp->output_ptr = (png_bytepp)png_malloc(png_ptr,
(png_alloc_size_t)
(comp->max_output_ptr * png_sizeof(png_charp)));
(comp->max_output_ptr * png_sizeof(png_bytep)));
}
/* Save the data */
comp->output_ptr[comp->num_output_ptr] =
(png_bytep)png_malloc(png_ptr,
(png_alloc_size_t)png_ptr->zbuf_size);
(png_bytep)png_malloc(png_ptr, png_ptr->zbuf_size);
png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
png_ptr->zbuf_size);
@@ -826,7 +826,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
png_ptr->zstream.zfree = png_zfree;
png_ptr->zstream.opaque = (voidpf)png_ptr;
if (!(png_ptr->do_filter))
if ((png_ptr->do_filter) == PNG_NO_FILTERS)
{
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE ||
png_ptr->bit_depth < 8)
@@ -896,17 +896,20 @@ void /* PRIVATE */
png_write_PLTE(png_structp png_ptr, png_const_colorp palette,
png_uint_32 num_pal)
{
png_uint_32 i;
png_uint_32 max_palette_length, i;
png_const_colorp pal_ptr;
png_byte buf[3];
png_debug(1, "in png_write_PLTE");
max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
(1 << png_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH;
if ((
#ifdef PNG_MNG_FEATURES_SUPPORTED
!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
#endif
num_pal == 0) || num_pal > 256)
num_pal == 0) || num_pal > max_palette_length)
{
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
{
@@ -1096,7 +1099,6 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type,
png_const_charp profile, int profile_len)
{
png_size_t name_len;
png_charp new_name;
compression_state comp;
int embedded_profile_len = 0;
@@ -1108,8 +1110,7 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type,
comp.input = NULL;
comp.input_len = 0;
if ((name_len = png_check_keyword(png_ptr, name, &new_name)) == 0)
return;
name_len = png_strlen(name);
if (compression_type != PNG_COMPRESSION_TYPE_BASE)
png_warning(png_ptr, "Unknown compression type in iCCP chunk");
@@ -1128,8 +1129,6 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type,
{
png_warning(png_ptr,
"Embedded profile length in iCCP chunk is negative");
png_free(png_ptr, new_name);
return;
}
@@ -1137,8 +1136,6 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type,
{
png_warning(png_ptr,
"Embedded profile length too large in iCCP chunk");
png_free(png_ptr, new_name);
return;
}
@@ -1150,7 +1147,7 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type,
profile_len = embedded_profile_len;
}
if (profile_len)
if (profile_len != 0)
profile_len = png_text_compress(png_ptr, profile,
(png_size_t)profile_len, PNG_COMPRESSION_TYPE_BASE, &comp);
@@ -1158,18 +1155,21 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type,
png_write_chunk_header(png_ptr, png_iCCP,
(png_uint_32)(name_len + profile_len + 2));
new_name[name_len + 1] = 0x00;
png_write_chunk_data(png_ptr, (png_bytep)name, name_len);
png_write_chunk_data(png_ptr, (png_bytep)new_name,
(png_size_t)(name_len + 2));
{
png_byte buffer[2];
buffer[0] = 0; /* terminate name */
buffer[1] = 0xFFU & compression_type;
png_write_chunk_data(png_ptr, buffer, 2);
}
if (profile_len)
if (profile_len != 0)
{
png_write_compressed_data_out(png_ptr, &comp, profile_len);
}
png_write_chunk_end(png_ptr);
png_free(png_ptr, new_name);
}
#endif
@@ -1179,7 +1179,6 @@ void /* PRIVATE */
png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette)
{
png_size_t name_len;
png_charp new_name;
png_byte entrybuf[10];
png_size_t entry_size = (spalette->depth == 8 ? 6 : 10);
png_size_t palette_size = entry_size * spalette->nentries;
@@ -1190,14 +1189,13 @@ png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette)
png_debug(1, "in png_write_sPLT");
if ((name_len = png_check_keyword(png_ptr,spalette->name, &new_name))==0)
return;
name_len = png_strlen(spalette->name);
/* Make sure we include the NULL after the name */
png_write_chunk_header(png_ptr, png_sPLT,
(png_uint_32)(name_len + 2 + palette_size));
png_write_chunk_data(png_ptr, (png_bytep)new_name,
png_write_chunk_data(png_ptr, (png_bytep)spalette->name,
(png_size_t)(name_len + 1));
png_write_chunk_data(png_ptr, &spalette->depth, (png_size_t)1);
@@ -1253,7 +1251,6 @@ png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette)
#endif
png_write_chunk_end(png_ptr);
png_free(png_ptr, new_name);
}
#endif
@@ -1370,7 +1367,8 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha,
}
/* Write the chunk out as it is */
png_write_complete_chunk(png_ptr, png_tRNS, trans_alpha, (png_size_t)num_trans);
png_write_complete_chunk(png_ptr, png_tRNS, trans_alpha,
(png_size_t)num_trans);
}
else if (color_type == PNG_COLOR_TYPE_GRAY)
@@ -1508,138 +1506,6 @@ png_write_hIST(png_structp png_ptr, png_const_uint_16p hist, int num_hist)
}
#endif
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification,
* and if invalid, correct the keyword rather than discarding the entire
* chunk. The PNG 1.0 specification requires keywords 1-79 characters in
* length, forbids leading or trailing whitespace, multiple internal spaces,
* and the non-break space (0x80) from ISO 8859-1. Returns keyword length.
*
* The new_key is allocated to hold the corrected keyword and must be freed
* by the calling routine. This avoids problems with trying to write to
* static keywords without having to have duplicate copies of the strings.
*/
png_size_t /* PRIVATE */
png_check_keyword(png_structp png_ptr, png_const_charp key, png_charpp new_key)
{
png_size_t key_len;
png_const_charp ikp;
png_charp kp, dp;
int kflag;
int kwarn=0;
png_debug(1, "in png_check_keyword");
*new_key = NULL;
if (key == NULL || (key_len = png_strlen(key)) == 0)
{
png_warning(png_ptr, "zero length keyword");
return ((png_size_t)0);
}
png_debug1(2, "Keyword to be checked is '%s'", key);
*new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2));
if (*new_key == NULL)
{
png_warning(png_ptr, "Out of memory while procesing keyword");
return ((png_size_t)0);
}
/* Replace non-printing characters with a blank and print a warning */
for (ikp = key, dp = *new_key; *ikp != '\0'; ikp++, dp++)
{
if ((png_byte)*ikp < 0x20 ||
((png_byte)*ikp > 0x7E && (png_byte)*ikp < 0xA1))
{
PNG_WARNING_PARAMETERS(p)
png_warning_parameter_unsigned(p, 1, PNG_NUMBER_FORMAT_02x,
(png_byte)*ikp);
png_formatted_warning(png_ptr, p, "invalid keyword character 0x@1");
*dp = ' ';
}
else
{
*dp = *ikp;
}
}
*dp = '\0';
/* Remove any trailing white space. */
kp = *new_key + key_len - 1;
if (*kp == ' ')
{
png_warning(png_ptr, "trailing spaces removed from keyword");
while (*kp == ' ')
{
*(kp--) = '\0';
key_len--;
}
}
/* Remove any leading white space. */
kp = *new_key;
if (*kp == ' ')
{
png_warning(png_ptr, "leading spaces removed from keyword");
while (*kp == ' ')
{
kp++;
key_len--;
}
}
png_debug1(2, "Checking for multiple internal spaces in '%s'", kp);
/* Remove multiple internal spaces. */
for (kflag = 0, dp = *new_key; *kp != '\0'; kp++)
{
if (*kp == ' ' && kflag == 0)
{
*(dp++) = *kp;
kflag = 1;
}
else if (*kp == ' ')
{
key_len--;
kwarn = 1;
}
else
{
*(dp++) = *kp;
kflag = 0;
}
}
*dp = '\0';
if (kwarn)
png_warning(png_ptr, "extra interior spaces removed from keyword");
if (key_len == 0)
{
png_free(png_ptr, *new_key);
png_warning(png_ptr, "Zero length keyword");
}
if (key_len > 79)
{
png_warning(png_ptr, "keyword length must be 1 - 79 characters");
(*new_key)[79] = '\0';
key_len = 79;
}
return (key_len);
}
#endif
#ifdef PNG_WRITE_tEXt_SUPPORTED
/* Write a tEXt chunk */
void /* PRIVATE */
@@ -1647,12 +1513,10 @@ png_write_tEXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
png_size_t text_len)
{
png_size_t key_len;
png_charp new_key;
png_debug(1, "in png_write_tEXt");
if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0)
return;
key_len = strlen(key);
if (text == NULL || *text == '\0')
text_len = 0;
@@ -1669,15 +1533,14 @@ png_write_tEXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
* any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them.
* The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.
*/
png_write_chunk_data(png_ptr, (png_bytep)new_key,
png_write_chunk_data(png_ptr, (png_bytep)key,
(png_size_t)(key_len + 1));
if (text_len)
if (text_len != 0)
png_write_chunk_data(png_ptr, (png_const_bytep)text,
(png_size_t)text_len);
png_write_chunk_end(png_ptr);
png_free(png_ptr, new_key);
}
#endif
@@ -1689,7 +1552,6 @@ png_write_zTXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
{
png_size_t key_len;
png_byte buf;
png_charp new_key;
compression_state comp;
png_debug(1, "in png_write_zTXt");
@@ -1700,16 +1562,11 @@ png_write_zTXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
comp.input = NULL;
comp.input_len = 0;
if ((key_len = png_check_keyword(png_ptr, key, &new_key)) == 0)
{
png_free(png_ptr, new_key);
return;
}
key_len = strlen(key);
if (text == NULL || *text == '\0' || compression==PNG_TEXT_COMPRESSION_NONE)
{
png_write_tEXt(png_ptr, new_key, text, (png_size_t)0);
png_free(png_ptr, new_key);
png_write_tEXt(png_ptr, key, text, (png_size_t)0);
return;
}
@@ -1724,11 +1581,9 @@ png_write_zTXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
(png_uint_32)(key_len+text_len + 2));
/* Write key */
png_write_chunk_data(png_ptr, (png_bytep)new_key,
png_write_chunk_data(png_ptr, (png_bytep)key,
(png_size_t)(key_len + 1));
png_free(png_ptr, new_key);
buf = (png_byte)compression;
/* Write compression */
@@ -1749,8 +1604,6 @@ png_write_iTXt(png_structp png_ptr, int compression, png_const_charp key,
png_const_charp lang, png_const_charp lang_key, png_const_charp text)
{
png_size_t lang_len, key_len, lang_key_len, text_len;
png_charp new_lang;
png_charp new_key = NULL;
png_byte cbuf[2];
compression_state comp;
@@ -1761,15 +1614,13 @@ png_write_iTXt(png_structp png_ptr, int compression, png_const_charp key,
comp.output_ptr = NULL;
comp.input = NULL;
if ((key_len = png_check_keyword(png_ptr, key, &new_key)) == 0)
return;
key_len = png_strlen(key);
if ((lang_len = png_check_keyword(png_ptr, lang, &new_lang)) == 0)
{
png_warning(png_ptr, "Empty language field in iTXt chunk");
new_lang = NULL;
if (lang == NULL)
lang_len = 0;
}
else
lang_len = png_strlen(lang);
if (lang_key == NULL)
lang_key_len = 0;
@@ -1804,7 +1655,7 @@ png_write_iTXt(png_structp png_ptr, int compression, png_const_charp key,
* any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them.
* The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.
*/
png_write_chunk_data(png_ptr, (png_bytep)new_key, (png_size_t)(key_len + 1));
png_write_chunk_data(png_ptr, (png_bytep)key, (png_size_t)(key_len + 1));
/* Set the compression flag */
if (compression == PNG_ITXT_COMPRESSION_NONE ||
@@ -1820,7 +1671,7 @@ png_write_iTXt(png_structp png_ptr, int compression, png_const_charp key,
png_write_chunk_data(png_ptr, cbuf, (png_size_t)2);
cbuf[0] = 0;
png_write_chunk_data(png_ptr, (new_lang ? (png_const_bytep)new_lang : cbuf),
png_write_chunk_data(png_ptr, (lang ? (png_const_bytep)lang : cbuf),
(png_size_t)(lang_len + 1));
png_write_chunk_data(png_ptr, (lang_key ? (png_const_bytep)lang_key : cbuf),
@@ -1829,9 +1680,6 @@ png_write_iTXt(png_structp png_ptr, int compression, png_const_charp key,
png_write_compressed_data_out(png_ptr, &comp, text_len);
png_write_chunk_end(png_ptr);
png_free(png_ptr, new_key);
png_free(png_ptr, new_lang);
}
#endif
@@ -1865,7 +1713,6 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
png_size_t purpose_len, units_len, total_len;
png_size_tp params_len;
png_byte buf[10];
png_charp new_purpose;
int i;
png_debug1(1, "in png_write_pCAL (%d parameters)", nparams);
@@ -1873,7 +1720,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
if (type >= PNG_EQUATION_LAST)
png_warning(png_ptr, "Unrecognized equation type for pCAL chunk");
purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1;
purpose_len = strlen(purpose) + 1;
png_debug1(3, "pCAL purpose length = %d", (int)purpose_len);
units_len = png_strlen(units) + (nparams == 0 ? 0 : 1);
png_debug1(3, "pCAL units length = %d", (int)units_len);
@@ -1895,7 +1742,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
png_debug1(3, "pCAL total length = %d", (int)total_len);
png_write_chunk_header(png_ptr, png_pCAL, (png_uint_32)total_len);
png_write_chunk_data(png_ptr, (png_const_bytep)new_purpose, purpose_len);
png_write_chunk_data(png_ptr, (png_const_bytep)purpose, purpose_len);
png_save_int_32(buf, X0);
png_save_int_32(buf + 4, X1);
buf[8] = (png_byte)type;
@@ -1903,8 +1750,6 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
png_write_chunk_data(png_ptr, buf, (png_size_t)10);
png_write_chunk_data(png_ptr, (png_const_bytep)units, (png_size_t)units_len);
png_free(png_ptr, new_purpose);
for (i = 0; i < nparams; i++)
{
png_write_chunk_data(png_ptr, (png_const_bytep)params[i], params_len[i]);
@@ -2429,20 +2274,9 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
png_uint_32 mins, bpp;
png_byte filter_to_do = png_ptr->do_filter;
png_size_t row_bytes = row_info->rowbytes;
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
int num_p_filters = png_ptr->num_prev_filters;
#endif
png_debug(1, "in png_write_find_filter");
#ifndef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if (png_ptr->row_number == 0 && filter_to_do == PNG_ALL_FILTERS)
{
/* These will never be selected so we need not test them. */
filter_to_do &= ~(PNG_FILTER_UP | PNG_FILTER_PAETH);
}
#endif
/* Find out how many bytes offset each pixel is */
bpp = (row_info->pixel_depth + 7) >> 3;
@@ -2494,44 +2328,6 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
sum += (v < 128) ? v : 256 - v;
}
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
png_uint_32 sumhi, sumlo;
int j;
sumlo = sum & PNG_LOMASK;
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; /* Gives us some footroom */
/* Reduce the sum if we match any of the previous rows */
for (j = 0; j < num_p_filters; j++)
{
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE)
{
sumlo = (sumlo * png_ptr->filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
sumhi = (sumhi * png_ptr->filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
}
}
/* Factor in the cost of this filter (this is here for completeness,
* but it makes no sense to have a "cost" for the NONE filter, as
* it has the minimum possible computational cost - none).
*/
sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >>
PNG_COST_SHIFT;
sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >>
PNG_COST_SHIFT;
if (sumhi > PNG_HIMASK)
sum = PNG_MAXSUM;
else
sum = (sumhi << PNG_HISHIFT) + sumlo;
}
#endif
mins = sum;
}
@@ -2564,44 +2360,6 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
png_size_t i;
int v;
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
/* We temporarily increase the "minimum sum" by the factor we
* would reduce the sum of this filter, so that we can do the
* early exit comparison without scaling the sum each time.
*/
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int j;
png_uint_32 lmhi, lmlo;
lmlo = lmins & PNG_LOMASK;
lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
for (j = 0; j < num_p_filters; j++)
{
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB)
{
lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
}
}
lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
PNG_COST_SHIFT;
lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
PNG_COST_SHIFT;
if (lmhi > PNG_HIMASK)
lmins = PNG_MAXSUM;
else
lmins = (lmhi << PNG_HISHIFT) + lmlo;
}
#endif
for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp;
i++, rp++, dp++)
{
@@ -2621,40 +2379,6 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
break;
}
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int j;
png_uint_32 sumhi, sumlo;
sumlo = sum & PNG_LOMASK;
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
for (j = 0; j < num_p_filters; j++)
{
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB)
{
sumlo = (sumlo * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
sumhi = (sumhi * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
}
}
sumlo = (sumlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
PNG_COST_SHIFT;
sumhi = (sumhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
PNG_COST_SHIFT;
if (sumhi > PNG_HIMASK)
sum = PNG_MAXSUM;
else
sum = (sumhi << PNG_HISHIFT) + sumlo;
}
#endif
if (sum < mins)
{
mins = sum;
@@ -2685,41 +2409,6 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
png_size_t i;
int v;
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int j;
png_uint_32 lmhi, lmlo;
lmlo = lmins & PNG_LOMASK;
lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
for (j = 0; j < num_p_filters; j++)
{
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP)
{
lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
}
}
lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >>
PNG_COST_SHIFT;
lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >>
PNG_COST_SHIFT;
if (lmhi > PNG_HIMASK)
lmins = PNG_MAXSUM;
else
lmins = (lmhi << PNG_HISHIFT) + lmlo;
}
#endif
for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1,
pp = prev_row + 1; i < row_bytes; i++)
{
@@ -2731,40 +2420,6 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
break;
}
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int j;
png_uint_32 sumhi, sumlo;
sumlo = sum & PNG_LOMASK;
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
for (j = 0; j < num_p_filters; j++)
{
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP)
{
sumlo = (sumlo * png_ptr->filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
sumhi = (sumhi * png_ptr->filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
}
}
sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >>
PNG_COST_SHIFT;
sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >>
PNG_COST_SHIFT;
if (sumhi > PNG_HIMASK)
sum = PNG_MAXSUM;
else
sum = (sumhi << PNG_HISHIFT) + sumlo;
}
#endif
if (sum < mins)
{
mins = sum;
@@ -2799,40 +2454,6 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
png_size_t i;
int v;
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int j;
png_uint_32 lmhi, lmlo;
lmlo = lmins & PNG_LOMASK;
lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
for (j = 0; j < num_p_filters; j++)
{
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_AVG)
{
lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
}
}
lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >>
PNG_COST_SHIFT;
lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >>
PNG_COST_SHIFT;
if (lmhi > PNG_HIMASK)
lmins = PNG_MAXSUM;
else
lmins = (lmhi << PNG_HISHIFT) + lmlo;
}
#endif
for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1,
pp = prev_row + 1; i < bpp; i++)
{
@@ -2852,40 +2473,6 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
break;
}
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int j;
png_uint_32 sumhi, sumlo;
sumlo = sum & PNG_LOMASK;
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
for (j = 0; j < num_p_filters; j++)
{
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE)
{
sumlo = (sumlo * png_ptr->filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
sumhi = (sumhi * png_ptr->filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
}
}
sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >>
PNG_COST_SHIFT;
sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >>
PNG_COST_SHIFT;
if (sumhi > PNG_HIMASK)
sum = PNG_MAXSUM;
else
sum = (sumhi << PNG_HISHIFT) + sumlo;
}
#endif
if (sum < mins)
{
mins = sum;
@@ -2940,40 +2527,6 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
png_size_t i;
int v;
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int j;
png_uint_32 lmhi, lmlo;
lmlo = lmins & PNG_LOMASK;
lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
for (j = 0; j < num_p_filters; j++)
{
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH)
{
lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
}
}
lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >>
PNG_COST_SHIFT;
lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >>
PNG_COST_SHIFT;
if (lmhi > PNG_HIMASK)
lmins = PNG_MAXSUM;
else
lmins = (lmhi << PNG_HISHIFT) + lmlo;
}
#endif
for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1,
pp = prev_row + 1; i < bpp; i++)
{
@@ -3027,40 +2580,6 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
break;
}
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
{
int j;
png_uint_32 sumhi, sumlo;
sumlo = sum & PNG_LOMASK;
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
for (j = 0; j < num_p_filters; j++)
{
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH)
{
sumlo = (sumlo * png_ptr->filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
sumhi = (sumhi * png_ptr->filter_weights[j]) >>
PNG_WEIGHT_SHIFT;
}
}
sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >>
PNG_COST_SHIFT;
sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >>
PNG_COST_SHIFT;
if (sumhi > PNG_HIMASK)
sum = PNG_MAXSUM;
else
sum = (sumhi << PNG_HISHIFT) + sumlo;
}
#endif
if (sum < mins)
{
best_row = png_ptr->paeth_row;
@@ -3070,26 +2589,8 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
/* Do the actual writing of the filtered row data from the chosen filter. */
png_write_filtered_row(png_ptr, best_row, row_info->rowbytes+1);
#ifdef PNG_WRITE_FILTER_SUPPORTED
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
/* Save the type of filter we picked this time for future calculations */
if (png_ptr->num_prev_filters > 0)
{
int j;
for (j = 1; j < num_p_filters; j++)
{
png_ptr->prev_filters[j] = png_ptr->prev_filters[j - 1];
}
png_ptr->prev_filters[j] = best_row[0];
}
#endif
#endif /* PNG_WRITE_FILTER_SUPPORTED */
}
/* Do the actual writing of a previously filtered row. */
static void
png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row,
+6 -3
View File
@@ -86,15 +86,16 @@ else()
endif()
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
-Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
-Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wmisleading-indentation)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4100 /wd4127 /wd4311 /wd4701 /wd4706) # vs2005
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267 /wd4305 /wd4306) # vs2008 Win64
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4703) # vs2012
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015
ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018)
ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018 /wd4311 /wd4312)
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
@@ -107,6 +108,8 @@ set_target_properties(${TIFF_LIBRARY}
PROPERTIES
OUTPUT_NAME "${TIFF_LIBRARY}"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME ${TIFF_LIBRARY}
COMPILE_PDB_NAME_DEBUG "${TIFF_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
)
@@ -115,5 +118,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${TIFF_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${TIFF_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
+2 -10
View File
@@ -54,7 +54,7 @@
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
(Intel) */
#define HOST_BIGENDIAN 0
#define HOST_BIGENDIAN @WORDS_BIGENDIAN@
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
#define HOST_FILLORDER FILLORDER_LSB2MSB
@@ -156,15 +156,7 @@
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
#cmakedefine WORDS_BIGENDIAN 1
/* Support Deflate compression */
#define ZIP_SUPPORT 1
+11 -2
View File
@@ -37,16 +37,23 @@ endif()
source_group("Include" FILES ${lib_hdrs} )
source_group("Src" FILES ${lib_srcs})
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra
-Wdeprecated-declarations -Wmisleading-indentation)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4245 /wd4305 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800) # vs2005
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4334) # vs2005 Win64
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # vs2008 Win64
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
if(MSVC AND CV_ICC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qrestrict")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Qrestrict")
endif()
add_library(IlmImf STATIC ${lib_hdrs} ${lib_srcs})
target_link_libraries(IlmImf ${ZLIB_LIBRARIES})
@@ -54,6 +61,8 @@ set_target_properties(IlmImf
PROPERTIES
OUTPUT_NAME "IlmImf"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME "IlmImf"
COMPILE_PDB_NAME_DEBUG "IlmImf${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
)
@@ -62,7 +71,7 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(IlmImf EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(IlmImf EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATHS} PARENT_SCOPE)
+2 -2
View File
@@ -14,8 +14,8 @@ libjpeg 8d (8.4) - The Independent JPEG Group's JPEG software.
HAVE_JPEG preprocessor flag must be set to make highgui use libjpeg.
On UNIX systems configure script takes care of it.
------------------------------------------------------------------------------------
libpng 1.5.12 - Portable Network Graphics library.
Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson.
libpng - Portable Network Graphics library.
The license and copyright notes can be found in libpng/LICENSE.
See libpng home page http://www.libpng.org
for details and links to the source code
+28 -20
View File
@@ -5,21 +5,26 @@ if (WIN32 AND NOT ARM)
message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
endif()
if (WIN32 AND ARM)
# 4.1 update 4 - The first release that supports Windows RT. Hangs on some Android devices
set(tbb_ver "tbb41_20130613oss")
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
set(tbb_version_file "version_string.ver")
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
else()
# 4.1 update 2 - works fine
set(tbb_ver "tbb41_20130116oss")
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
set(tbb_version_file "version_string.ver")
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
endif()
set(tbb_ver "tbb43_20141204oss")
set(tbb_url "http://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20141204oss_src.tgz")
set(tbb_md5 "e903dd92d9433701f097fa7ca29a3c1f")
set(tbb_version_file "version_string.ver")
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
# 4.1 update 4 - The first release that supports Windows RT. Hangs on some Android devices
#set(tbb_ver "tbb41_20130613oss")
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
#set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
#set(tbb_version_file "version_string.ver")
#ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
# 4.1 update 2 - works fine
#set(tbb_ver "tbb41_20130116oss")
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
#set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
#set(tbb_version_file "version_string.ver")
#ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
# 4.1 update 3 dev - Hangs on some Android devices
#set(tbb_ver "tbb41_20130401oss")
@@ -113,7 +118,7 @@ if(NOT EXISTS "${tbb_tarball}")
message(STATUS "Downloading ${tbb_ver}_src.tgz")
file(DOWNLOAD "${tbb_url}" "${tbb_tarball}" TIMEOUT 600 STATUS __statvar)
if(NOT __statvar EQUAL 0)
message(FATAL_ERROR "Failed to download TBB sources: ${tbb_url}")
message(FATAL_ERROR "Failed to download TBB sources (${__statvar}): ${tbb_url}")
endif()
getMD5("${tbb_tarball}" tbb_local_md5)
if(NOT tbb_local_md5 STREQUAL tbb_md5)
@@ -169,6 +174,7 @@ if (WIN32)
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} /APPCONTAINER")
else()
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
-D__TBB_WEAK_SYMBOLS_PRESENT=0 #required for 4.3
-D__TBB_BUILD=1 #required
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
-DTBB_USE_DEBUG=0 #just to be sure
@@ -198,7 +204,7 @@ endif()
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
if (ARM AND NOT WIN32)
if ((ARM OR AARCH64) AND NOT WIN32)
if (NOT ANDROID)
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
endif()
@@ -239,6 +245,8 @@ endif()
set_target_properties(tbb
PROPERTIES OUTPUT_NAME tbb
DEBUG_POSTFIX "${tbb_debug_postfix}"
COMPILE_PDB_NAME tbb
COMPILE_PDB_NAME_DEBUG "tbb${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
)
@@ -248,9 +256,9 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
ocv_install_target(tbb EXPORT OpenCVModules
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs
ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev
)
# get TBB version
+4 -2
View File
@@ -82,11 +82,13 @@ if(UNIX)
endif()
endif()
ocv_warnings_disable(CMAKE_C_FLAGS -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations)
ocv_warnings_disable(CMAKE_C_FLAGS -Wshorten-64-to-32 -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshift-negative-value)
set_target_properties(${ZLIB_LIBRARY} PROPERTIES
OUTPUT_NAME ${ZLIB_LIBRARY}
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME ${ZLIB_LIBRARY}
COMPILE_PDB_NAME_DEBUG "${ZLIB_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
)
@@ -95,5 +97,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${ZLIB_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${ZLIB_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
+178 -43
View File
@@ -47,12 +47,24 @@ if(POLICY CMP0022)
cmake_policy(SET CMP0022 OLD)
endif()
if(POLICY CMP0026)
# silence cmake 3.0+ warnings about reading LOCATION attribute
cmake_policy(SET CMP0026 OLD)
endif()
if (POLICY CMP0042)
# silence cmake 3.0+ warnings about MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
# must go before the project command
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
if(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
endif()
enable_testing()
project(OpenCV CXX C)
if(MSVC)
@@ -61,6 +73,8 @@ endif()
include(cmake/OpenCVUtils.cmake)
ocv_cmake_eval(DEBUG_PRE ONCE)
ocv_clear_vars(OpenCVModules_TARGETS)
# ----------------------------------------------------------------------------
@@ -125,30 +139,33 @@ endif()
# Optional 3rd party components
# ===================================================
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O" ON IF IOS)
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O (iOS/Mac)" ON IF APPLE)
OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa" OFF IF APPLE )
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
OCV_OPTION(WITH_VTK "Include VTK library support (and build opencv_viz module eiher)" OFF IF (NOT ANDROID AND NOT IOS AND NOT CMAKE_CROSSCOMPILING) )
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) )
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) )
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF WIN32 )
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS))
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT ANDROID) )
OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF )
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_IMAGEIO "ImageIO support for OS X" OFF IF APPLE )
OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (MSVC OR X86 OR X86_64) )
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
OCV_OPTION(WITH_JPEG "Include JPEG support" ON)
OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS) )
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT APPLE) )
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID) )
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_PNG "Include PNG support" ON)
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF WIN32 )
OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE )
OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O" OFF IF APPLE )
OCV_OPTION(WITH_QTKIT "Use QTKit Video I/O backend" OFF IF APPLE )
OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) )
OCV_OPTION(WITH_OPENMP "Include OpenMP support" OFF)
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF WIN32 )
@@ -158,7 +175,7 @@ OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON
OCV_OPTION(WITH_LIBV4L "Use libv4l for Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF (WIN32 AND NOT ARM) )
OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) )
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID) )
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT IOS) )
OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS) )
@@ -180,6 +197,7 @@ OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for sta
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(BUILD_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID AND ANDROID_SOURCE_TREE )
OCV_OPTION(BUILD_ANDROID_PACKAGE "Build platform-specific package for Google Play" OFF IF ANDROID )
OCV_OPTION(BUILD_TINY_GPU_MODULE "Build tiny gpu module with limited image format support" OFF )
# 3rd party libs
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE )
@@ -197,14 +215,16 @@ OCV_OPTION(INSTALL_C_EXAMPLES "Install C examples" OFF )
OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help with side by side installs." OFF IF (UNIX AND NOT ANDROID AND NOT IOS AND BUILD_SHARED_LIBS) )
OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binaries and test data" OFF)
# OpenCV build options
# ===================================================
OCV_OPTION(ENABLE_CCACHE "Use ccache" (UNIX AND NOT IOS AND (CMAKE_GENERATOR MATCHES "Makefile" OR CMAKE_GENERATOR MATCHES "Ninja")) )
OCV_OPTION(ENABLE_DYNAMIC_CUDA "Enabled dynamic CUDA linkage" ON IF ANDROID )
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS) )
OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) IF (CMAKE_VERSION VERSION_GREATER "2.8.0") )
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_COVERAGE "Enable coverage collection with GCov" OFF IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX) )
OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
@@ -215,12 +235,17 @@ OCV_OPTION(ENABLE_SSSE3 "Enable SSSE3 instructions"
OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF IF ((CV_ICC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM )
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM )
OCV_OPTION(ENABLE_AVX2 "Enable AVX2 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64))
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64))
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
OCV_OPTION(ENABLE_WINRT_MODE "Build with Windows Runtime support" OFF IF WIN32 )
OCV_OPTION(ENABLE_WINRT_MODE_NATIVE "Build with Windows Runtime native C++ support" OFF IF WIN32 )
OCV_OPTION(ENABLE_LIBVS2013 "Build VS2013 with Visual Studio 2013 libraries" OFF IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
OCV_OPTION(ENABLE_WINSDK81 "Build VS2013 with Windows 8.1 SDK" OFF IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
OCV_OPTION(ENABLE_WINPHONESDK80 "Build with Windows Phone 8.0 SDK" OFF IF WIN32 AND (MSVC_VERSION EQUAL 1700) )
OCV_OPTION(ENABLE_WINPHONESDK81 "Build VS2013 with Windows Phone 8.1 SDK" OFF IF WIN32 AND (MSVC_VERSION EQUAL 1800) )
# uncategorized options
# ===================================================
@@ -253,12 +278,14 @@ if (ANDROID)
endif()
endif()
if(ANDROID OR WIN32)
set(OPENCV_DOC_INSTALL_PATH doc)
elseif(INSTALL_TO_MANGLED_PATHS)
set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc)
else()
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
if(NOT DEFINED OPENCV_DOC_INSTALL_PATH)
if(ANDROID OR WIN32)
set(OPENCV_DOC_INSTALL_PATH doc)
elseif(INSTALL_TO_MANGLED_PATHS)
set(OPENCV_DOC_INSTALL_PATH share/OpenCV-${OPENCV_VERSION}/doc)
else()
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
endif()
endif()
if(WIN32)
@@ -268,13 +295,27 @@ if(WIN32)
message(STATUS "Can't detect runtime and/or arch")
set(OpenCV_INSTALL_BINARIES_PREFIX "")
endif()
elseif(ANDROID)
set(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/")
else()
set(OpenCV_INSTALL_BINARIES_PREFIX "")
endif()
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
if(ANDROID)
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/${ANDROID_NDK_ABI_NAME}")
else()
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
endif()
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
if(ANDROID)
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/${ANDROID_NDK_ABI_NAME}")
else()
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
endif()
if(NOT OPENCV_TEST_INSTALL_PATH)
set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
endif()
if(ANDROID)
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
@@ -283,6 +324,7 @@ if(ANDROID)
set(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
set(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
else()
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
@@ -293,9 +335,11 @@ else()
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
endif()
set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
else()
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples)
endif()
set(OPENCV_INCLUDE_INSTALL_PATH "include")
@@ -405,16 +449,14 @@ endif(WIN32 AND NOT MINGW)
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
# ----------------------------------------------------------------------------
if(UNIX)
include(cmake/OpenCVFindPkgConfig.cmake OPTIONAL)
include(CheckFunctionExists)
include(CheckIncludeFile)
if(NOT APPLE)
CHECK_INCLUDE_FILE(pthread.h HAVE_LIBPTHREAD)
if(ANDROID)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly")
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m)
else()
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
endif()
@@ -426,6 +468,19 @@ endif()
include(cmake/OpenCVPCHSupport.cmake)
include(cmake/OpenCVModule.cmake)
# ----------------------------------------------------------------------------
# Detect endianness of build platform
# ----------------------------------------------------------------------------
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
# test_big_endian needs try_compile, which doesn't work for iOS
# http://public.kitware.com/Bug/view.php?id=12288
set(WORDS_BIGENDIAN 0)
else()
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
endif()
# ----------------------------------------------------------------------------
# Detect 3rd-party libraries
# ----------------------------------------------------------------------------
@@ -435,14 +490,18 @@ include(cmake/OpenCVFindLibsGUI.cmake)
include(cmake/OpenCVFindLibsVideo.cmake)
include(cmake/OpenCVFindLibsPerf.cmake)
# ----------------------------------------------------------------------------
# Detect other 3rd-party libraries/tools
# ----------------------------------------------------------------------------
# --- LATEX for pdf documentation ---
unset(HAVE_DOXYGEN CACHE)
if(BUILD_DOCS)
include(cmake/OpenCVFindLATEX.cmake)
find_host_program(DOXYGEN_BUILD doxygen)
if (DOXYGEN_BUILD)
set(HAVE_DOXYGEN 1)
endif (DOXYGEN_BUILD)
endif(BUILD_DOCS)
# --- Python Support ---
@@ -471,6 +530,9 @@ if(WITH_OPENCL)
include(cmake/OpenCVDetectOpenCL.cmake)
endif()
# --- VTK support ---
include(cmake/OpenCVDetectVTK.cmake)
# ----------------------------------------------------------------------------
# Add CUDA libraries (needed for apps/tools, samples)
# ----------------------------------------------------------------------------
@@ -558,6 +620,61 @@ include(cmake/OpenCVGenConfig.cmake)
# Generate Info.plist for the IOS framework
include(cmake/OpenCVGenInfoPlist.cmake)
# Generate environment setup file
if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
if(ANDROID)
get_filename_component(TEST_PATH ${OPENCV_TEST_INSTALL_PATH} DIRECTORY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_android.sh.in"
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
DESTINATION . COMPONENT tests)
elseif(WIN32 OR UNIX)
set(OPENCV_PYTHON_TESTS_LIST "")
if(BUILD_opencv_python)
file(GLOB py_tests modules/python/test/*.py)
install(PROGRAMS ${py_tests} DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
if(BUILD_opencv_nonfree)
file(GLOB py_nonfree_tests modules/python/test/nonfree_tests/*.py)
install(PROGRAMS ${py_nonfree_tests} DESTINATION ${OPENCV_TEST_INSTALL_PATH}/nonfree_tests COMPONENT tests)
endif()
set(OPENCV_PYTHON_TESTS_LIST "test.py")
endif()
if(WIN32)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_windows.cmd.in"
"${CMAKE_BINARY_DIR}/win-install/opencv_run_all_tests.cmd" @ONLY)
install(PROGRAMS "${CMAKE_BINARY_DIR}/win-install/opencv_run_all_tests.cmd"
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
else()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_unix.sh.in"
"${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
endif()
endif()
endif()
if(NOT OPENCV_README_FILE)
if(ANDROID)
set(OPENCV_README_FILE ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/README.android)
endif()
endif()
if(NOT OPENCV_LICENSE_FILE)
set(OPENCV_LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
endif()
# for UNIX it does not make sense as LICENSE and readme will be part of the package automatically
if(ANDROID OR NOT UNIX)
install(FILES ${OPENCV_LICENSE_FILE}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
DESTINATION . COMPONENT libs)
if(OPENCV_README_FILE)
install(FILES ${OPENCV_README_FILE}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
DESTINATION . COMPONENT libs)
endif()
endif()
# ----------------------------------------------------------------------------
# Summary:
# ----------------------------------------------------------------------------
@@ -615,6 +732,7 @@ else()
status(" Linker flags (Release):" ${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_RELEASE})
status(" Linker flags (Debug):" ${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_DEBUG})
endif()
status(" ccache:" CMAKE_COMPILER_IS_CCACHE THEN YES ELSE NO)
status(" Precompiled headers:" PCHSupport_FOUND AND ENABLE_PRECOMPILED_HEADERS THEN YES ELSE NO)
# ========================== OpenCV modules ==========================
@@ -668,8 +786,8 @@ if(WIN32)
status("")
status(" Windows RT support:" HAVE_WINRT THEN YES ELSE NO)
if (ENABLE_WINRT_MODE OR ENABLE_WINRT_MODE_NATIVE)
status(" Windows SDK v8.0:" ${WINDOWS_SDK_PATH})
status(" Visual Studio 2012:" ${VISUAL_STUDIO_PATH})
status(" Windows (Phone) SDK v8.0/v8.1:" ${WINDOWS_SDK_PATH})
status(" Visual Studio 2012/2013:" ${VISUAL_STUDIO_PATH})
endif()
endif(WIN32)
@@ -705,6 +823,7 @@ else()
endif()
status(" OpenGL support:" HAVE_OPENGL THEN "YES (${OPENGL_LIBRARIES})" ELSE NO)
status(" VTK support:" HAVE_VTK THEN "YES (ver ${VTK_VERSION})" ELSE NO)
# ========================== MEDIA IO ==========================
status("")
@@ -763,30 +882,28 @@ if(ANDROID)
endif()
endif()
if(DEFINED WITH_AVFOUNDATION)
status(" AVFoundation:" WITH_AVFOUNDATION THEN YES ELSE NO)
endif(DEFINED WITH_AVFOUNDATION)
if(DEFINED WITH_FFMPEG)
if(DEFINED WITH_FFMPEG OR HAVE_FFMPEG)
if(WIN32)
status(" FFMPEG:" WITH_FFMPEG THEN "YES (prebuilt binaries)" ELSE NO)
else()
status(" FFMPEG:" HAVE_FFMPEG THEN YES ELSE NO)
endif()
status(" codec:" HAVE_FFMPEG_CODEC THEN "YES (ver ${ALIASOF_libavcodec_VERSION})" ELSE NO)
status(" format:" HAVE_FFMPEG_FORMAT THEN "YES (ver ${ALIASOF_libavformat_VERSION})" ELSE NO)
status(" util:" HAVE_FFMPEG_UTIL THEN "YES (ver ${ALIASOF_libavutil_VERSION})" ELSE NO)
status(" swscale:" HAVE_FFMPEG_SWSCALE THEN "YES (ver ${ALIASOF_libswscale_VERSION})" ELSE NO)
status(" gentoo-style:" HAVE_GENTOO_FFMPEG THEN YES ELSE NO)
endif(DEFINED WITH_FFMPEG)
status(" avcodec:" FFMPEG_libavcodec_FOUND THEN "YES (ver ${FFMPEG_libavcodec_VERSION})" ELSE NO)
status(" avformat:" FFMPEG_libavformat_FOUND THEN "YES (ver ${FFMPEG_libavformat_VERSION})" ELSE NO)
status(" avutil:" FFMPEG_libavutil_FOUND THEN "YES (ver ${FFMPEG_libavutil_VERSION})" ELSE NO)
status(" swscale:" FFMPEG_libswscale_FOUND THEN "YES (ver ${FFMPEG_libswscale_VERSION})" ELSE NO)
status(" avresample:" FFMPEG_libavresample_FOUND THEN "YES (ver ${FFMPEG_libavresample_VERSION})" ELSE NO)
endif()
if(DEFINED WITH_GSTREAMER)
status(" GStreamer:" HAVE_GSTREAMER THEN "" ELSE NO)
if(HAVE_GSTREAMER)
status(" base:" "YES (ver ${ALIASOF_gstreamer-base-0.10_VERSION})")
status(" app:" "YES (ver ${ALIASOF_gstreamer-app-0.10_VERSION})")
status(" video:" "YES (ver ${ALIASOF_gstreamer-video-0.10_VERSION})")
endif()
status(" base:" "YES (ver ${GSTREAMER_BASE_VERSION})")
status(" video:" "YES (ver ${GSTREAMER_VIDEO_VERSION})")
status(" app:" "YES (ver ${GSTREAMER_APP_VERSION})")
status(" riff:" "YES (ver ${GSTREAMER_RIFF_VERSION})")
status(" pbutils:" "YES (ver ${GSTREAMER_PBUTILS_VERSION})")
endif(HAVE_GSTREAMER)
endif(DEFINED WITH_GSTREAMER)
if(DEFINED WITH_OPENNI)
@@ -804,10 +921,15 @@ if(DEFINED WITH_GIGEAPI)
status(" GigEVisionSDK:" HAVE_GIGE_API THEN YES ELSE NO)
endif(DEFINED WITH_GIGEAPI)
if(DEFINED WITH_QUICKTIME)
if(DEFINED APPLE)
status(" AVFoundation:" HAVE_AVFOUNDATION THEN YES ELSE NO)
if(WITH_QUICKTIME OR HAVE_QUICKTIME)
status(" QuickTime:" HAVE_QUICKTIME THEN YES ELSE NO)
status(" QTKit:" HAVE_QTKIT THEN YES ELSE NO)
endif(DEFINED WITH_QUICKTIME)
endif()
if(WITH_QTKIT OR HAVE_QTKIT)
status(" QTKit:" HAVE_QTKIT THEN "YES (deprecated)" ELSE NO)
endif()
endif(DEFINED APPLE)
if(DEFINED WITH_UNICAP)
status(" UniCap:" HAVE_UNICAP THEN "YES (ver ${ALIASOF_libunicap_VERSION})" ELSE NO)
@@ -827,8 +949,9 @@ if(DEFINED WITH_V4L)
else()
set(HAVE_CAMV4L2_STR "NO")
endif()
status(" V4L/V4L2:" HAVE_LIBV4L THEN "Using libv4l (ver ${ALIASOF_libv4l1_VERSION})"
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
status(" V4L/V4L2:" HAVE_LIBV4L
THEN "Using libv4l1 (ver ${ALIASOF_libv4l1_VERSION}) / libv4l2 (ver ${ALIASOF_libv4l2_VERSION})"
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
endif(DEFINED WITH_V4L)
if(DEFINED WITH_DSHOW)
@@ -882,6 +1005,7 @@ if(HAVE_CUDA)
status(" NVIDIA GPU arch:" ${OPENCV_CUDA_ARCH_BIN})
status(" NVIDIA PTX archs:" ${OPENCV_CUDA_ARCH_PTX})
status(" Use fast math:" CUDA_FAST_MATH THEN YES ELSE NO)
status(" Tiny gpu module:" BUILD_TINY_GPU_MODULE THEN YES ELSE NO)
endif()
if(HAVE_OPENCL)
@@ -950,6 +1074,7 @@ if(BUILD_DOCS)
endif()
status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO)
status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO)
status(" Doxygen:" HAVE_DOXYGEN THEN "YES (${DOXYGEN_BUILD})" ELSE NO)
endif()
# ========================== samples and tests ==========================
@@ -975,3 +1100,13 @@ ocv_finalize_status()
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
message(WARNING "The source directory is the same as binary directory. \"make clean\" may damage the source tree")
endif()
# ----------------------------------------------------------------------------
# CPack stuff
# ----------------------------------------------------------------------------
include(cmake/OpenCVPackaging.cmake)
# This should be the last command
ocv_cmake_dump_vars("" TOFILE "CMakeVars.txt")
ocv_cmake_eval(DEBUG_POST ONCE)
+3
View File
@@ -0,0 +1,3 @@
## Contributing guidelines
All guidelines for contributing to the OpenCV repository can be found at [`How to contribute guideline`](https://github.com/opencv/opencv/wiki/How_to_contribute).
+8 -12
View File
@@ -1,16 +1,11 @@
IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
By downloading, copying, installing or using the software you agree to this license.
If you do not agree to this license, do not download, install,
copy or use the software.
By downloading, copying, installing or using the software you agree to this license.
If you do not agree to this license, do not download, install,
copy or use the software.
License Agreement
For Open Source Computer Vision Library
Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
Third party copyrights are property of their respective owners.
(3-clause BSD License)
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -22,13 +17,14 @@ are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the copyright holders may not be used to endorse or promote products
derived from this software without specific prior written permission.
* Neither the names of the copyright holders nor the names of the contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
This software is provided by the copyright holders and contributors "as is" and
any express or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose are disclaimed.
In no event shall the Intel Corporation or contributors be liable for any direct,
In no event shall copyright holders or contributors be liable for any direct,
indirect, incidental, special, exemplary, or consequential damages
(including, but not limited to, procurement of substitute goods or services;
loss of use, data, or profits; or business interruption) however caused
+3 -6
View File
@@ -3,13 +3,13 @@
#### Resources
* Homepage: <http://opencv.org>
* Docs: <http://docs.opencv.org>
* Docs: <http://docs.opencv.org/2.4/>
* Q&A forum: <http://answers.opencv.org>
* Issue tracking: <http://code.opencv.org>
* Issue tracking: <https://github.com/opencv/opencv/issues>
#### Contributing
Please read before starting work on a pull request: <http://code.opencv.org/projects/opencv/wiki/How_to_contribute>
Please read before starting work on a pull request: <https://github.com/opencv/opencv/wiki/How_to_contribute>
Summary of guidelines:
@@ -18,6 +18,3 @@ Summary of guidelines:
* Include tests and documentation;
* Clean up "oops" commits before submitting;
* Follow the coding style guide.
[![Donate OpenCV project](http://opencv.org/wp-content/uploads/2013/07/gittip1.png)](https://www.gittip.com/OpenCV/)
[![Donate OpenCV project](http://opencv.org/wp-content/uploads/2013/07/paypal-donate-button.png)](https://www.paypal.com/cgi-bin/webscr?item_name=Donation+to+OpenCV&cmd=_donations&business=accountant%40opencv.org)
+3
View File
@@ -2,3 +2,6 @@ link_libraries(${OPENCV_LINKER_LIBS})
add_subdirectory(haartraining)
add_subdirectory(traincascade)
add_subdirectory(annotation)
add_subdirectory(visualisation)
add_subdirectory(version)
+35
View File
@@ -0,0 +1,35 @@
SET(OPENCV_ANNOTATION_DEPS opencv_core opencv_highgui opencv_imgproc)
ocv_check_dependencies(${OPENCV_ANNOTATION_DEPS})
if(NOT OCV_DEPENDENCIES_FOUND)
return()
endif()
project(annotation)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_ANNOTATION_DEPS})
set(annotation_files opencv_annotation.cpp)
set(the_target opencv_annotation)
add_executable(${the_target} ${annotation_files})
target_link_libraries(${the_target} ${OPENCV_ANNOTATION_DEPS})
set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
OUTPUT_NAME "opencv_annotation")
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_target} PROPERTIES FOLDER "applications")
endif()
if(INSTALL_CREATE_DISTRIB)
if(BUILD_SHARED_LIBS)
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
endif()
else()
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
endif()
+319
View File
@@ -0,0 +1,319 @@
////////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
////////////////////////////////////////////////////////////////////////////////////////
/*****************************************************************************************************
USAGE:
./opencv_annotation -images <folder location> -annotations <ouput file>
Created by: Puttemans Steven - February 2015
Adapted by: Puttemans Steven - April 2016 - Vectorize the process to enable better processing
+ early leave and store by pressing an ESC key
+ enable delete `d` button, to remove last annotation
*****************************************************************************************************/
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <fstream>
#include <iostream>
#if defined(_WIN32)
#include <direct.h>
#else
#include <sys/stat.h>
#endif
using namespace std;
using namespace cv;
// Function prototypes
void on_mouse(int, int, int, int, void*);
vector<Rect> get_annotations(Mat);
// Public parameters
Mat image;
int roi_x0 = 0, roi_y0 = 0, roi_x1 = 0, roi_y1 = 0, num_of_rec = 0;
bool start_draw = false, stop = false;
// Window name for visualisation purposes
const string window_name = "OpenCV Based Annotation Tool";
// FUNCTION : Mouse response for selecting objects in images
// If left button is clicked, start drawing a rectangle as long as mouse moves
// Stop drawing once a new left click is detected by the on_mouse function
void on_mouse(int event, int x, int y, int , void * )
{
// Action when left button is clicked
if(event == EVENT_LBUTTONDOWN)
{
if(!start_draw)
{
roi_x0 = x;
roi_y0 = y;
start_draw = true;
} else {
roi_x1 = x;
roi_y1 = y;
start_draw = false;
}
}
// Action when mouse is moving and drawing is enabled
if((event == EVENT_MOUSEMOVE) && start_draw)
{
// Redraw bounding box for annotation
Mat current_view;
image.copyTo(current_view);
rectangle(current_view, Point(roi_x0,roi_y0), Point(x,y), Scalar(0,0,255));
imshow(window_name, current_view);
}
}
// FUNCTION : returns a vector of Rect objects given an image containing positive object instances
vector<Rect> get_annotations(Mat input_image)
{
vector<Rect> current_annotations;
// Make it possible to exit the annotation process
stop = false;
// Init window interface and couple mouse actions
namedWindow(window_name, WINDOW_AUTOSIZE);
setMouseCallback(window_name, on_mouse);
image = input_image;
imshow(window_name, image);
int key_pressed = 0;
do
{
// Get a temporary image clone
Mat temp_image = input_image.clone();
Rect currentRect(0, 0, 0, 0);
// Keys for processing
// You need to select one for confirming a selection and one to continue to the next image
// Based on the universal ASCII code of the keystroke: http://www.asciitable.com/
// <c> = 99 add rectangle to current image
// <n> = 110 save added rectangles and show next image
// <d> = 100 delete the last annotation made
// <ESC> = 27 exit program
key_pressed = 0xFF & waitKey(0);
switch( key_pressed )
{
case 27:
destroyWindow(window_name);
stop = true;
break;
case 99:
// Draw initiated from top left corner
if(roi_x0<roi_x1 && roi_y0<roi_y1)
{
currentRect.x = roi_x0;
currentRect.y = roi_y0;
currentRect.width = roi_x1-roi_x0;
currentRect.height = roi_y1-roi_y0;
}
// Draw initiated from bottom right corner
if(roi_x0>roi_x1 && roi_y0>roi_y1)
{
currentRect.x = roi_x1;
currentRect.y = roi_y1;
currentRect.width = roi_x0-roi_x1;
currentRect.height = roi_y0-roi_y1;
}
// Draw initiated from top right corner
if(roi_x0>roi_x1 && roi_y0<roi_y1)
{
currentRect.x = roi_x1;
currentRect.y = roi_y0;
currentRect.width = roi_x0-roi_x1;
currentRect.height = roi_y1-roi_y0;
}
// Draw initiated from bottom left corner
if(roi_x0<roi_x1 && roi_y0>roi_y1)
{
currentRect.x = roi_x0;
currentRect.y = roi_y1;
currentRect.width = roi_x1-roi_x0;
currentRect.height = roi_y0-roi_y1;
}
// Draw the rectangle on the canvas
// Add the rectangle to the vector of annotations
current_annotations.push_back(currentRect);
break;
case 100:
// Remove the last annotation
if(current_annotations.size() > 0){
current_annotations.pop_back();
}
break;
default:
// Default case --> do nothing at all
// Other keystrokes can simply be ignored
break;
}
// Check if escape has been pressed
if(stop)
{
break;
}
// Draw all the current rectangles onto the top image and make sure that the global image is linked
for(int i=0; i < (int)current_annotations.size(); i++){
rectangle(temp_image, current_annotations[i], Scalar(0,255,0), 1);
}
image = temp_image;
// Force an explicit redraw of the canvas --> necessary to visualize delete correctly
imshow(window_name, image);
}
// Continue as long as the next image key has not been pressed
while(key_pressed != 110);
// Close down the window
destroyWindow(window_name);
// Return the data
return current_annotations;
}
int main( int argc, const char** argv )
{
// If no arguments are given, then supply some information on how this tool works
if( argc == 1 ){
cout << "Usage: " << argv[0] << endl;
cout << " -images <folder_location> [example - /data/testimages/]" << endl;
cout << " -annotations <ouput_file> [example - /data/annotations.txt]" << endl;
cout << "TIP: Use absolute paths to avoid any problems with the software!" << endl;
return -1;
}
// Read in the input arguments
string image_folder;
string annotations_file;
for(int i = 1; i < argc; ++i )
{
if( !strcmp( argv[i], "-images" ) )
{
image_folder = argv[++i];
}
else if( !strcmp( argv[i], "-annotations" ) )
{
annotations_file = argv[++i];
}
}
// Check if the folder actually exists
// If -1 is returned then the folder actually exists, and thus you can continue
// In all other cases there was a folder creation and thus the folder did not exist
#if defined(_WIN32)
if(_mkdir(image_folder.c_str()) != -1){
// Generate an error message
cerr << "The image folder given does not exist. Please check again!" << endl;
// Remove the created folder again, to ensure a second run with same code fails again
_rmdir(image_folder.c_str());
return 0;
}
#else
if(mkdir(image_folder.c_str(), 0777) != -1){
// Generate an error message
cerr << "The image folder given does not exist. Please check again!" << endl;
// Remove the created folder again, to ensure a second run with same code fails again
remove(image_folder.c_str());
return 0;
}
#endif
// Start by processing the data
// Return the image filenames inside the image folder
vector< vector<Rect> > annotations;
vector<String> filenames;
String folder(image_folder);
glob(folder, filenames);
// Loop through each image stored in the images folder
// Create and temporarily store the annotations
// At the end write everything to the annotations file
for (size_t i = 0; i < filenames.size(); i++){
// Read in an image
Mat current_image = imread(filenames[i]);
// Check if the image is actually read - avoid other files in the folder, because glob() takes them all
// If not then simply skip this iteration
if(current_image.empty()){
continue;
}
// Perform annotations & store the result inside the vectorized structure
vector<Rect> current_annotations = get_annotations(current_image);
annotations.push_back(current_annotations);
// Check if the ESC key was hit, then exit earlier then expected
if(stop){
break;
}
}
// When all data is processed, store the data gathered inside the proper file
// This now even gets called when the ESC button was hit to store preliminary results
ofstream output(annotations_file.c_str());
if ( !output.is_open() ){
cerr << "The path for the output file contains an error and could not be opened. Please check again!" << endl;
return 0;
}
// Store the annotations, write to the output file
for(int i = 0; i < (int)annotations.size(); i++){
output << filenames[i] << " " << annotations[i].size();
for(int j=0; j < (int)annotations[i].size(); j++){
Rect temp = annotations[i][j];
output << " " << temp.x << " " << temp.y << " " << temp.width << " " << temp.height;
}
output << endl;
}
return 0;
}
+15 -9
View File
@@ -10,12 +10,12 @@ project(haartraining)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_HAARTRAINING_DEPS})
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wunused-private-field)
if(WIN32)
link_directories(${CMAKE_CURRENT_BINARY_DIR})
endif()
link_libraries(${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
# -----------------------------------------------------------
# Library
# -----------------------------------------------------------
@@ -29,14 +29,17 @@ set(cvhaartraining_lib_src
cvhaarclassifier.cpp
cvhaartraining.cpp
cvsamples.cpp
cvsamplesoutput.cpp
cvsamplesoutput.h
ioutput.h
)
add_library(opencv_haartraining_engine STATIC ${cvhaartraining_lib_src})
target_link_libraries(opencv_haartraining_engine ${OPENCV_HAARTRAINING_DEPS})
set_target_properties(opencv_haartraining_engine PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
INSTALL_NAME_DIR lib
)
# -----------------------------------------------------------
@@ -44,6 +47,7 @@ set_target_properties(opencv_haartraining_engine PROPERTIES
# -----------------------------------------------------------
add_executable(opencv_haartraining cvhaartraining.h haartraining.cpp)
target_link_libraries(opencv_haartraining ${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
set_target_properties(opencv_haartraining PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
OUTPUT_NAME "opencv_haartraining")
@@ -53,6 +57,7 @@ set_target_properties(opencv_haartraining PROPERTIES
# -----------------------------------------------------------
add_executable(opencv_createsamples cvhaartraining.h createsamples.cpp)
target_link_libraries(opencv_createsamples ${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
set_target_properties(opencv_createsamples PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
OUTPUT_NAME "opencv_createsamples")
@@ -61,6 +66,7 @@ set_target_properties(opencv_createsamples PROPERTIES
# performance
# -----------------------------------------------------------
add_executable(opencv_performance performance.cpp)
target_link_libraries(opencv_performance ${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
set_target_properties(opencv_performance PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
OUTPUT_NAME "opencv_performance")
@@ -71,14 +77,14 @@ set_target_properties(opencv_performance PROPERTIES
if(INSTALL_CREATE_DISTRIB)
if(BUILD_SHARED_LIBS)
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
endif()
else()
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
endif()
if(ENABLE_SOLUTION_FOLDERS)
+39 -11
View File
@@ -50,10 +50,17 @@
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <memory>
// std::auto_ptr
#if defined(__GNUC__) && __GNUC__ >= 6
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
using namespace std;
#include "cvhaartraining.h"
#include "ioutput.h"
int main( int argc, char* argv[] )
{
@@ -71,11 +78,12 @@ int main( int argc, char* argv[] )
double maxxangle = 1.1;
double maxyangle = 1.1;
double maxzangle = 0.5;
int showsamples = 0;
bool showsamples = false;
/* the samples are adjusted to this scale in the sample preview window */
double scale = 4.0;
int width = 24;
int height = 24;
bool pngoutput = false; /* whether to make the samples in png or in jpg*/
srand((unsigned int)time(0));
@@ -92,7 +100,8 @@ int main( int argc, char* argv[] )
" [-maxyangle <max_y_rotation_angle = %f>]\n"
" [-maxzangle <max_z_rotation_angle = %f>]\n"
" [-show [<scale = %f>]]\n"
" [-w <sample_width = %d>]\n [-h <sample_height = %d>]\n",
" [-w <sample_width = %d>]\n [-h <sample_height = %d>]\n"
" [-pngoutput]",
argv[0], num, bgcolor, bgthreshold, maxintensitydev,
maxxangle, maxyangle, maxzangle, scale, width, height );
@@ -155,7 +164,7 @@ int main( int argc, char* argv[] )
}
else if( !strcmp( argv[i], "-show" ) )
{
showsamples = 1;
showsamples = true;
if( i+1 < argc && strlen( argv[i+1] ) > 0 && argv[i+1][0] != '-' )
{
double d;
@@ -172,6 +181,10 @@ int main( int argc, char* argv[] )
{
height = atoi( argv[++i] );
}
else if( !strcmp( argv[i], "-pngoutput" ) )
{
pngoutput = true;
}
}
printf( "Info file name: %s\n", ((infoname == NULL) ? nullname : infoname ) );
@@ -190,10 +203,14 @@ int main( int argc, char* argv[] )
printf( "Show samples: %s\n", (showsamples) ? "TRUE" : "FALSE" );
if( showsamples )
{
printf( "Scale: %g\n", scale );
printf( "Scale applied to display : %g\n", scale );
}
if( !pngoutput)
{
printf( "Original image will be scaled to:\n");
printf( "\tWidth: $backgroundWidth / %d\n", width );
printf( "\tHeight: $backgroundHeight / %d\n", height );
}
printf( "Width: %d\n", width );
printf( "Height: %d\n", height );
/* determine action */
if( imagename && vecname )
@@ -207,13 +224,24 @@ int main( int argc, char* argv[] )
printf( "Done\n" );
}
else if( imagename && bgfilename && infoname )
else if( imagename && bgfilename && infoname)
{
printf( "Create test samples from single image applying distortions...\n" );
printf( "Create data set from single image applying distortions...\n"
"Output format: %s\n",
(( pngoutput ) ? "PNG" : "JPG") );
cvCreateTestSamples( infoname, imagename, bgcolor, bgthreshold, bgfilename, num,
invert, maxintensitydev,
maxxangle, maxyangle, maxzangle, showsamples, width, height );
std::auto_ptr<DatasetGenerator> creator;
if( pngoutput )
{
creator = std::auto_ptr<DatasetGenerator>( new PngDatasetGenerator( infoname ) );
}
else
{
creator = std::auto_ptr<DatasetGenerator>( new JpgDatasetGenerator( infoname ) );
}
creator->create( imagename, bgcolor, bgthreshold, bgfilename, num,
invert, maxintensitydev, maxxangle, maxyangle, maxzangle,
showsamples, width, height );
printf( "Done\n" );
}
+1 -1
View File
@@ -338,7 +338,7 @@ typedef enum CvBoostType
CV_LKCLASS = 5, /* classification (K class problem) */
CV_LSREG = 6, /* least squares regression */
CV_LADREG = 7, /* least absolute deviation regression */
CV_MREG = 8, /* M-regression (Huber loss) */
CV_MREG = 8 /* M-regression (Huber loss) */
} CvBoostType;
/****************************************************************************************\
+109 -72
View File
@@ -48,6 +48,8 @@
#include "cvhaartraining.h"
#include "_cvhaartraining.h"
#include "ioutput.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
@@ -2841,14 +2843,12 @@ void cvCreateTreeCascadeClassifier( const char* dirname,
cvReleaseMat( &features_idx );
}
void cvCreateTrainingSamples( const char* filename,
const char* imgfilename, int bgcolor, int bgthreshold,
const char* bgfilename, int count,
int invert, int maxintensitydev,
double maxxangle, double maxyangle, double maxzangle,
int showsamples,
bool showsamples,
int winwidth, int winheight )
{
CvSampleDistortionData data;
@@ -2915,7 +2915,7 @@ void cvCreateTrainingSamples( const char* filename,
cvShowImage( "Sample", &sample );
if( cvWaitKey( 0 ) == 27 )
{
showsamples = 0;
showsamples = false;
}
}
@@ -2942,45 +2942,43 @@ void cvCreateTrainingSamples( const char* filename,
}
#define CV_INFO_FILENAME "info.dat"
DatasetGenerator::DatasetGenerator( IOutput* _writer )
:writer(_writer)
{
}
void cvCreateTestSamples( const char* infoname,
const char* imgfilename, int bgcolor, int bgthreshold,
const char* bgfilename, int count,
int invert, int maxintensitydev,
double maxxangle, double maxyangle, double maxzangle,
int showsamples,
int winwidth, int winheight )
void DatasetGenerator::showSamples(bool* show, CvMat *img) const
{
if( *show )
{
cvShowImage( "Image", img);
if( cvWaitKey( 0 ) == 27 )
{
*show = false;
}
}
}
void DatasetGenerator::create(const char* imgfilename, int bgcolor, int bgthreshold,
const char* bgfilename, int count,
int invert, int maxintensitydev,
double maxxangle, double maxyangle, double maxzangle,
bool showsamples,
int winwidth, int winheight )
{
CvSampleDistortionData data;
assert( infoname != NULL );
assert( imgfilename != NULL );
assert( bgfilename != NULL );
if( !icvMkDir( infoname ) )
{
#if CV_VERBOSE
fprintf( stderr, "Unable to create directory hierarchy: %s\n", infoname );
#endif /* CV_VERBOSE */
return;
}
if( icvStartSampleDistortion( imgfilename, bgcolor, bgthreshold, &data ) )
{
char fullname[PATH_MAX];
char* filename;
CvMat win;
FILE* info;
if( icvInitBackgroundReaders( bgfilename, cvSize( 10, 10 ) ) )
{
int i;
int x, y, width, height;
float scale;
float maxscale;
int inverse;
if( showsamples )
@@ -2988,73 +2986,112 @@ void cvCreateTestSamples( const char* infoname,
cvNamedWindow( "Image", CV_WINDOW_AUTOSIZE );
}
info = fopen( infoname, "w" );
strcpy( fullname, infoname );
filename = strrchr( fullname, '\\' );
if( filename == NULL )
{
filename = strrchr( fullname, '/' );
}
if( filename == NULL )
{
filename = fullname;
}
else
{
filename++;
}
count = MIN( count, cvbgdata->count );
inverse = invert;
for( i = 0; i < count; i++ )
{
icvGetNextFromBackgroundData( cvbgdata, cvbgreader );
maxscale = MIN( 0.7F * cvbgreader->src.cols / winwidth,
0.7F * cvbgreader->src.rows / winheight );
if( maxscale < 1.0F ) continue;
CvRect boundingBox = getObjectPosition( cvSize( cvbgreader->src.cols,
cvbgreader->src.rows ),
cvGetSize(data.img),
cvSize( winwidth, winheight ) );
if(boundingBox.width <= 0 || boundingBox.height <= 0)
{
continue;
}
scale = (maxscale - 1.0F) * rand() / RAND_MAX + 1.0F;
width = (int) (scale * winwidth);
height = (int) (scale * winheight);
x = (int) ((0.1+0.8 * rand()/RAND_MAX) * (cvbgreader->src.cols - width));
y = (int) ((0.1+0.8 * rand()/RAND_MAX) * (cvbgreader->src.rows - height));
cvGetSubArr( &cvbgreader->src, &win, boundingBox );
cvGetSubArr( &cvbgreader->src, &win, cvRect( x, y ,width, height ) );
if( invert == CV_RANDOM_INVERT )
{
inverse = (rand() > (RAND_MAX/2));
}
icvPlaceDistortedSample( &win, inverse, maxintensitydev,
maxxangle, maxyangle, maxzangle,
1, 0.0, 0.0, &data );
writer->write( cvbgreader->src, boundingBox );
sprintf( filename, "%04d_%04d_%04d_%04d_%04d.jpg",
(i + 1), x, y, width, height );
if( info )
{
fprintf( info, "%s %d %d %d %d %d\n",
filename, 1, x, y, width, height );
}
cvSaveImage( fullname, &cvbgreader->src );
if( showsamples )
{
cvShowImage( "Image", &cvbgreader->src );
if( cvWaitKey( 0 ) == 27 )
{
showsamples = 0;
}
}
showSamples(&showsamples, &cvbgreader->src);
}
if( info ) fclose( info );
icvDestroyBackgroundReaders();
}
icvEndSampleDistortion( &data );
}
}
DatasetGenerator::~DatasetGenerator()
{
delete writer;
}
JpgDatasetGenerator::JpgDatasetGenerator( const char* filename )
:DatasetGenerator( IOutput::createOutput( filename, IOutput::JPG_DATASET ) )
{
}
CvSize JpgDatasetGenerator::scaleObjectSize( const CvSize& bgImgSize,
const CvSize& ,
const CvSize& sampleSize) const
{
float scale;
float maxscale;
maxscale = MIN( 0.7F * bgImgSize.width / sampleSize.width,
0.7F * bgImgSize.height / sampleSize.height );
if( maxscale < 1.0F )
{
scale = -1.f;
}
else
{
scale = (maxscale - 1.0F) * rand() / RAND_MAX + 1.0F;
}
int width = (int) (scale * sampleSize.width);
int height = (int) (scale * sampleSize.height);
return cvSize( width, height );
}
CvRect DatasetGenerator::getObjectPosition(const CvSize& bgImgSize,
const CvSize& imgSize,
const CvSize& sampleSize) const
{
CvSize size = scaleObjectSize( bgImgSize, imgSize, sampleSize );
int width = size.width;
int height = size.height;
int x = (int) ((0.1 + 0.8 * rand() / RAND_MAX) * (bgImgSize.width - width));
int y = (int) ((0.1 + 0.8 * rand() / RAND_MAX) * (bgImgSize.height - height));
return cvRect( x, y, width, height );
}
PngDatasetGenerator::PngDatasetGenerator(const char* filename)
:DatasetGenerator( IOutput::createOutput( filename, IOutput::PNG_DATASET ) )
{
}
CvSize PngDatasetGenerator::scaleObjectSize( const CvSize& bgImgSize,
const CvSize& imgSize,
const CvSize& ) const
{
float scale;
scale = MIN( 0.3F * bgImgSize.width / imgSize.width,
0.3F * bgImgSize.height / imgSize.height );
int width = (int) (scale * imgSize.width);
int height = (int) (scale * imgSize.height);
return cvSize( width, height );
}
/* End of file. */
+63 -5
View File
@@ -48,6 +48,11 @@
#ifndef _CVHAARTRAINING_H_
#define _CVHAARTRAINING_H_
class IOutput;
struct CvRect;
struct CvSize;
struct CvMat;
/*
* cvCreateTrainingSamples
*
@@ -74,23 +79,30 @@
*/
#define CV_RANDOM_INVERT 0x7FFFFFFF
void cvCreateTrainingSamples( const char* filename,
void cvCreateTrainingSamples(const char* filename,
const char* imgfilename, int bgcolor, int bgthreshold,
const char* bgfilename, int count,
int invert = 0, int maxintensitydev = 40,
double maxxangle = 1.1,
double maxyangle = 1.1,
double maxzangle = 0.5,
int showsamples = 0,
bool showsamples = false,
int winwidth = 24, int winheight = 24 );
void cvCreateTestSamples( const char* infoname,
const char* imgfilename, int bgcolor, int bgthreshold,
void cvCreatePngTrainingSet(const char* imgfilename, int bgcolor, int bgthreshold,
const char* bgfilename, int count,
int invert, int maxintensitydev,
double maxxangle, double maxyangle, double maxzangle,
int winwidth, int winheight,
IOutput *writer );
void cvCreateTestSamples(const char* imgfilename, int bgcolor, int bgthreshold,
const char* bgfilename, int count,
int invert, int maxintensitydev,
double maxxangle, double maxyangle, double maxzangle,
int showsamples,
int winwidth, int winheight );
int winwidth, int winheight,
IOutput* writer);
/*
* cvCreateTrainingSamplesFromInfo
@@ -189,4 +201,50 @@ void cvCreateTreeCascadeClassifier( const char* dirname,
int boosttype, int stumperror,
int maxtreesplits, int minpos, bool bg_vecfile = false );
class DatasetGenerator
{
public:
DatasetGenerator( IOutput* _writer );
void create( const char* imgfilename, int bgcolor, int bgthreshold,
const char* bgfilename, int count,
int invert, int maxintensitydev,
double maxxangle, double maxyangle, double maxzangle,
bool showsamples,
int winwidth, int winheight);
virtual ~DatasetGenerator();
private:
virtual void showSamples( bool* showSamples, CvMat* img ) const;
CvRect getObjectPosition( const CvSize& bgImgSize,
const CvSize& imgSize,
const CvSize& sampleSize ) const;
virtual CvSize scaleObjectSize(const CvSize& bgImgSize,
const CvSize& imgSize ,
const CvSize& sampleSize) const =0 ;
private:
IOutput* writer;
};
/* Provides the functionality of test set generating */
class JpgDatasetGenerator: public DatasetGenerator
{
public:
JpgDatasetGenerator(const char* filename);
private:
CvSize scaleObjectSize(const CvSize& bgImgSize,
const CvSize& ,
const CvSize& sampleSize) const;
};
class PngDatasetGenerator: public DatasetGenerator
{
public:
PngDatasetGenerator(const char *filename);
private:
CvSize scaleObjectSize(const CvSize& bgImgSize,
const CvSize& imgSize ,
const CvSize& ) const;
};
#endif /* _CVHAARTRAINING_H_ */
+227
View File
@@ -0,0 +1,227 @@
#include "cvsamplesoutput.h"
#include <cstdio>
#include "_cvcommon.h"
#include "highgui.h"
/* print statistic info */
#define CV_VERBOSE 1
IOutput::IOutput()
: currentIdx(0)
{}
void IOutput::findFilePathPart(char **partOfPath, char *fullPath)
{
*partOfPath = strrchr( fullPath, '\\' );
if( *partOfPath == NULL )
{
*partOfPath = strrchr( fullPath, '/' );
}
if( *partOfPath == NULL )
{
*partOfPath = fullPath;
}
else
{
*partOfPath += 1;
}
}
IOutput* IOutput::createOutput(const char *filename,
IOutput::OutputType type)
{
IOutput* output = 0;
switch (type) {
case IOutput::PNG_DATASET:
output = new PngDatasetOutput();
break;
case IOutput::JPG_DATASET:
output = new JpgDatasetOutput();
break;
default:
#if CV_VERBOSE
fprintf( stderr, "Invalid output type, valid types are: PNG_TRAINING_SET, JPG_TEST_SET");
#endif /* CV_VERBOSE */
return 0;
}
if ( output->init( filename ) )
return output;
else
return 0;
}
bool PngDatasetOutput::init( const char* annotationsListFileName )
{
IOutput::init( annotationsListFileName );
if(imgFileName == imgFullPath)
{
#if CV_VERBOSE
fprintf( stderr, "Invalid path to annotations file: %s\n"
"It should contain a parent directory name\n", imgFullPath );
#endif /* CV_VERBOSE */
return false;
}
const char* annotationsdirname = "/annotations/";
const char* positivesdirname = "/pos/";
imgFileName[-1] = '\0'; //erase slash at the end of the path
imgFileName -= 1;
//copy path to dataset top-level dir
strcpy(annotationFullPath, imgFullPath);
//find the name of annotation starting from the top-level dataset dir
findFilePathPart(&annotationRelativePath, annotationFullPath);
if( !strcmp( annotationRelativePath, ".." ) || !strcmp( annotationRelativePath, "." ) )
{
#if CV_VERBOSE
fprintf( stderr, "Invalid path to annotations file: %s\n"
"It should contain a parent directory name\n", annotationsListFileName );
#endif /* CV_VERBOSE */
return false;
}
//find the name of output image starting from the top-level dataset dir
findFilePathPart(&imgRelativePath, imgFullPath);
annotationFileName = annotationFullPath + strlen(annotationFullPath);
sprintf(annotationFileName, "%s", annotationsdirname);
annotationFileName += strlen(annotationFileName);
sprintf(imgFileName, "%s", positivesdirname);
imgFileName += strlen(imgFileName);
if( !icvMkDir( annotationFullPath ) )
{
#if CV_VERBOSE
fprintf( stderr, "Unable to create directory hierarchy: %s\n", annotationFullPath );
#endif /* CV_VERBOSE */
return false;
}
if( !icvMkDir( imgFullPath ) )
{
#if CV_VERBOSE
fprintf( stderr, "Unable to create directory hierarchy: %s\n", imgFullPath );
#endif /* CV_VERBOSE */
return false;
}
return true;
}
bool PngDatasetOutput::write( const CvMat& img,
const CvRect& boundingBox )
{
CvRect bbox = addBoundingboxBorder(boundingBox);
sprintf( imgFileName,
"%04d_%04d_%04d_%04d_%04d",
++currentIdx,
bbox.x,
bbox.y,
bbox.width,
bbox.height );
sprintf( annotationFileName, "%s.txt", imgFileName );
fprintf( annotationsList, "%s\n", annotationRelativePath );
FILE* annotationFile = fopen( annotationFullPath, "w" );
if(annotationFile == 0)
{
return false;
}
sprintf( imgFileName + strlen(imgFileName), ".%s", extension );
fprintf( annotationFile,
"Image filename : \"%s\"\n"
"Bounding box for object 1 \"PASperson\" (Xmin, Ymin) - (Xmax, Ymax) : (%d, %d) - (%d, %d)",
imgRelativePath,
bbox.x,
bbox.y,
bbox.x + bbox.width,
bbox.y + bbox.height );
fclose( annotationFile );
cvSaveImage( imgFullPath, &img);
return true;
}
CvRect PngDatasetOutput::addBoundingboxBorder(const CvRect& bbox) const
{
CvRect boundingBox = bbox;
int border = 5;
boundingBox.x -= border;
boundingBox.y -= border;
boundingBox.width += 2*border;
boundingBox.height += 2*border;
return boundingBox;
}
IOutput::~IOutput()
{
if(annotationsList)
{
fclose(annotationsList);
}
}
bool IOutput::init(const char *filename)
{
assert( filename != NULL );
if( !icvMkDir( filename ) )
{
#if CV_VERBOSE
fprintf( stderr, "Unable to create directory hierarchy: %s\n", filename );
#endif /* CV_VERBOSE */
return false;
}
annotationsList = fopen( filename, "w" );
if( annotationsList == NULL )
{
#if CV_VERBOSE
fprintf( stderr, "Unable to create info file: %s\n", filename );
#endif /* CV_VERBOSE */
return false;
}
strcpy( imgFullPath, filename );
findFilePathPart( &imgFileName, imgFullPath );
return true;
}
bool JpgDatasetOutput::write( const CvMat& img,
const CvRect& boundingBox )
{
sprintf( imgFileName, "%04d_%04d_%04d_%04d_%04d.jpg",
++currentIdx,
boundingBox.x,
boundingBox.y,
boundingBox.width,
boundingBox.height );
fprintf( annotationsList, "%s %d %d %d %d %d\n",
imgFileName,
1,
boundingBox.x,
boundingBox.y,
boundingBox.width,
boundingBox.height );
cvSaveImage( imgFullPath, &img);
return true;
}
+46
View File
@@ -0,0 +1,46 @@
#ifndef CVSAMPLESOUTPUT_H
#define CVSAMPLESOUTPUT_H
#include "ioutput.h"
class PngDatasetOutput: public IOutput
{
friend IOutput* IOutput::createOutput(const char *filename, OutputType type);
public:
virtual bool write( const CvMat& img,
const CvRect& boundingBox);
virtual ~PngDatasetOutput(){}
private:
PngDatasetOutput()
: extension("png")
, destImgWidth(640)
, destImgHeight(480)
{}
virtual bool init(const char* annotationsListFileName );
CvRect addBoundingboxBorder(const CvRect& bbox) const;
private:
char annotationFullPath[PATH_MAX];
char* annotationFileName;
char* annotationRelativePath;
char* imgRelativePath;
const char* extension;
int destImgWidth;
int destImgHeight ;
};
class JpgDatasetOutput: public IOutput
{
friend IOutput* IOutput::createOutput(const char *filename, OutputType type);
public:
virtual bool write( const CvMat& img,
const CvRect& boundingBox );
virtual ~JpgDatasetOutput(){}
private:
JpgDatasetOutput(){}
};
#endif // CVSAMPLESOUTPUT_H
+34
View File
@@ -0,0 +1,34 @@
#ifndef IOUTPUT_H
#define IOUTPUT_H
#include <cstdio>
#include "_cvcommon.h"
struct CvMat;
struct CvRect;
class IOutput
{
public:
enum OutputType {PNG_DATASET, JPG_DATASET};
public:
virtual bool write( const CvMat& img,
const CvRect& boundingBox ) =0;
virtual ~IOutput();
static IOutput* createOutput( const char *filename, OutputType type );
protected:
IOutput();
/* finds the beginning of the last token in the path */
void findFilePathPart( char **partOfPath, char *fullPath );
virtual bool init( const char* filename );
protected:
int currentIdx;
char imgFullPath[PATH_MAX];
char* imgFileName;
FILE* annotationsList;
};
#endif // IOUTPUT_H
+4 -3
View File
@@ -10,6 +10,8 @@ project(traincascade)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_TRAINCASCADE_DEPS})
ocv_warnings_disable(CMAKE_CXX_FLAGS -Woverloaded-virtual)
set(traincascade_files traincascade.cpp
cascadeclassifier.cpp cascadeclassifier.h
boost.cpp boost.h features.cpp traincascade_features.h
@@ -26,7 +28,6 @@ set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
INSTALL_NAME_DIR lib
OUTPUT_NAME "opencv_traincascade")
if(ENABLE_SOLUTION_FOLDERS)
@@ -35,8 +36,8 @@ endif()
if(INSTALL_CREATE_DISTRIB)
if(BUILD_SHARED_LIBS)
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
endif()
else()
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
endif()
+28 -28
View File
@@ -374,7 +374,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
if (is_buf_16u)
{
unsigned short* udst_idx = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
vi*sample_count + data_root->offset);
(size_t)vi*sample_count + data_root->offset);
for( int i = 0; i < num_valid; i++ )
{
idx = src_idx[i];
@@ -387,7 +387,7 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
else
{
int* idst_idx = buf->data.i + root->buf_idx*get_length_subbuf() +
vi*sample_count + root->offset;
(size_t)vi*sample_count + root->offset;
for( int i = 0; i < num_valid; i++ )
{
idx = src_idx[i];
@@ -404,14 +404,14 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
if (is_buf_16u)
{
unsigned short* udst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
(workVarCount-1)*sample_count + root->offset);
(size_t)(workVarCount-1)*sample_count + root->offset);
for( int i = 0; i < count; i++ )
udst[i] = (unsigned short)src_lbls[sidx[i]];
}
else
{
int* idst = buf->data.i + root->buf_idx*get_length_subbuf() +
(workVarCount-1)*sample_count + root->offset;
(size_t)(workVarCount-1)*sample_count + root->offset;
for( int i = 0; i < count; i++ )
idst[i] = src_lbls[sidx[i]];
}
@@ -421,14 +421,14 @@ CvDTreeNode* CvCascadeBoostTrainData::subsample_data( const CvMat* _subsample_id
if (is_buf_16u)
{
unsigned short* sample_idx_dst = (unsigned short*)(buf->data.s + root->buf_idx*get_length_subbuf() +
workVarCount*sample_count + root->offset);
(size_t)workVarCount*sample_count + root->offset);
for( int i = 0; i < count; i++ )
sample_idx_dst[i] = (unsigned short)sample_idx_src[sidx[i]];
}
else
{
int* sample_idx_dst = buf->data.i + root->buf_idx*get_length_subbuf() +
workVarCount*sample_count + root->offset;
(size_t)workVarCount*sample_count + root->offset;
for( int i = 0; i < count; i++ )
sample_idx_dst[i] = sample_idx_src[sidx[i]];
}
@@ -614,9 +614,9 @@ void CvCascadeBoostTrainData::setData( const CvFeatureEvaluator* _featureEvaluat
// set sample labels
if (is_buf_16u)
udst = (unsigned short*)(buf->data.s + work_var_count*sample_count);
udst = (unsigned short*)(buf->data.s + (size_t)work_var_count*sample_count);
else
idst = buf->data.i + work_var_count*sample_count;
idst = buf->data.i + (size_t)work_var_count*sample_count;
for (int si = 0; si < sample_count; si++)
{
@@ -684,11 +684,11 @@ void CvCascadeBoostTrainData::get_ord_var_data( CvDTreeNode* n, int vi, float* o
if ( vi < numPrecalcIdx )
{
if( !is_buf_16u )
*sortedIndices = buf->data.i + n->buf_idx*get_length_subbuf() + vi*sample_count + n->offset;
*sortedIndices = buf->data.i + n->buf_idx*get_length_subbuf() + (size_t)vi*sample_count + n->offset;
else
{
const unsigned short* shortIndices = (const unsigned short*)(buf->data.s + n->buf_idx*get_length_subbuf() +
vi*sample_count + n->offset );
(size_t)vi*sample_count + n->offset );
for( int i = 0; i < nodeSampleCount; i++ )
sortedIndicesBuf[i] = shortIndices[i];
@@ -799,14 +799,14 @@ struct FeatureIdxOnlyPrecalc : ParallelLoopBody
{
valCachePtr[si] = (*featureEvaluator)( fi, si );
if ( is_buf_16u )
*(udst + fi*sample_count + si) = (unsigned short)si;
*(udst + (size_t)fi*sample_count + si) = (unsigned short)si;
else
*(idst + fi*sample_count + si) = si;
*(idst + (size_t)fi*sample_count + si) = si;
}
if ( is_buf_16u )
icvSortUShAux( udst + fi*sample_count, sample_count, valCachePtr );
icvSortUShAux( udst + (size_t)fi*sample_count, sample_count, valCachePtr );
else
icvSortIntAux( idst + fi*sample_count, sample_count, valCachePtr );
icvSortIntAux( idst + (size_t)fi*sample_count, sample_count, valCachePtr );
}
}
const CvFeatureEvaluator* featureEvaluator;
@@ -835,14 +835,14 @@ struct FeatureValAndIdxPrecalc : ParallelLoopBody
{
valCache->at<float>(fi,si) = (*featureEvaluator)( fi, si );
if ( is_buf_16u )
*(udst + fi*sample_count + si) = (unsigned short)si;
*(udst + (size_t)fi*sample_count + si) = (unsigned short)si;
else
*(idst + fi*sample_count + si) = si;
*(idst + (size_t)fi*sample_count + si) = si;
}
if ( is_buf_16u )
icvSortUShAux( udst + fi*sample_count, sample_count, valCache->ptr<float>(fi) );
icvSortUShAux( udst + (size_t)fi*sample_count, sample_count, valCache->ptr<float>(fi) );
else
icvSortIntAux( idst + fi*sample_count, sample_count, valCache->ptr<float>(fi) );
icvSortIntAux( idst + (size_t)fi*sample_count, sample_count, valCache->ptr<float>(fi) );
}
}
const CvFeatureEvaluator* featureEvaluator;
@@ -1165,9 +1165,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
if (data->is_buf_16u)
{
unsigned short *ldst = (unsigned short *)(buf->data.s + left->buf_idx*length_buf_row +
(workVarCount-1)*scount + left->offset);
(size_t)(workVarCount-1)*scount + left->offset);
unsigned short *rdst = (unsigned short *)(buf->data.s + right->buf_idx*length_buf_row +
(workVarCount-1)*scount + right->offset);
(size_t)(workVarCount-1)*scount + right->offset);
for( int i = 0; i < n; i++ )
{
@@ -1188,9 +1188,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
else
{
int *ldst = buf->data.i + left->buf_idx*length_buf_row +
(workVarCount-1)*scount + left->offset;
(size_t)(workVarCount-1)*scount + left->offset;
int *rdst = buf->data.i + right->buf_idx*length_buf_row +
(workVarCount-1)*scount + right->offset;
(size_t)(workVarCount-1)*scount + right->offset;
for( int i = 0; i < n; i++ )
{
@@ -1218,9 +1218,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
if (data->is_buf_16u)
{
unsigned short* ldst = (unsigned short*)(buf->data.s + left->buf_idx*length_buf_row +
workVarCount*scount + left->offset);
(size_t)workVarCount*scount + left->offset);
unsigned short* rdst = (unsigned short*)(buf->data.s + right->buf_idx*length_buf_row +
workVarCount*scount + right->offset);
(size_t)workVarCount*scount + right->offset);
for (int i = 0; i < n; i++)
{
unsigned short idx = (unsigned short)tempBuf[i];
@@ -1239,9 +1239,9 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
else
{
int* ldst = buf->data.i + left->buf_idx*length_buf_row +
workVarCount*scount + left->offset;
(size_t)workVarCount*scount + left->offset;
int* rdst = buf->data.i + right->buf_idx*length_buf_row +
workVarCount*scount + right->offset;
(size_t)workVarCount*scount + right->offset;
for (int i = 0; i < n; i++)
{
int idx = tempBuf[i];
@@ -1410,7 +1410,7 @@ void CvCascadeBoost::update_weights( CvBoostTree* tree )
if (data->is_buf_16u)
{
unsigned short* labels = (unsigned short*)(buf->data.s + data->data_root->buf_idx*length_buf_row +
data->data_root->offset + (data->work_var_count-1)*data->sample_count);
data->data_root->offset + (size_t)(data->work_var_count-1)*data->sample_count);
for( int i = 0; i < n; i++ )
{
// save original categorical responses {0,1}, convert them to {-1,1}
@@ -1428,7 +1428,7 @@ void CvCascadeBoost::update_weights( CvBoostTree* tree )
else
{
int* labels = buf->data.i + data->data_root->buf_idx*length_buf_row +
data->data_root->offset + (data->work_var_count-1)*data->sample_count;
data->data_root->offset + (size_t)(data->work_var_count-1)*data->sample_count;
for( int i = 0; i < n; i++ )
{
+27 -9
View File
@@ -136,7 +136,8 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
const CvCascadeParams& _cascadeParams,
const CvFeatureParams& _featureParams,
const CvCascadeBoostParams& _stageParams,
bool baseFormatSave )
bool baseFormatSave,
double acceptanceRatioBreakValue)
{
// Start recording clock ticks for training time output
const clock_t begin_time = clock();
@@ -169,6 +170,13 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
featureEvaluator = CvFeatureEvaluator::create(cascadeParams.featureType);
featureEvaluator->init( (CvFeatureParams*)featureParams, numPos + numNeg, cascadeParams.winSize );
stageClassifiers.reserve( numStages );
}else{
// Make sure that if model parameters are preloaded, that people are aware of this,
// even when passing other parameters to the training command
cout << "---------------------------------------------------------------------------------" << endl;
cout << "Training parameters are pre-loaded from the parameter file in data folder!" << endl;
cout << "Please empty this folder if you want to use a NEW set of training parameters." << endl;
cout << "---------------------------------------------------------------------------------" << endl;
}
cout << "PARAMETERS:" << endl;
cout << "cascadeDirName: " << _cascadeDirName << endl;
@@ -179,9 +187,11 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
cout << "numStages: " << numStages << endl;
cout << "precalcValBufSize[Mb] : " << _precalcValBufSize << endl;
cout << "precalcIdxBufSize[Mb] : " << _precalcIdxBufSize << endl;
cout << "acceptanceRatioBreakValue : " << acceptanceRatioBreakValue << endl;
cascadeParams.printAttrs();
stageParams->printAttrs();
featureParams->printAttrs();
cout << "Number of unique features given windowSize [" << _cascadeParams.winSize.width << "," << _cascadeParams.winSize.height << "] : " << featureEvaluator->getNumFeatures() << "" << endl;
int startNumStages = (int)stageClassifiers.size();
if ( startNumStages > 1 )
@@ -198,18 +208,23 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
cout << endl << "===== TRAINING " << i << "-stage =====" << endl;
cout << "<BEGIN" << endl;
if ( !updateTrainingSet( tempLeafFARate ) )
if ( !updateTrainingSet( requiredLeafFARate, tempLeafFARate ) )
{
cout << "Train dataset for temp stage can not be filled. "
"Branch training terminated." << endl;
"Branch training terminated." << endl;
break;
}
if( tempLeafFARate <= requiredLeafFARate )
{
cout << "Required leaf false alarm rate achieved. "
"Branch training terminated." << endl;
"Branch training terminated." << endl;
break;
}
if( (tempLeafFARate <= acceptanceRatioBreakValue) && (acceptanceRatioBreakValue >= 0) ){
cout << "The required acceptanceRatio for the model has been reached to avoid overfitting of trainingdata. "
"Branch training terminated." << endl;
break;
}
CvCascadeBoost* tempStage = new CvCascadeBoost;
bool isStageTrained = tempStage->train( (CvFeatureEvaluator*)featureEvaluator,
@@ -284,17 +299,17 @@ int CvCascadeClassifier::predict( int sampleIdx )
return 1;
}
bool CvCascadeClassifier::updateTrainingSet( double& acceptanceRatio)
bool CvCascadeClassifier::updateTrainingSet( double minimumAcceptanceRatio, double& acceptanceRatio)
{
int64 posConsumed = 0, negConsumed = 0;
imgReader.restart();
int posCount = fillPassedSamples( 0, numPos, true, posConsumed );
int posCount = fillPassedSamples( 0, numPos, true, 0, posConsumed );
if( !posCount )
return false;
cout << "POS count : consumed " << posCount << " : " << (int)posConsumed << endl;
int proNumNeg = cvRound( ( ((double)numNeg) * ((double)posCount) ) / numPos ); // apply only a fraction of negative samples. double is required since overflow is possible
int negCount = fillPassedSamples( posCount, proNumNeg, false, negConsumed );
int negCount = fillPassedSamples( posCount, proNumNeg, false, minimumAcceptanceRatio, negConsumed );
if ( !negCount )
return false;
@@ -304,7 +319,7 @@ bool CvCascadeClassifier::updateTrainingSet( double& acceptanceRatio)
return true;
}
int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositive, int64& consumed )
int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositive, double minimumAcceptanceRatio, int64& consumed )
{
int getcount = 0;
Mat img(cascadeParams.winSize, CV_8UC1);
@@ -312,6 +327,9 @@ int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositiv
{
for( ; ; )
{
if( consumed != 0 && ((double)getcount+1)/(double)(int64)consumed <= minimumAcceptanceRatio )
return getcount;
bool isGetImg = isPositive ? imgReader.getPos( img ) :
imgReader.getNeg( img );
if( !isGetImg )
@@ -319,7 +337,7 @@ int CvCascadeClassifier::fillPassedSamples( int first, int count, bool isPositiv
consumed++;
featureEvaluator->setImage( img, isPositive ? 1 : 0, i );
if( predict( i ) == 1.0F )
if( predict( i ) == 1 )
{
getcount++;
printf("%s current samples: %d\r", isPositive ? "POS":"NEG", getcount);
+4 -3
View File
@@ -96,13 +96,14 @@ public:
const CvCascadeParams& _cascadeParams,
const CvFeatureParams& _featureParams,
const CvCascadeBoostParams& _stageParams,
bool baseFormatSave = false );
bool baseFormatSave = false,
double acceptanceRatioBreakValue = -1.0 );
private:
int predict( int sampleIdx );
void save( const std::string cascadeDirName, bool baseFormat = false );
bool load( const std::string cascadeDirName );
bool updateTrainingSet( double& acceptanceRatio );
int fillPassedSamples( int first, int count, bool isPositive, int64& consumed );
bool updateTrainingSet( double minimumAcceptanceRatio, double& acceptanceRatio );
int fillPassedSamples( int first, int count, bool isPositive, double requiredAcceptanceRatio, int64& consumed );
void writeParams( cv::FileStorage &fs ) const;
void writeStages( cv::FileStorage &fs, const cv::Mat& featureMap ) const;
+1 -9
View File
@@ -32,20 +32,12 @@ bool CvCascadeImageReader::NegReader::create( const string _filename, Size _winS
if ( !file.is_open() )
return false;
size_t pos = _filename.rfind('\\');
char dlmrt = '\\';
if (pos == string::npos)
{
pos = _filename.rfind('/');
dlmrt = '/';
}
dirname = pos == string::npos ? "" : _filename.substr(0, pos) + dlmrt;
while( !file.eof() )
{
std::getline(file, str);
if (str.empty()) break;
if (str.at(0) == '#' ) continue; /* comment */
imgFilenames.push_back(dirname + str);
imgFilenames.push_back(str);
}
file.close();
+3 -2
View File
@@ -1,10 +1,11 @@
#ifndef _OPENCV_IMAGESTORAGE_H_
#define _OPENCV_IMAGESTORAGE_H_
#include <stdio.h>
#include <string>
#include <vector>
#include "highgui.h"
class CvCascadeImageReader
{
public:
+10 -3
View File
@@ -14,9 +14,10 @@ int main( int argc, char* argv[] )
int numPos = 2000;
int numNeg = 1000;
int numStages = 20;
int precalcValBufSize = 256,
precalcIdxBufSize = 256;
int precalcValBufSize = 1024,
precalcIdxBufSize = 1024;
bool baseFormatSave = false;
double acceptanceRatioBreakValue = -1.0;
CvCascadeParams cascadeParams;
CvCascadeBoostParams stageParams;
@@ -37,6 +38,7 @@ int main( int argc, char* argv[] )
cout << " [-precalcValBufSize <precalculated_vals_buffer_size_in_Mb = " << precalcValBufSize << ">]" << endl;
cout << " [-precalcIdxBufSize <precalculated_idxs_buffer_size_in_Mb = " << precalcIdxBufSize << ">]" << endl;
cout << " [-baseFormatSave]" << endl;
cout << " [-acceptanceRatioBreakValue <value> = " << acceptanceRatioBreakValue << ">]" << endl;
cascadeParams.printDefaults();
stageParams.printDefaults();
for( int fi = 0; fi < fc; fi++ )
@@ -83,6 +85,10 @@ int main( int argc, char* argv[] )
{
baseFormatSave = true;
}
else if( !strcmp( argv[i], "-acceptanceRatioBreakValue" ) )
{
acceptanceRatioBreakValue = atof(argv[++i]);
}
else if ( cascadeParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
else if ( stageParams.scanAttr( argv[i], argv[i+1] ) ) { i++; }
else if ( !set )
@@ -108,6 +114,7 @@ int main( int argc, char* argv[] )
cascadeParams,
*featureParams[cascadeParams.featureType],
stageParams,
baseFormatSave );
baseFormatSave,
acceptanceRatioBreakValue );
return 0;
}
+32
View File
@@ -0,0 +1,32 @@
SET(OPENCV_APPLICATION_DEPS opencv_core)
ocv_check_dependencies(${OPENCV_APPLICATION_DEPS})
if(NOT OCV_DEPENDENCIES_FOUND)
return()
endif()
project(opencv_version)
set(the_target opencv_version)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_APPLICATION_DEPS})
file(GLOB SRCS *.cpp)
add_executable(${the_target} ${SRCS})
target_link_libraries(${the_target} ${OPENCV_APPLICATION_DEPS})
set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
OUTPUT_NAME "opencv_version")
set_target_properties(${the_target} PROPERTIES FOLDER "applications")
if(INSTALL_CREATE_DISTRIB)
if(BUILD_SHARED_LIBS)
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT libs)
endif()
else()
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs)
endif()
+28
View File
@@ -0,0 +1,28 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#include <iostream>
#include <opencv2/core.hpp>
int main(int argc, const char** argv)
{
cv::CommandLineParser parser(argc, argv,
"{ h|help | false | show this help message }"
"{ v|verbose | false | show build configuration log }"
);
if (parser.get<bool>("help"))
{
parser.printParams();
}
else if (parser.get<bool>("verbose"))
{
std::cout << cv::getBuildInformation().c_str() << std::endl;
}
else
{
std::cout << CV_VERSION << std::endl;
}
return 0;
}
+35
View File
@@ -0,0 +1,35 @@
SET(OPENCV_VISUALISATION_DEPS opencv_core opencv_highgui opencv_imgproc)
ocv_check_dependencies(${OPENCV_VISUALISATION_DEPS})
if(NOT OCV_DEPENDENCIES_FOUND)
return()
endif()
project(visualisation)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_VISUALISATION_DEPS})
set(visualisation_files opencv_visualisation.cpp)
set(the_target opencv_visualisation)
add_executable(${the_target} ${visualisation_files})
target_link_libraries(${the_target} ${OPENCV_VISUALISATION_DEPS})
set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
OUTPUT_NAME "opencv_visualisation")
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_target} PROPERTIES FOLDER "applications")
endif()
if(INSTALL_CREATE_DISTRIB)
if(BUILD_SHARED_LIBS)
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev)
endif()
else()
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev)
endif()
+350
View File
@@ -0,0 +1,350 @@
////////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
////////////////////////////////////////////////////////////////////////////////////////
/*****************************************************************************************************
Software for visualising cascade classifier models trained by OpenCV and to get a better
understanding of the used features.
USAGE:
./visualise_models -model <model.xml> -image <ref.png> -data <output folder>
LIMITS
- Use an absolute path for the output folder to ensure the tool works
- Only handles cascade classifier models
- Handles stumps only for the moment
- Needs a valid training/test sample window with the original model dimensions, passed as `ref.png`
- Can handle HAAR and LBP features
Created by: Puttemans Steven - April 2016
*****************************************************************************************************/
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <fstream>
#include <iostream>
using namespace std;
using namespace cv;
struct rect_data{
int x;
int y;
int w;
int h;
float weight;
};
int main( int argc, const char** argv )
{
// Read in the input arguments
string model = "";
string output_folder = "";
string image_ref = "";
for(int i = 1; i < argc; ++i )
{
if( !strcmp( argv[i], "-model" ) )
{
model = argv[++i];
}else if( !strcmp( argv[i], "-image" ) ){
image_ref = argv[++i];
}else if( !strcmp( argv[i], "-data" ) ){
output_folder = argv[++i];
}
}
// Value for timing
// You can increase this to have a better visualisation during the generation
int timing = 1;
// Value for cols of storing elements
int cols_prefered = 5;
// Open the XML model
FileStorage fs;
fs.open(model, FileStorage::READ);
// Get a the required information
// First decide which feature type we are using
FileNode cascade = fs["cascade"];
string feature_type = cascade["featureType"];
bool haar = false, lbp = false;
if (feature_type.compare("HAAR") == 0){
haar = true;
}
if (feature_type.compare("LBP") == 0){
lbp = true;
}
if ( feature_type.compare("HAAR") != 0 && feature_type.compare("LBP")){
cerr << "The model is not an HAAR or LBP feature based model!" << endl;
cerr << "Please select a model that can be visualized by the software." << endl;
return -1;
}
// We make a visualisation mask - which increases the window to make it at least a bit more visible
int resize_factor = 10;
int resize_storage_factor = 10;
Mat reference_image = imread(image_ref, IMREAD_GRAYSCALE );
Mat visualization;
resize(reference_image, visualization, Size(reference_image.cols * resize_factor, reference_image.rows * resize_factor));
// First recover for each stage the number of weak features and their index
// Important since it is NOT sequential when using LBP features
vector< vector<int> > stage_features;
FileNode stages = cascade["stages"];
FileNodeIterator it_stages = stages.begin(), it_stages_end = stages.end();
int idx = 0;
for( ; it_stages != it_stages_end; it_stages++, idx++ ){
vector<int> current_feature_indexes;
FileNode weak_classifiers = (*it_stages)["weakClassifiers"];
FileNodeIterator it_weak = weak_classifiers.begin(), it_weak_end = weak_classifiers.end();
vector<int> values;
for(int idy = 0; it_weak != it_weak_end; it_weak++, idy++ ){
(*it_weak)["internalNodes"] >> values;
current_feature_indexes.push_back( (int)values[2] );
}
stage_features.push_back(current_feature_indexes);
}
// If the output option has been chosen than we will store a combined image plane for
// each stage, containing all weak classifiers for that stage.
bool draw_planes = false;
stringstream output_video;
output_video << output_folder << "model_visualization.avi";
VideoWriter result_video;
if( output_folder.compare("") != 0 ){
draw_planes = true;
result_video.open(output_video.str(), CV_FOURCC('X','V','I','D'), 15, Size(reference_image.cols * resize_factor, reference_image.rows * resize_factor), false);
}
if(haar){
// Grab the corresponding features dimensions and weights
FileNode features = cascade["features"];
vector< vector< rect_data > > feature_data;
FileNodeIterator it_features = features.begin(), it_features_end = features.end();
for(int idf = 0; it_features != it_features_end; it_features++, idf++ ){
vector< rect_data > current_feature_rectangles;
FileNode rectangles = (*it_features)["rects"];
int nrects = (int)rectangles.size();
for(int k = 0; k < nrects; k++){
rect_data current_data;
FileNode single_rect = rectangles[k];
current_data.x = (int)single_rect[0];
current_data.y = (int)single_rect[1];
current_data.w = (int)single_rect[2];
current_data.h = (int)single_rect[3];
current_data.weight = (float)single_rect[4];
current_feature_rectangles.push_back(current_data);
}
feature_data.push_back(current_feature_rectangles);
}
// Loop over each possible feature on its index, visualise on the mask and wait a bit,
// then continue to the next feature.
// If visualisations should be stored then do the in between calculations
Mat image_plane;
Mat metadata = Mat::zeros(150, 1000, CV_8UC1);
vector< rect_data > current_rects;
for(int sid = 0; sid < (int)stage_features.size(); sid ++){
if(draw_planes){
int features_nmbr = (int)stage_features[sid].size();
int cols = cols_prefered;
int rows = features_nmbr / cols;
if( (features_nmbr % cols) > 0){
rows++;
}
image_plane = Mat::zeros(reference_image.rows * resize_storage_factor * rows, reference_image.cols * resize_storage_factor * cols, CV_8UC1);
}
for(int fid = 0; fid < (int)stage_features[sid].size(); fid++){
stringstream meta1, meta2;
meta1 << "Stage " << sid << " / Feature " << fid;
meta2 << "Rectangles: ";
Mat temp_window = visualization.clone();
Mat temp_metadata = metadata.clone();
int current_feature_index = stage_features[sid][fid];
current_rects = feature_data[current_feature_index];
Mat single_feature = reference_image.clone();
resize(single_feature, single_feature, Size(), resize_storage_factor, resize_storage_factor);
for(int i = 0; i < (int)current_rects.size(); i++){
rect_data local = current_rects[i];
if(draw_planes){
if(local.weight >= 0){
rectangle(single_feature, Rect(local.x * resize_storage_factor, local.y * resize_storage_factor, local.w * resize_storage_factor, local.h * resize_storage_factor), Scalar(0), CV_FILLED);
}else{
rectangle(single_feature, Rect(local.x * resize_storage_factor, local.y * resize_storage_factor, local.w * resize_storage_factor, local.h * resize_storage_factor), Scalar(255), CV_FILLED);
}
}
Rect part(local.x * resize_factor, local.y * resize_factor, local.w * resize_factor, local.h * resize_factor);
meta2 << part << " (w " << local.weight << ") ";
if(local.weight >= 0){
rectangle(temp_window, part, Scalar(0), CV_FILLED);
}else{
rectangle(temp_window, part, Scalar(255), CV_FILLED);
}
}
imshow("features", temp_window);
putText(temp_window, meta1.str(), Point(15,15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
result_video.write(temp_window);
// Copy the feature image if needed
if(draw_planes){
single_feature.copyTo(image_plane(Rect(0 + (fid%cols_prefered)*single_feature.cols, 0 + (fid/cols_prefered) * single_feature.rows, single_feature.cols, single_feature.rows)));
}
putText(temp_metadata, meta1.str(), Point(15,15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
putText(temp_metadata, meta2.str(), Point(15,40), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
imshow("metadata", temp_metadata);
waitKey(timing);
}
//Store the stage image if needed
if(draw_planes){
stringstream save_location;
save_location << output_folder << "stage_" << sid << ".png";
imwrite(save_location.str(), image_plane);
}
}
}
if(lbp){
// Grab the corresponding features dimensions and weights
FileNode features = cascade["features"];
vector<Rect> feature_data;
FileNodeIterator it_features = features.begin(), it_features_end = features.end();
for(int idf = 0; it_features != it_features_end; it_features++, idf++ ){
FileNode rectangle = (*it_features)["rect"];
Rect current_feature ((int)rectangle[0], (int)rectangle[1], (int)rectangle[2], (int)rectangle[3]);
feature_data.push_back(current_feature);
}
// Loop over each possible feature on its index, visualise on the mask and wait a bit,
// then continue to the next feature.
Mat image_plane;
Mat metadata = Mat::zeros(150, 1000, CV_8UC1);
for(int sid = 0; sid < (int)stage_features.size(); sid ++){
if(draw_planes){
int features_nmbr = (int)stage_features[sid].size();
int cols = cols_prefered;
int rows = features_nmbr / cols;
if( (features_nmbr % cols) > 0){
rows++;
}
image_plane = Mat::zeros(reference_image.rows * resize_storage_factor * rows, reference_image.cols * resize_storage_factor * cols, CV_8UC1);
}
for(int fid = 0; fid < (int)stage_features[sid].size(); fid++){
stringstream meta1, meta2;
meta1 << "Stage " << sid << " / Feature " << fid;
meta2 << "Rectangle: ";
Mat temp_window = visualization.clone();
Mat temp_metadata = metadata.clone();
int current_feature_index = stage_features[sid][fid];
Rect current_rect = feature_data[current_feature_index];
Mat single_feature = reference_image.clone();
resize(single_feature, single_feature, Size(), resize_storage_factor, resize_storage_factor);
// VISUALISATION
// The rectangle is the top left one of a 3x3 block LBP constructor
Rect resized(current_rect.x * resize_factor, current_rect.y * resize_factor, current_rect.width * resize_factor, current_rect.height * resize_factor);
meta2 << resized;
// Top left
rectangle(temp_window, resized, Scalar(255), 1);
// Top middle
rectangle(temp_window, Rect(resized.x + resized.width, resized.y, resized.width, resized.height), Scalar(255), 1);
// Top right
rectangle(temp_window, Rect(resized.x + 2*resized.width, resized.y, resized.width, resized.height), Scalar(255), 1);
// Middle left
rectangle(temp_window, Rect(resized.x, resized.y + resized.height, resized.width, resized.height), Scalar(255), 1);
// Middle middle
rectangle(temp_window, Rect(resized.x + resized.width, resized.y + resized.height, resized.width, resized.height), Scalar(255), CV_FILLED);
// Middle right
rectangle(temp_window, Rect(resized.x + 2*resized.width, resized.y + resized.height, resized.width, resized.height), Scalar(255), 1);
// Bottom left
rectangle(temp_window, Rect(resized.x, resized.y + 2*resized.height, resized.width, resized.height), Scalar(255), 1);
// Bottom middle
rectangle(temp_window, Rect(resized.x + resized.width, resized.y + 2*resized.height, resized.width, resized.height), Scalar(255), 1);
// Bottom right
rectangle(temp_window, Rect(resized.x + 2*resized.width, resized.y + 2*resized.height, resized.width, resized.height), Scalar(255), 1);
if(draw_planes){
Rect resized_inner(current_rect.x * resize_storage_factor, current_rect.y * resize_storage_factor, current_rect.width * resize_storage_factor, current_rect.height * resize_storage_factor);
// Top left
rectangle(single_feature, resized_inner, Scalar(255), 1);
// Top middle
rectangle(single_feature, Rect(resized_inner.x + resized_inner.width, resized_inner.y, resized_inner.width, resized_inner.height), Scalar(255), 1);
// Top right
rectangle(single_feature, Rect(resized_inner.x + 2*resized_inner.width, resized_inner.y, resized_inner.width, resized_inner.height), Scalar(255), 1);
// Middle left
rectangle(single_feature, Rect(resized_inner.x, resized_inner.y + resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
// Middle middle
rectangle(single_feature, Rect(resized_inner.x + resized_inner.width, resized_inner.y + resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), CV_FILLED);
// Middle right
rectangle(single_feature, Rect(resized_inner.x + 2*resized_inner.width, resized_inner.y + resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
// Bottom left
rectangle(single_feature, Rect(resized_inner.x, resized_inner.y + 2*resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
// Bottom middle
rectangle(single_feature, Rect(resized_inner.x + resized_inner.width, resized_inner.y + 2*resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
// Bottom right
rectangle(single_feature, Rect(resized_inner.x + 2*resized_inner.width, resized_inner.y + 2*resized_inner.height, resized_inner.width, resized_inner.height), Scalar(255), 1);
single_feature.copyTo(image_plane(Rect(0 + (fid%cols_prefered)*single_feature.cols, 0 + (fid/cols_prefered) * single_feature.rows, single_feature.cols, single_feature.rows)));
}
putText(temp_metadata, meta1.str(), Point(15,15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
putText(temp_metadata, meta2.str(), Point(15,40), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
imshow("metadata", temp_metadata);
imshow("features", temp_window);
putText(temp_window, meta1.str(), Point(15,15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(255));
result_video.write(temp_window);
waitKey(timing);
}
//Store the stage image if needed
if(draw_planes){
stringstream save_location;
save_location << output_folder << "stage_" << sid << ".png";
imwrite(save_location.str(), image_plane);
}
}
}
return 0;
}
+160 -241
View File
@@ -31,10 +31,8 @@
# The following variables affect the behavior of the macros in the
# script (in alphebetical order). Note that any of these flags can be
# changed multiple times in the same directory before calling
# CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE, CUDA_COMPILE_PTX
# or CUDA_WRAP_SRCS.
#
# ::
# CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE, CUDA_COMPILE_PTX,
# CUDA_COMPILE_FATBIN, CUDA_COMPILE_CUBIN or CUDA_WRAP_SRCS::
#
# CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
# -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
@@ -43,19 +41,11 @@
# nvcc in the generated source. If you compile to PTX and then load the
# file yourself, you can mix bit sizes between device and host.
#
#
#
# ::
#
# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
# -- Set to ON if you want the custom build rule to be attached to the source
# file in Visual Studio. Turn OFF if you add the same cuda file to multiple
# targets.
#
#
#
# ::
#
# This allows the user to build the target from the CUDA file; however, bad
# things can happen if the CUDA source file is added to multiple targets.
# When performing parallel builds it is possible for the custom build
@@ -68,44 +58,24 @@
# this script could detect the reuse of source files across multiple targets
# and turn the option off for the user, but no good solution could be found.
#
#
#
# ::
#
# CUDA_BUILD_CUBIN (Default OFF)
# -- Set to ON to enable and extra compilation pass with the -cubin option in
# Device mode. The output is parsed and register, shared memory usage is
# printed during build.
#
#
#
# ::
#
# CUDA_BUILD_EMULATION (Default OFF for device mode)
# -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
# when CUDA_BUILD_EMULATION is TRUE.
#
#
#
# ::
#
# CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
# -- Set to the path you wish to have the generated files placed. If it is
# blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
# Intermediate files will always be placed in
# CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
#
#
#
# ::
#
# CUDA_HOST_COMPILATION_CPP (Default ON)
# -- Set to OFF for C compilation of host code.
#
#
#
# ::
#
# CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER, $(VCInstallDir)/bin for VS)
# -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
# --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
@@ -113,19 +83,11 @@
# $(VCInstallDir)/bin is a special value that expands out to the path when
# the command is run from withing VS.
#
#
#
# ::
#
# CUDA_NVCC_FLAGS
# CUDA_NVCC_FLAGS_<CONFIG>
# -- Additional NVCC command line arguments. NOTE: multiple arguments must be
# semi-colon delimited (e.g. --compiler-options;-Wall)
#
#
#
# ::
#
# CUDA_PROPAGATE_HOST_FLAGS (Default ON)
# -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
# dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
@@ -137,10 +99,6 @@
# CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
# shared library compilation are not affected by this flag.
#
#
#
# ::
#
# CUDA_SEPARABLE_COMPILATION (Default OFF)
# -- If set this will enable separable compilation for all CUDA runtime object
# files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
@@ -148,38 +106,22 @@
# CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
#
#
#
# ::
#
# CUDA_VERBOSE_BUILD (Default OFF)
# -- Set to ON to see all the commands used when building the CUDA file. When
# using a Makefile generator the value defaults to VERBOSE (run make
# VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
# always print the output.
#
#
#
# The script creates the following macros (in alphebetical order):
#
# ::
# The script creates the following macros (in alphebetical order)::
#
# CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
# -- Adds the cufft library to the target (can be any target). Handles whether
# you are in emulation mode or not.
#
#
#
# ::
#
# CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
# -- Adds the cublas library to the target (can be any target). Handles
# whether you are in emulation mode or not.
#
#
#
# ::
#
# CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
# [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
# -- Creates an executable "cuda_target" which is made up of the files
@@ -193,42 +135,28 @@
# nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
# CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
#
#
#
# ::
#
# CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
# [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
# -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
#
#
#
# ::
#
# CUDA_BUILD_CLEAN_TARGET()
# -- Creates a convience target that deletes all the dependency files
# generated. You should make clean after running this target to ensure the
# dependency files get regenerated.
#
#
#
# ::
#
# CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
# [OPTIONS ...] )
# -- Returns a list of generated files from the input source files to be used
# with ADD_LIBRARY or ADD_EXECUTABLE.
#
#
#
# ::
#
# CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
# -- Returns a list of PTX files generated from the input source files.
#
# CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] )
# -- Returns a list of FATBIN files generated from the input source files.
#
#
# ::
# CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] )
# -- Returns a list of CUBIN files generated from the input source files.
#
# CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
# cuda_target
@@ -242,10 +170,6 @@
# automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
# this is a function and not a macro.
#
#
#
# ::
#
# CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
# -- Sets the directories that should be passed to nvcc
# (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
@@ -253,17 +177,9 @@
#
#
#
#
#
# ::
#
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
# nvcc_flags object_files)
#
#
#
# ::
#
# -- Generates the link object required by separable compilation from the given
# object files. This is called automatically for CUDA_ADD_EXECUTABLE and
# CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
@@ -273,91 +189,51 @@
# specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function
# instead of a macro.
#
#
#
# ::
#
# CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
# [STATIC | SHARED | MODULE] [OPTIONS ...] )
# -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
# CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
# function under the hood.
#
#
#
# ::
#
# Given the list of files (file0 file1 ... fileN) this macro generates
# custom commands that generate either PTX or linkable objects (use "PTX" or
# "OBJ" for the format argument to switch). Files that don't end with .cu
# or have the HEADER_FILE_ONLY property are ignored.
#
#
#
# ::
#
# The arguments passed in after OPTIONS are extra command line options to
# give to nvcc. You can also specify per configuration options by
# specifying the name of the configuration followed by the options. General
# options must preceed configuration specific options. Not all
# configurations need to be specified, only the ones provided will be used.
#
#
#
# ::
#
# OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
# DEBUG -g
# RELEASE --use_fast_math
# RELWITHDEBINFO --use_fast_math;-g
# MINSIZEREL --use_fast_math
#
#
#
# ::
#
# For certain configurations (namely VS generating object files with
# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
# be produced for the given cuda file. This is because when you add the
# cuda file to Visual Studio it knows that this file produces an object file
# and will link in the resulting object file automatically.
#
#
#
# ::
#
# This script will also generate a separate cmake script that is used at
# build time to invoke nvcc. This is for several reasons.
#
#
#
# ::
#
# 1. nvcc can return negative numbers as return values which confuses
# Visual Studio into thinking that the command succeeded. The script now
# checks the error codes and produces errors when there was a problem.
#
#
#
# ::
#
# 2. nvcc has been known to not delete incomplete results when it
# encounters problems. This confuses build systems into thinking the
# target was generated when in fact an unusable file exists. The script
# now deletes the output files if there was an error.
#
#
#
# ::
#
# 3. By putting all the options that affect the build into a file and then
# make the build rule dependent on the file, the output files will be
# regenerated when the options change.
#
#
#
# ::
#
# This script also looks at optional arguments STATIC, SHARED, or MODULE to
# determine when to target the object compilation for a shared library.
# BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
@@ -366,27 +242,17 @@
# <target_name>_EXPORTS is defined when a shared library compilation is
# detected.
#
#
#
# ::
#
# Flags passed into add_definitions with -D or /D are passed along to nvcc.
#
#
#
# The script defines the following variables:
#
# ::
# The script defines the following variables::
#
# CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
# CUDA_VERSION_MINOR -- The minor version.
# CUDA_VERSION
# CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
#
#
#
# ::
#
# CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
# CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
# SDK. This script will not directly support finding
@@ -412,13 +278,13 @@
# Only available for CUDA version 3.2+.
# CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
# Only available for CUDA version 3.2+.
# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives library.
# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib.
# Only available for CUDA version 4.0+.
# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives library (core).
# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core).
# Only available for CUDA version 5.5+.
# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives library (image processing).
# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# Only available for CUDA version 5.5+.
# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives library (signal processing).
# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing).
# Only available for CUDA version 5.5+.
# CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
# Only available for CUDA version 3.2+.
@@ -427,32 +293,15 @@
# Only available for CUDA version 3.2+.
# Windows only.
#
#
#
#
#
# ::
#
# James Bigler, NVIDIA Corp (nvidia.com - jbigler)
# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
#
#
#
# ::
#
# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
#
#
#
# ::
#
# Copyright (c) 2007-2009
# Scientific Computing and Imaging Institute, University of Utah
#
#
#
# ::
#
# This code is licensed under the MIT License. See the FindCUDA.cmake script
# for the text of the license.
@@ -481,11 +330,6 @@
# FindCUDA.cmake
# We need to have at least this version to support the VERSION_LESS argument to 'if' (2.6.2) and unset (2.6.3)
cmake_policy(PUSH)
cmake_minimum_required(VERSION 2.6.3)
cmake_policy(POP)
# This macro helps us find the location of helper files we will need the full path to
macro(CUDA_FIND_HELPER_FILE _name _extension)
set(_full_name "${_name}.${_extension}")
@@ -608,7 +452,17 @@ set(CUDA_NVCC_FLAGS "" CACHE STRING "Semi-colon delimit multiple arguments.")
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(CUDA_HOST_COMPILER "$(VCInstallDir)bin" CACHE FILEPATH "Host side compiler used by NVCC")
else()
set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC")
# Using cc which is symlink to clang may let NVCC think it is GCC and issue
# unhandled -dumpspecs option to clang. Also in case neither
# CMAKE_C_COMPILER is defined (project does not use C language) nor
# CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let
# nvcc use its own default C compiler.
if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER)
get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH)
else()
set(c_compiler_realpath "")
endif()
set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC")
endif()
# Propagate the host flags to the host compiler via -Xcompiler
@@ -675,14 +529,16 @@ endmacro()
# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed,
# if they have then clear the cache variables, so that will be detected again.
if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}")
if(DEFINED CUDA_TOOLKIT_ROOT_DIR_INTERNAL AND (NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}"))
unset(CUDA_TARGET_TRIPLET CACHE)
unset(CUDA_TOOLKIT_TARGET_DIR CACHE)
unset(CUDA_NVCC_EXECUTABLE CACHE)
unset(CUDA_VERSION CACHE)
cuda_unset_include_and_libraries()
endif()
if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}")
if(DEFINED CUDA_TARGET_TRIPLET_INTERNAL AND (NOT "${CUDA_TARGET_TRIPLET}" STREQUAL "${CUDA_TARGET_TRIPLET_INTERNAL}") OR
(DEFINED CUDA_TOOLKIT_TARGET_DIR AND DEFINED CUDA_TOOLKIT_TARGET_DIR_INTERNAL AND NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}"))
cuda_unset_include_and_libraries()
endif()
@@ -758,27 +614,54 @@ endif()
# Always set this convenience variable
set(CUDA_VERSION_STRING "${CUDA_VERSION}")
# Support for arm cross compilation with CUDA 5.5
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}")
if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
if(ANDROID AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
set(__cuda_toolkit_target_dir_initial "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
endif()
endif()
set(CUDA_TOOLKIT_TARGET_DIR "${__cuda_toolkit_target_dir_initial}" CACHE PATH "Toolkit target location.")
mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR)
# Target CPU architecture
if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
if(DEFINED CUDA_TARGET_CPU_ARCH)
set(_cuda_target_cpu_arch_initial "${CUDA_TARGET_CPU_ARCH}")
elseif(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|ARM)")
set(_cuda_target_cpu_arch_initial "ARM")
elseif(CUDA_VERSION VERSION_GREATER "6.5" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|AARCH64)")
set(_cuda_target_cpu_arch_initial "AARCH64")
else()
set(_cuda_target_cpu_arch_initial "")
endif()
set(CUDA_TARGET_CPU_ARCH ${_cuda_target_cpu_arch_initial} CACHE STRING "Specify the name of the class of CPU architecture for which the input files must be compiled.")
set(CUDA_TARGET_CPU_ARCH "${_cuda_target_cpu_arch_initial}" CACHE STRING "Specify the name of the class of CPU architecture for which the input files must be compiled.")
mark_as_advanced(CUDA_TARGET_CPU_ARCH)
# Target OS variant
if(DEFINED CUDA_TARGET_OS_VARIANT)
set(_cuda_target_os_variant_initial "${CUDA_TARGET_OS_VARIANT}")
else()
set(_cuda_target_os_variant_initial "")
endif()
set(CUDA_TARGET_OS_VARIANT "${_cuda_target_os_variant_initial}" CACHE STRING "Specify the name of the class of OS for which the input files must be compiled.")
mark_as_advanced(CUDA_TARGET_OS_VARIANT)
# Target triplet
if(DEFINED CUDA_TARGET_TRIPLET)
set(_cuda_target_triplet_initial "${CUDA_TARGET_TRIPLET}")
elseif(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND "x${CUDA_TARGET_CPU_ARCH}" STREQUAL "xARM")
if("${CUDA_TARGET_OS_VARIANT}" STREQUAL "Android" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-androideabi")
set(_cuda_target_triplet_initial "armv7-linux-androideabi")
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
set(_cuda_target_triplet_initial "armv7-linux-gnueabihf")
endif()
elseif(CUDA_VERSION VERSION_GREATER "6.5" AND CMAKE_CROSSCOMPILING AND "x${CUDA_TARGET_CPU_ARCH}" STREQUAL "xAARCH64")
if("${CUDA_TARGET_OS_VARIANT}" STREQUAL "Android" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux-androideabi")
set(_cuda_target_triplet_initial "aarch64-linux-androideabi")
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux-gnueabihf")
set(_cuda_target_triplet_initial "aarch64-linux-gnueabihf")
endif()
endif()
set(CUDA_TARGET_TRIPLET "${_cuda_target_triplet_initial}" CACHE STRING "Specify the target triplet for which the input files must be compiled.")
file(GLOB __cuda_available_target_tiplets RELATIVE "${CUDA_TOOLKIT_ROOT_DIR}/targets" "${CUDA_TOOLKIT_ROOT_DIR}/targets/*" )
set_property(CACHE CUDA_TARGET_TRIPLET PROPERTY STRINGS ${__cuda_available_target_tiplets})
mark_as_advanced(CUDA_TARGET_TRIPLET)
# Target directory
if(NOT DEFINED CUDA_TOOLKIT_TARGET_DIR AND CUDA_TARGET_TRIPLET AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/${CUDA_TARGET_TRIPLET}")
set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/${CUDA_TARGET_TRIPLET}")
endif()
# CUDA_TOOLKIT_INCLUDE
find_path(CUDA_TOOLKIT_INCLUDE
device_functions.h # Header included in toolkit
@@ -802,10 +685,16 @@ macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext )
# and old paths.
set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" )
endif()
if(CUDA_VERSION VERSION_GREATER "6.0")
set(_cuda_static_lib_names "")
foreach(name ${_names})
list(APPEND _cuda_static_lib_names "${name}_static")
endforeach()
endif()
# CUDA 3.2+ on Windows moved the library directories, so we need to new
# (lib/Win32) and the old path (lib).
find_library(${_var}
NAMES ${_names}
NAMES ${_names} ${_cuda_static_lib_names}
PATHS "${CUDA_TOOLKIT_TARGET_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}"
ENV CUDA_PATH
ENV CUDA_LIB_PATH
@@ -815,7 +704,7 @@ macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext )
)
# Search default search paths, after we search our own set of paths.
find_library(${_var}
NAMES ${_names}
NAMES ${_names} ${_cuda_static_lib_names}
PATHS "/usr/lib/nvidia-current"
DOC ${_doc}
)
@@ -853,18 +742,6 @@ if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
else()
set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
endif()
if(APPLE)
# We need to add the path to cudart to the linker using rpath, since the
# library name for the cuda libraries is prepended with @rpath.
if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
get_filename_component(_cuda_path_to_cudart "${CUDA_CUDARTEMU_LIBRARY}" PATH)
else()
get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
endif()
if(_cuda_path_to_cudart)
list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
endif()
endif()
# 1.1 toolkit on linux doesn't appear to have a separate library on
# some platforms.
@@ -997,6 +874,8 @@ set(CUDA_FOUND TRUE)
set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL
"This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE)
set(CUDA_TARGET_TRIPLET_INTERNAL "${CUDA_TARGET_TRIPLET}" CACHE INTERNAL
"This is the value of the last time CUDA_TARGET_TRIPLET was set successfully." FORCE)
set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL
"This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE)
set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL
@@ -1044,15 +923,15 @@ macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options)
set( ${_options} )
set( _found_options FALSE )
foreach(arg ${ARGN})
if(arg STREQUAL "OPTIONS")
if("x${arg}" STREQUAL "xOPTIONS")
set( _found_options TRUE )
elseif(
arg STREQUAL "WIN32" OR
arg STREQUAL "MACOSX_BUNDLE" OR
arg STREQUAL "EXCLUDE_FROM_ALL" OR
arg STREQUAL "STATIC" OR
arg STREQUAL "SHARED" OR
arg STREQUAL "MODULE"
"x${arg}" STREQUAL "xWIN32" OR
"x${arg}" STREQUAL "xMACOSX_BUNDLE" OR
"x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR
"x${arg}" STREQUAL "xSTATIC" OR
"x${arg}" STREQUAL "xSHARED" OR
"x${arg}" STREQUAL "xMODULE"
)
list(APPEND ${_cmake_options} ${arg})
else()
@@ -1148,7 +1027,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
endif()
endif()
# This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
# This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
# CMake source.
# Remove leading /
@@ -1177,7 +1056,7 @@ endfunction()
# a .cpp or .ptx file.
# INPUT:
# cuda_target - Target name
# format - PTX or OBJ
# format - PTX, CUBIN, FATBIN or OBJ
# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped.
# OPTIONS - Extra options to NVCC
# OUTPUT:
@@ -1223,8 +1102,14 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(nvcc_flags ${nvcc_flags} -m32)
endif()
if(CUDA_TARGET_CPU_ARCH)
set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}")
if(CUDA_TARGET_CPU_ARCH AND CUDA_VERSION VERSION_LESS "7.0")
# CPU architecture is either ARM or X86. Patch AARCH64 to be ARM
string(REPLACE "AARCH64" "ARM" CUDA_TARGET_CPU_ARCH_patched ${CUDA_TARGET_CPU_ARCH})
set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH_patched}")
endif()
if(CUDA_TARGET_OS_VARIANT AND CUDA_VERSION VERSION_LESS "7.0")
set(nvcc_flags ${nvcc_flags} "-target-os-variant=${CUDA_TARGET_OS_VARIANT}")
endif()
# This needs to be passed in at this stage, because VS needs to fill out the
@@ -1355,7 +1240,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
foreach(file ${ARGN})
# Ignore any file marked as a HEADER_FILE_ONLY
get_source_file_property(_is_header ${file} HEADER_FILE_ONLY)
if(${file} MATCHES ".*\\.cu$" AND NOT _is_header)
if(${file} MATCHES "\\.cu$" AND NOT _is_header)
# Allow per source file overrides of the format.
get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT)
@@ -1363,16 +1248,22 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(_cuda_source_format ${format})
endif()
if( ${_cuda_source_format} MATCHES "PTX" )
set( compile_to_ptx ON )
elseif( ${_cuda_source_format} MATCHES "OBJ")
set( compile_to_ptx OFF )
if( ${_cuda_source_format} MATCHES "OBJ")
set( cuda_compile_to_external_module OFF )
else()
message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS for file '${file}': '${_cuda_source_format}'. Use OBJ or PTX.")
set( cuda_compile_to_external_module ON )
if( ${_cuda_source_format} MATCHES "PTX" )
set( cuda_compile_to_external_module_type "ptx" )
elseif( ${_cuda_source_format} MATCHES "CUBIN")
set( cuda_compile_to_external_module_type "cubin" )
elseif( ${_cuda_source_format} MATCHES "FATBIN")
set( cuda_compile_to_external_module_type "fatbin" )
else()
message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.")
endif()
endif()
if(compile_to_ptx)
if(cuda_compile_to_external_module)
# Don't use any of the host compilation flags for PTX targets.
set(CUDA_HOST_FLAGS)
set(CUDA_NVCC_FLAGS_CONFIG)
@@ -1387,7 +1278,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
if(CUDA_GENERATED_OUTPUT_DIR)
set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}")
else()
if ( compile_to_ptx )
if ( cuda_compile_to_external_module )
set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}")
else()
set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}")
@@ -1397,10 +1288,10 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Add a custom target to generate a c or ptx file. ######################
get_filename_component( basename ${file} NAME )
if( compile_to_ptx )
if( cuda_compile_to_external_module )
set(generated_file_path "${cuda_compile_output_dir}")
set(generated_file_basename "${cuda_target}_generated_${basename}.ptx")
set(format_flag "-ptx")
set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}")
set(format_flag "-${cuda_compile_to_external_module_type}")
file(MAKE_DIRECTORY "${cuda_compile_output_dir}")
else()
set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}")
@@ -1423,7 +1314,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake")
# Setup properties for obj files:
if( NOT compile_to_ptx )
if( NOT cuda_compile_to_external_module )
set_source_files_properties("${generated_file}"
PROPERTIES
EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked.
@@ -1438,7 +1329,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
endif()
if( NOT compile_to_ptx AND CUDA_SEPARABLE_COMPILATION)
if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION)
list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}")
endif()
@@ -1455,7 +1346,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Build the NVCC made dependency file ###################################
set(build_cubin OFF)
if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
if ( NOT compile_to_ptx )
if ( NOT cuda_compile_to_external_module )
set ( build_cubin ON )
endif()
endif()
@@ -1482,8 +1373,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Create up the comment string
file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}")
if(compile_to_ptx)
set(cuda_build_comment_string "Building NVCC ptx file ${generated_file_relative_path}")
if(cuda_compile_to_external_module)
set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}")
else()
set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}")
endif()
@@ -1576,18 +1467,27 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
# If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here.
list( FIND nvcc_flags "-ccbin" ccbin_found0 )
list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 )
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 )
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
endif()
# Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG}
set(config_specific_flags)
set(flags)
foreach(config ${CUDA_configuration_types})
string(TOUPPER ${config} config_upper)
# Add config specific flags
foreach(f ${CUDA_NVCC_FLAGS_${config_upper}})
list(APPEND config_specific_flags $<$<CONFIG:${config}>:${f}>)
endforeach()
set(important_host_flags)
_cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}})
foreach(f ${important_host_flags})
list(APPEND flags $<$<CONFIG:${config}>:-Xcompiler> $<$<CONFIG:${config}>:${f}>)
endforeach()
endforeach()
# Add our general CUDA_NVCC_FLAGS with the configuration specifig flags
set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags})
file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}")
# Some generators don't handle the multiple levels of custom command
@@ -1713,21 +1613,29 @@ endmacro()
###############################################################################
###############################################################################
# CUDA COMPILE
# (Internal) helper for manually added cuda source files with specific targets
###############################################################################
###############################################################################
macro(CUDA_COMPILE generated_files)
macro(cuda_compile_base cuda_target format generated_files)
# Separate the sources from the options
CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN})
# Create custom commands and targets for each file.
CUDA_WRAP_SRCS( cuda_compile OBJ _generated_files ${_sources} ${_cmake_options}
CUDA_WRAP_SRCS( ${cuda_target} ${format} _generated_files ${_sources} ${_cmake_options}
OPTIONS ${_options} )
set( ${generated_files} ${_generated_files})
endmacro()
###############################################################################
###############################################################################
# CUDA COMPILE
###############################################################################
###############################################################################
macro(CUDA_COMPILE generated_files)
cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN})
endmacro()
###############################################################################
###############################################################################
@@ -1735,17 +1643,28 @@ endmacro()
###############################################################################
###############################################################################
macro(CUDA_COMPILE_PTX generated_files)
# Separate the sources from the options
CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN})
# Create custom commands and targets for each file.
CUDA_WRAP_SRCS( cuda_compile_ptx PTX _generated_files ${_sources} ${_cmake_options}
OPTIONS ${_options} )
set( ${generated_files} ${_generated_files})
cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN})
endmacro()
###############################################################################
###############################################################################
# CUDA COMPILE FATBIN
###############################################################################
###############################################################################
macro(CUDA_COMPILE_FATBIN generated_files)
cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN})
endmacro()
###############################################################################
###############################################################################
# CUDA COMPILE CUBIN
###############################################################################
###############################################################################
macro(CUDA_COMPILE_CUBIN generated_files)
cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN})
endmacro()
###############################################################################
###############################################################################
# CUDA ADD CUFFT TO TARGET
+2 -3
View File
@@ -37,12 +37,11 @@
file(READ ${input_file} depend_text)
if (${depend_text} MATCHES ".+")
if (NOT "${depend_text}" STREQUAL "")
# message("FOUND DEPENDS")
# Remember, four backslashes is escaped to one backslash in the string.
string(REGEX REPLACE "\\\\ " " " depend_text ${depend_text})
string(REPLACE "\\ " " " depend_text ${depend_text})
# This works for the nvcc -M generated dependency files.
string(REGEX REPLACE "^.* : " "" depend_text ${depend_text})

Some files were not shown because too many files have changed in this diff Show More