mirror of
https://github.com/opencv/opencv.git
synced 2026-07-22 03:43:03 +04:00
Compare commits
790 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f1356c3c5 | |||
| 14633bc857 | |||
| 2bba0f297b | |||
| 6c1638b132 | |||
| 1a6c2b37ea | |||
| 840c892abd | |||
| 09d8bbb138 | |||
| 832217907f | |||
| 26c5b846e6 | |||
| 59ce1d80a5 | |||
| 2f3e06ac1f | |||
| 37a63ca02b | |||
| 0d63bd575c | |||
| 257f60582a | |||
| bbdc987fc6 | |||
| 124011c321 | |||
| 8456d096d2 | |||
| 32c975b533 | |||
| a3a3670027 | |||
| b6a72826dd | |||
| 3d5cebb3ac | |||
| 131c09cf76 | |||
| 06f32e3b3e | |||
| b0a08cced9 | |||
| 82b7803a7a | |||
| 50ef9830e2 | |||
| 8ed4fb9405 | |||
| de82d9da9e | |||
| 715f8fcce0 | |||
| 3f3c8823ac | |||
| d9d9b05912 | |||
| 55171b25f8 | |||
| 3eb2c940de | |||
| bb8c19aad3 | |||
| b571f03016 | |||
| f605898bae | |||
| 5736bf5dd5 | |||
| 4f9c1da806 | |||
| eb1f3733ee | |||
| d993b9c1df | |||
| 4e16ae9a1f | |||
| ab86f15ba0 | |||
| 0a801354b1 | |||
| d99a4af229 | |||
| c1e9a7ee4b | |||
| 82a02d8585 | |||
| 8d907d2e32 | |||
| b7bb79c7c8 | |||
| 3903174f7c | |||
| a9771078df | |||
| eb1f7797e4 | |||
| aa666dfa9c | |||
| 3e710d8eec | |||
| 954098d1cb | |||
| e71758cfdf | |||
| cea3289bd4 | |||
| 00285a5e88 | |||
| 6fa23f330f | |||
| 857fba0878 | |||
| 53f6198f27 | |||
| f1dc26d7ce | |||
| 40a53e3d64 | |||
| e5f298cca5 | |||
| 85b1750660 | |||
| 92e86292dd | |||
| 05131af8da | |||
| 8422dda2c7 | |||
| 606622ab36 | |||
| d77612fe70 | |||
| 492a072ea8 | |||
| 3868cb44f1 | |||
| 6fbf6f8bea | |||
| e090ea3efd | |||
| a618d8bc9e | |||
| f26e86e4d8 | |||
| 9ff1c39daa | |||
| fe459c82e5 | |||
| cdf906b233 | |||
| ead7bc883d | |||
| 838624bf53 | |||
| 83c7dfb6a4 | |||
| c9e0c77d73 | |||
| 742f22c09b | |||
| 6ad8a9c09d | |||
| aee865fec9 | |||
| 0d439a9879 | |||
| 99f6f8ea9d | |||
| 39e448f7be | |||
| 80c2adbda1 | |||
| c26c43c69c | |||
| 26d2095dd6 | |||
| 2d5ccc7b3e | |||
| a0fed8d9ea | |||
| 4e29e2fc7d | |||
| a811059bfb | |||
| e43a5ff9be | |||
| 00c9ab8c23 | |||
| ccf96b9e05 | |||
| 3fe70d5cd5 | |||
| adb630ba3a | |||
| 5ed7d5a5d9 | |||
| 1f7728db35 | |||
| b7c134617d | |||
| fab0eb0d75 | |||
| 65f22292ed | |||
| b1064efb44 | |||
| df96159eb6 | |||
| 89f0e0a8d1 | |||
| 83c8214b38 | |||
| e991e05b9b | |||
| 223893ea5a | |||
| 5bd1cc44ec | |||
| 24acd5fb83 | |||
| 84ce2cc211 | |||
| 37d064f553 | |||
| 26cb154f40 | |||
| ca5455c592 | |||
| 82f4322d18 | |||
| 36b6bcb674 | |||
| 5a804e3c74 | |||
| 5ff76088b9 | |||
| 9fd822f97e | |||
| 3c49b1dbbe | |||
| ad35b79e3f | |||
| 342366e314 | |||
| 2f6f52d644 | |||
| dc80f9d0fb | |||
| ad0d812aa0 | |||
| 724620b476 | |||
| 736683ce2f | |||
| e9e8bf4b81 | |||
| e1a2c034e8 | |||
| 6b346c92be | |||
| adf2013052 | |||
| a1c073d289 | |||
| 45d2e18808 | |||
| e1ac8589f8 | |||
| 6e67fd2752 | |||
| 474a0dac49 | |||
| 495cadddbd | |||
| 60b13d50c9 | |||
| eaf39f6b6b | |||
| 2075fa9c15 | |||
| b6367f5821 | |||
| d7272f76fb | |||
| 1317c3d178 | |||
| 36432cf4d9 | |||
| 605071e76f | |||
| 94d7c0f7f5 | |||
| 0d117312c9 | |||
| 183bc5c281 | |||
| a1fe8f754f | |||
| dd3398416b | |||
| cf86af96ea | |||
| 780ae864a0 | |||
| 96c99c716a | |||
| 73a17baeec | |||
| c26dd5d7aa | |||
| 954969dd74 | |||
| 43002c0c1d | |||
| e580061b74 | |||
| 53af811530 | |||
| b58a8729c2 | |||
| ee417048e5 | |||
| a4b21d9e2e | |||
| b321851e53 | |||
| 1d5a528107 | |||
| a68835f7f1 | |||
| f2bec05e6d | |||
| c371df4aa2 | |||
| 9ea8c775f8 | |||
| e8e2197032 | |||
| c4c31f5bba | |||
| 9ad1a84853 | |||
| f5b6bea2d4 | |||
| ce6acd3ecd | |||
| 1c04a5ec47 | |||
| 2fa9bd221d | |||
| 9ca82caeb7 | |||
| 5cf84c3765 | |||
| 3d68b5baa1 | |||
| 8792bddb0a | |||
| e5afa62c3d | |||
| 33e824f5de | |||
| 6820abd67f | |||
| b5c54e447c | |||
| 96c71dd3d2 | |||
| 02d2cc58d7 | |||
| 452f0bb2ab | |||
| 10b482ff1e | |||
| 42742727d6 | |||
| 47cb94e634 | |||
| 80265a0815 | |||
| 70ac734263 | |||
| b24a815ac1 | |||
| 1a27ff4518 | |||
| cae2992af1 | |||
| 265cb58750 | |||
| b5610e77a7 | |||
| 48cf103441 | |||
| 82c2aa6e65 | |||
| c54676d625 | |||
| 6c76c8f881 | |||
| 93d1785820 | |||
| 801c943009 | |||
| 96ee83898d | |||
| 56eebb926d | |||
| 57a30a1dd8 | |||
| 142a07cbbf | |||
| 0e9ac7265d | |||
| 858a7da5c0 | |||
| 82e8657a6d | |||
| 8675a8c743 | |||
| 533bfba75c | |||
| afa0f80c61 | |||
| 2dd98e7cc6 | |||
| 596ada51f3 | |||
| 28fd967148 | |||
| 8396ae6e4f | |||
| 5059523937 | |||
| 2da56d5af6 | |||
| b74b05d1b3 | |||
| 0c261acf3a | |||
| 4b298a7460 | |||
| 6adbbcdde1 | |||
| 92a58a0eae | |||
| bb7cfcbcdb | |||
| 467eb4d240 | |||
| cfb30572cb | |||
| f30eafc9ac | |||
| 13ede34516 | |||
| e5d7f446d6 | |||
| c72b6b3be8 | |||
| 028ecc6c02 | |||
| 92a015b8bd | |||
| cdaca22511 | |||
| fb96b7da60 | |||
| dc9e6d3af8 | |||
| eebf0dd7c9 | |||
| 6b3469268e | |||
| e75576e1ab | |||
| d9be552bbc | |||
| 18c44b2ce8 | |||
| 4531f9f2f4 | |||
| 30b16e0a5a | |||
| fa91e4ff27 | |||
| d4e3405db2 | |||
| 857b64efef | |||
| 572af7640f | |||
| cceeca3052 | |||
| d9d8ad20a0 | |||
| eaee63d96b | |||
| cae2a53563 | |||
| 5132102863 | |||
| 4395c1b9f8 | |||
| 79dc0ed175 | |||
| b3d201f148 | |||
| 2007e1d8a3 | |||
| c6d2f0399a | |||
| ce00d38bd9 | |||
| 877de883b0 | |||
| d9b8a9d90e | |||
| 30bf4a5e34 | |||
| 0fda551dbc | |||
| a724525c00 | |||
| 36d00f0200 | |||
| dbc6fe3a0f | |||
| fbe41703e4 | |||
| 0cd14e3fb4 | |||
| a1816e8c77 | |||
| e6c41f0de6 | |||
| b4398d62b2 | |||
| fc21b15d6e | |||
| 733fec020b | |||
| a6f9170f10 | |||
| 4d0ed5c13c | |||
| fcb56a5460 | |||
| 98a73de526 | |||
| b669e9f648 | |||
| ebdc870296 | |||
| 850053f9ca | |||
| 8cb8ba7caf | |||
| fa91d621fa | |||
| 2268ed1b6e | |||
| 93ffebc273 | |||
| 76b6f6b017 | |||
| 7a884ab6a5 | |||
| 792079ad33 | |||
| a9d77b5c64 | |||
| 7767352572 | |||
| aba66352dd | |||
| 6c444ced08 | |||
| 4e633d1f78 | |||
| 012f36e47d | |||
| 1196eb33fc | |||
| 4bea70a64a | |||
| d37164bab6 | |||
| cc2f8f1778 | |||
| daff6e6484 | |||
| eea0f7fd76 | |||
| 3e0c72ea84 | |||
| 3972c526ce | |||
| 75f67ed207 | |||
| 644846c702 | |||
| defeda2f70 | |||
| 4102855edd | |||
| 602989ae9e | |||
| 88f60113a5 | |||
| f50b58b509 | |||
| 223d7cfb38 | |||
| 7e2c65ce3c | |||
| b184b19970 | |||
| 55676b7173 | |||
| 92f754c675 | |||
| aa6e296236 | |||
| 7f608db244 | |||
| d61ad04f11 | |||
| 28a14df26c | |||
| d305fd4fca | |||
| 8486f1b8f0 | |||
| a1bd39441f | |||
| 9a12aa45ad | |||
| 2c029aae46 | |||
| 3523e0a56c | |||
| 2933b58a2f | |||
| 1c1d653f3a | |||
| e397434cb6 | |||
| ad356e3239 | |||
| c8fc8d210b | |||
| 7a3cb2280b | |||
| 8b26906d6d | |||
| 9a76322ef9 | |||
| 0f07edded6 | |||
| d3f75df0a6 | |||
| 971c4ca10b | |||
| 73f65b1ccf | |||
| 1fbaa48cec | |||
| 6974fce183 | |||
| d6a8e08acc | |||
| d8ffddd075 | |||
| a692d87cfb | |||
| e7015f6ae8 | |||
| 9c9fb1c6d0 | |||
| 80c64fce11 | |||
| 237b867721 | |||
| a7dfa261d8 | |||
| 4d1f0ef2d9 | |||
| df6728e64c | |||
| 7a73941f22 | |||
| 6d9e66eca1 | |||
| 365451dab0 | |||
| c09a3cf098 | |||
| 842341fc16 | |||
| 32a5e5fae1 | |||
| 85b9960f62 | |||
| 5640b36f6d | |||
| c8e6ce304f | |||
| 1c468add20 | |||
| 24ced3d657 | |||
| c5a5d7eb51 | |||
| ab2c16b2e5 | |||
| 113793fee7 | |||
| b54a70a538 | |||
| a66fd527b0 | |||
| 6d2cfac303 | |||
| f8a27d2603 | |||
| f185640eda | |||
| 72eccb7694 | |||
| 803f86b9ca | |||
| 7bac615d8f | |||
| dc3406eed9 | |||
| 1cc3f7abbb | |||
| 70177143a7 | |||
| 43d9256096 | |||
| 803ff64b14 | |||
| 824241ad5c | |||
| 5677a683a5 | |||
| c813ad5533 | |||
| 0b77600718 | |||
| 429a643f42 | |||
| d2a66d3c99 | |||
| 0f41daeba5 | |||
| 1be75437b7 | |||
| 978ad4981e | |||
| 8c4f886f5f | |||
| 0d63c4c28e | |||
| 6843d368b2 | |||
| 24af70c7e0 | |||
| 9dc1d388af | |||
| 28cb714a09 | |||
| 91c6d36ff8 | |||
| be76b451cb | |||
| 53785b6ac6 | |||
| 2332fb852d | |||
| 8edff1065a | |||
| 41398987c3 | |||
| de8024ce4a | |||
| 7b9b876726 | |||
| 944710de4e | |||
| 2b3c7490d5 | |||
| 8965f3ae06 | |||
| 5771fd693d | |||
| 1ff11c84ab | |||
| 5faaa28870 | |||
| 761c269e47 | |||
| 131d199ae3 | |||
| 4e62900009 | |||
| 7813eef92b | |||
| cc10e6b344 | |||
| 11e2a216c5 | |||
| 404893810c | |||
| 53ec8f286b | |||
| 70f2ee917e | |||
| ad93ed720d | |||
| cc3ec5d453 | |||
| 288251e672 | |||
| 421fdc0e94 | |||
| c4d434fd6f | |||
| b8aa0cddab | |||
| 50811e04f2 | |||
| 449826288b | |||
| 68fe37b008 | |||
| 26ba4f3c1d | |||
| e19b422854 | |||
| 913c4151bf | |||
| 78a802baae | |||
| 9d602f2752 | |||
| 7649e537b7 | |||
| 2faa4cd933 | |||
| 0492301e76 | |||
| 18bf91a08b | |||
| 09ef4c9cff | |||
| 634dd656d5 | |||
| 9d02d42afe | |||
| c716e374c1 | |||
| aeec6e43eb | |||
| 630a94b8b7 | |||
| ceca139f7f | |||
| da5e0ef461 | |||
| 4fa6734320 | |||
| 0926a84a45 | |||
| 0101fa789c | |||
| 12b3d157a5 | |||
| 60c26f8f1e | |||
| 7294ae0f17 | |||
| 0ffc186680 | |||
| 50beef605b | |||
| 068ebe8b4d | |||
| ffaf58349c | |||
| eec468fa13 | |||
| 81c94357e8 | |||
| 042c486b68 | |||
| 6921f967a1 | |||
| 83a0c12144 | |||
| fa8684b5c8 | |||
| 283348afc3 | |||
| ee0c985491 | |||
| b41f38ecc7 | |||
| 682180e0cd | |||
| 1385db48f5 | |||
| 94201b7cf9 | |||
| 15632c6305 | |||
| 6b84990620 | |||
| c9b6b2cf04 | |||
| 617fe2545c | |||
| 93663dc57a | |||
| 28e55dc5f3 | |||
| 9253e8bda2 | |||
| 0f031b6680 | |||
| 255b20f6de | |||
| ac9ec55b37 | |||
| df4139d373 | |||
| 1059735bfb | |||
| 8f2eb60719 | |||
| a1ffc00ba8 | |||
| 1a81a97e9f | |||
| e6ef9221cb | |||
| ee84ae0551 | |||
| bd04568baf | |||
| 8ecdd215b6 | |||
| 5a3bca8d5c | |||
| 9b9f38afc8 | |||
| 4fea6179a0 | |||
| 055f177a6a | |||
| 3c5a6be835 | |||
| 4b895a4d1f | |||
| e9f99063c7 | |||
| 9f0ff03da5 | |||
| 9ba659af84 | |||
| be989b3b60 | |||
| 0706bd72b8 | |||
| f6dc396a0f | |||
| 48e8e76a34 | |||
| fae329a0ca | |||
| 52f52f6786 | |||
| fe56bdeeb9 | |||
| b34d86ca24 | |||
| 24ab751547 | |||
| c8f3579f93 | |||
| 962dc21f2b | |||
| 43e66e7ff9 | |||
| ad5898224d | |||
| f8398d80bc | |||
| 9faacfbc0d | |||
| a610be6335 | |||
| 6a5266df79 | |||
| 238a3806b0 | |||
| a07a4cefe1 | |||
| a0211a1c2f | |||
| 47bb09bc4b | |||
| 93b0b03447 | |||
| 0a23c1bf11 | |||
| ecef7f7930 | |||
| 5db13fe2a7 | |||
| 9932612373 | |||
| 6203c95d31 | |||
| d5d19a9f67 | |||
| f33f236ab6 | |||
| 95b1fe0776 | |||
| 35bee663eb | |||
| 98f6ea0785 | |||
| e0a5824028 | |||
| 87b1835cb6 | |||
| ec9c53eeff | |||
| d3eed2cf23 | |||
| 51f7eb3a3c | |||
| b35fbff675 | |||
| 15e9e3304c | |||
| 3961b214f0 | |||
| 8ac7b21716 | |||
| de54d45afd | |||
| 3cab9e7a9c | |||
| b0ad7f759a | |||
| 30597e5c98 | |||
| 70f38b4dfa | |||
| d389edd843 | |||
| 27a4e370f9 | |||
| b4fd3e8674 | |||
| 43f889ae1f | |||
| 7d75526373 | |||
| ecc9bd0925 | |||
| d259eb28bb | |||
| 76d4aa0c06 | |||
| 2113818f19 | |||
| 29bee6f07e | |||
| a7b3d2581f | |||
| 3512cb2226 | |||
| 96a50d5eb0 | |||
| 79db32bcd9 | |||
| 14b438317e | |||
| 6d5f7b72c0 | |||
| cecb878915 | |||
| 29c10b6792 | |||
| 92ec971453 | |||
| 95502242c9 | |||
| 1f88a1af9c | |||
| 65e2961fee | |||
| c5687caf1a | |||
| 5d54def264 | |||
| dbfeb8892d | |||
| 949d7d7d25 | |||
| 451340fd3d | |||
| fdaeb20253 | |||
| 29770e13e8 | |||
| e51d7cb3d8 | |||
| d66f3efd36 | |||
| f512bf7004 | |||
| 63affb2be9 | |||
| 87b1100027 | |||
| 78c500e97a | |||
| a4f53988c4 | |||
| 347e09cd07 | |||
| 095b0d3272 | |||
| b7b82c1cef | |||
| cb5da8983f | |||
| 796795ac89 | |||
| 3e8934dec0 | |||
| 58ac3e09da | |||
| 09fa758725 | |||
| 57ae3ac7a2 | |||
| 6fc855865f | |||
| f4b9acb4db | |||
| acbfd85737 | |||
| 03b3be0f51 | |||
| 38f8fc6c82 | |||
| 7828854c9d | |||
| d7ac4495c3 | |||
| 492ef14550 | |||
| be2ccdbf0b | |||
| 88b04c3cd4 | |||
| 1fb7ee0e16 | |||
| 8f78a1123b | |||
| d7885ed819 | |||
| b9fd5f8186 | |||
| 0c8590027f | |||
| 0a5bd0ac8b | |||
| 2f929376ec | |||
| 30a4e2f7ac | |||
| 8e0781648b | |||
| c331a214d0 | |||
| c35c5a47df | |||
| 17cc21c9d6 | |||
| 5e241e7c36 | |||
| 92517fa359 | |||
| 95dd4b3f27 | |||
| 87ed12b8f3 | |||
| 53bbed89ae | |||
| 286c2c236b | |||
| 875de75327 | |||
| a39e0daacf | |||
| f3fae0dae0 | |||
| f90aea22b1 | |||
| bd98ed46bd | |||
| 8b48c2a10c | |||
| f1f15841d7 | |||
| 80b62a41c6 | |||
| 54279523a3 | |||
| 24e72e151a | |||
| 8a3c394d6a | |||
| ad146e5a6b | |||
| 66d15e89df | |||
| d486204a0d | |||
| 07c6b0a8df | |||
| 8e8315abfd | |||
| a18da0c55e | |||
| d621a99e73 | |||
| 107660c7ba | |||
| b33cb2e3f2 | |||
| e70526625f | |||
| 8a328e393d | |||
| 9fae8070dc | |||
| 6ec230480d | |||
| c441ad36c8 | |||
| 59cd636ad7 | |||
| 3f3d805663 | |||
| 351ee2e3a5 | |||
| 7f7f30a08b | |||
| fda99c1c6c | |||
| 71c8de8fa1 | |||
| 27a6be8763 | |||
| acce95f446 | |||
| a78e5344df | |||
| e5236cecd6 | |||
| 6aff916aa5 | |||
| 4f9db2c03a | |||
| 9988e1b6ee | |||
| afb81ba6e6 | |||
| 0f0a82b619 | |||
| 2cf34c0fe5 | |||
| 49a1328046 | |||
| 2877f17372 | |||
| 00cbb894ec | |||
| a0f86479e0 | |||
| f9a5c4d181 | |||
| d71812425a | |||
| aa5c45339c | |||
| 1e362ff5c3 | |||
| fc71316690 | |||
| cb7ee27cd9 | |||
| c7cf8fb35c | |||
| 8b0e1c7fcb | |||
| e3af72bb68 | |||
| ec3492a22a | |||
| 07808c8d5d | |||
| 436e330642 | |||
| a11d944f51 | |||
| c85e44697e | |||
| af883e88e1 | |||
| 3dddf703a9 | |||
| f7ccc74e09 | |||
| 546fcd990e | |||
| 5eb295adf3 | |||
| 20bf7b6a79 | |||
| af769e4ec8 | |||
| 70a27c7dd6 | |||
| 701760dbeb | |||
| 0f9f2696be | |||
| 65a0587ce8 | |||
| f9c8bb40b1 | |||
| 7d3a1657c9 | |||
| f36790d521 | |||
| 0f2b535fcc | |||
| e345cb03d5 | |||
| f33cbe94dd | |||
| e13f6ded7f | |||
| 4b03a4a841 | |||
| bab4f4f5d8 | |||
| a08c6e49b3 | |||
| 50bceea038 | |||
| 9e42204e67 | |||
| c557193b8c | |||
| 3e6b3a6856 | |||
| d52cef1719 | |||
| 0d4fd20a73 | |||
| 0515f930e8 | |||
| 32a02544de | |||
| fc1dee685e | |||
| c894fc5bae | |||
| e1ee744e15 | |||
| e86287d8ae | |||
| 4c7d521413 | |||
| ade57c8bd0 | |||
| ea43e28a37 | |||
| 258a769567 | |||
| 7845f6d95c | |||
| be48cdc747 | |||
| 8ef2d19337 | |||
| cecf84410c | |||
| 596a0125ed | |||
| 8a8d07fb17 | |||
| 72f422c7dc | |||
| ca51bbb7ff | |||
| 4062ef5fcb | |||
| 1ae477a46d | |||
| 087e9308ec | |||
| d13db35f31 | |||
| b38c50b3d0 | |||
| dd06540e1f | |||
| 50b61668e2 | |||
| 1df84f7246 | |||
| bdc34984f1 | |||
| af0c930e77 | |||
| bb45bf9695 | |||
| 4e0d2a3e6c | |||
| da6d8961fc | |||
| 3e027df583 | |||
| bed388bafb | |||
| 6477262e63 | |||
| f79599f949 | |||
| c94d75874b | |||
| 21f3987d53 | |||
| d10a219833 | |||
| bd7bf39b4b | |||
| 472b71ecef | |||
| 4f360f8b1a | |||
| e8d45a9cdd | |||
| ff2eface19 | |||
| 29ce348c4d | |||
| b2a4069f55 | |||
| 4d78342919 | |||
| 1272332ae3 | |||
| b47c9ac643 | |||
| 1c20a7f008 | |||
| 6700fdb81f | |||
| 096366738b | |||
| 6a6506b02d | |||
| 59ccf2c9e0 | |||
| 2c42361ecd | |||
| 18833d5121 | |||
| f25450791b | |||
| c9faa09d55 | |||
| 1deeca985f | |||
| 6acabd1fd8 | |||
| 5ac9a2a7d0 | |||
| 808c89adc1 | |||
| a527e8cc73 | |||
| 10c570b558 | |||
| 76f47548b3 | |||
| 67d46dfc6c | |||
| 3c03fb56e0 | |||
| 378cf2ab63 | |||
| c6f5b013ec | |||
| e593d5bbc5 | |||
| 3f5c3ddd27 | |||
| ab8ba047a5 | |||
| cecc19381f | |||
| 6e84abc746 | |||
| 322c6b1ba4 | |||
| 73d44c7881 | |||
| 31fef14d76 | |||
| 7ee69740e8 | |||
| c61bc3a0cb | |||
| b24fc6954d | |||
| 828cb4286d | |||
| ee5e0e16d9 | |||
| b907bfe3e7 | |||
| f84eb3dde6 | |||
| b996b618e0 | |||
| 98c5ce9347 | |||
| f89defad5d | |||
| 96f92c6705 | |||
| f0c46a4c74 | |||
| 9752d45c87 | |||
| 860ae77ec9 | |||
| 1567a65475 | |||
| d2e08a524e | |||
| 216cd7dc61 | |||
| 4910f16f16 | |||
| 5b3ac112fe | |||
| f2e1710dd5 |
@@ -0,0 +1,31 @@
|
||||
# https://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[{CMakeLists.*,*.cmake}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
|
||||
[*.{bat,cmd,cmd.*}]
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{ps1,ps1.*}]
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{md,markdown}]
|
||||
indent_size = 2
|
||||
Vendored
+1
-1
@@ -53,7 +53,7 @@ endif()
|
||||
set(CAROTENE_NS "carotene_o4t" CACHE STRING "" FORCE)
|
||||
|
||||
function(compile_carotene)
|
||||
if(ENABLE_NEON)
|
||||
if(";${CPU_BASELINE_FINAL};" MATCHES ";NEON;")
|
||||
set(WITH_NEON ON)
|
||||
endif()
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ $output = "$PSScriptRoot\@OPENCV_BIN_INSTALL_PATH@\opencv_ffmpeg@OPENCV_DLLVERSI
|
||||
|
||||
Write-Output ("=" * 120)
|
||||
try {
|
||||
Get-content -Path "$PSScriptRoot\etc\licenses\ffmpeg-readme.txt" -ErrorAction 'Stop'
|
||||
Get-content -Path "$PSScriptRoot\@OPENCV_LICENSES_INSTALL_PATH@\ffmpeg-readme.txt" -ErrorAction 'Stop'
|
||||
} catch {
|
||||
Write-Output "Refer to OpenCV FFmpeg wrapper readme notes about library usage / licensing details."
|
||||
}
|
||||
|
||||
Vendored
+7
-5
@@ -1,8 +1,8 @@
|
||||
# Binaries branch name: ffmpeg/3.4_20180608
|
||||
# Binaries were created for OpenCV: f5ddbbf65937d8f44e481e4ee1082961821f5c62
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "8041bd6f5ad37045c258904ba3030bb3442e3911")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "fa5a2a4e2f37defcb95bde8ed145c2b3")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "2cc08fc4fef8199fe80e0f126684834f")
|
||||
# Binaries branch name: ffmpeg/3.4_20181103
|
||||
# Binaries were created for OpenCV: c6d2f0399a706028f476f3d08358ea787503020d
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "fe71c0ad807fdc33c2178e48e488f1e9b177c39a")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "41b81bb9a50cabd4bea385f7b50a069a")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "a9ea7dbbc8e5afd08e00e223a831b578")
|
||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "3b90f67f4b429e77d3da36698cef700c")
|
||||
|
||||
function(download_win_ffmpeg script_var)
|
||||
@@ -40,3 +40,5 @@ if(OPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT)
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/ffmpeg-download.ps1.in" "${CMAKE_BINARY_DIR}/win-install/ffmpeg-download.ps1" @ONLY)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/ffmpeg-download.ps1" DESTINATION "." COMPONENT libs)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(ffmpeg license.txt readme.txt)
|
||||
|
||||
Vendored
+13
-13
@@ -2,37 +2,37 @@ function(download_ippicv root_var)
|
||||
set(${root_var} "" PARENT_SCOPE)
|
||||
|
||||
# Commit SHA in the opencv_3rdparty repo
|
||||
set(IPPICV_COMMIT "bdb7bb85f34a8cb0d35e40a81f58da431aa1557a")
|
||||
set(IPPICV_COMMIT "32e315a5b106a7b89dbed51c28f8120a48b368b4")
|
||||
# Define actual ICV versions
|
||||
if(APPLE)
|
||||
set(OPENCV_ICV_PLATFORM "macosx")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u3_mac_intel64_general_20180518.tgz")
|
||||
set(OPENCV_ICV_HASH "3ae52b9be0fe73dd45bc5e9429cd3732")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_mac_intel64_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u3_mac_ia32_general_20180518.tgz")
|
||||
set(OPENCV_ICV_HASH "698660b975b62bee3ef6c5af51e97544")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_mac_ia32_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "b5dfa78c87eb75c64470cbe5ec876f4f")
|
||||
endif()
|
||||
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
|
||||
set(OPENCV_ICV_PLATFORM "linux")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u3_lnx_intel64_general_20180518.tgz")
|
||||
set(OPENCV_ICV_HASH "b7cc351267db2d34b9efa1cd22ff0572")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_lnx_intel64_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "c0bd78adb4156bbf552c1dfe90599607")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u3_lnx_ia32_general_20180518.tgz")
|
||||
set(OPENCV_ICV_HASH "ea72de74dae3c604eb6348395366e78e")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_lnx_ia32_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "4f38432c30bfd6423164b7a24bbc98a0")
|
||||
endif()
|
||||
elseif(WIN32 AND NOT ARM)
|
||||
set(OPENCV_ICV_PLATFORM "windows")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u3_win_intel64_general_20180518.zip")
|
||||
set(OPENCV_ICV_HASH "915ff92958089ede8ea532d3c4fe7187")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_win_intel64_20180723_general.zip")
|
||||
set(OPENCV_ICV_HASH "1d222685246896fe089f88b8858e4b2f")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u3_win_ia32_general_20180518.zip")
|
||||
set(OPENCV_ICV_HASH "928168c2d99ab284047dfcfb7a821d91")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_win_ia32_20180723_general.zip")
|
||||
set(OPENCV_ICV_HASH "0157251a2eb9cd63a3ebc7eed0f3e59e")
|
||||
endif()
|
||||
else()
|
||||
return()
|
||||
|
||||
Vendored
+39
-19
@@ -1,4 +1,3 @@
|
||||
#if 0
|
||||
CHANGES - changes for libpng
|
||||
|
||||
version 0.1 [March 29, 1995]
|
||||
@@ -1454,7 +1453,7 @@ Version 1.2.6beta4 [July 28, 2004]
|
||||
sequential read support.
|
||||
Added some "#if PNG_WRITE_SUPPORTED" blocks.
|
||||
Added #ifdef to remove some redundancy in png_malloc_default().
|
||||
Use png_malloc instead of png_zalloc to allocate the pallete.
|
||||
Use png_malloc instead of png_zalloc to allocate the palette.
|
||||
|
||||
Version 1.0.16rc1 and 1.2.6rc1 [August 4, 2004]
|
||||
Fixed buffer overflow vulnerability (CVE-2004-0597) in png_handle_tRNS().
|
||||
@@ -3259,7 +3258,7 @@ Version 1.5.2beta01 [February 13, 2011]
|
||||
Revised PNG_EXPORTA macro to not use an empty parameter, to accommodate the
|
||||
old VisualC++ preprocessor.
|
||||
Turned on interlace handling in png_read_png().
|
||||
Fixed gcc pendantic warnings.
|
||||
Fixed gcc pedantic warnings.
|
||||
Handle longjmp in Cygwin.
|
||||
Fixed png_get_current_row_number() in the interlaced case.
|
||||
Cleaned up ALPHA flags and transformations.
|
||||
@@ -3359,7 +3358,7 @@ Version 1.5.3beta05 [May 6, 2011]
|
||||
Pass "" instead of '\0' to png_default_error() in png_err(). This mistake
|
||||
was introduced in libpng-1.2.20beta01. This fixes CVE-2011-2691.
|
||||
Added PNG_WRITE_OPTIMIZE_CMF_SUPPORTED macro to make the zlib "CMF" byte
|
||||
optimization configureable.
|
||||
optimization configurable.
|
||||
IDAT compression failed if preceded by a compressed text chunk (bug
|
||||
introduced in libpng-1.5.3beta01-02). This was because the attempt to
|
||||
reset the zlib stream in png_write_IDAT happened after the first IDAT
|
||||
@@ -3643,7 +3642,7 @@ Version 1.5.6beta05 [October 12, 2011]
|
||||
Fixed bug in png_write_chunk_header() debug print, introduced in 1.5.6beta01.
|
||||
|
||||
Version 1.5.6beta06 [October 17, 2011]
|
||||
Removed two redundant tests for unitialized row.
|
||||
Removed two redundant tests for uninitialized row.
|
||||
Fixed a relatively harmless memory overwrite in compressed text writing
|
||||
with a 1 byte zlib buffer.
|
||||
Add ability to call png_read_update_info multiple times to pngvalid.c.
|
||||
@@ -3689,7 +3688,7 @@ Version 1.5.7beta01 [November 4, 2011]
|
||||
crash. The pngmem.c implementation of png_malloc() included a cast
|
||||
to png_size_t which would fail on large allocations on 16-bit systems.
|
||||
Fix for the preprocessor of the Intel C compiler. The preprocessor
|
||||
splits adjacent @ signs with a space; this changes the concatentation
|
||||
splits adjacent @ signs with a space; this changes the concatenation
|
||||
token from @-@-@ to PNG_JOIN; that should work with all compiler
|
||||
preprocessors.
|
||||
Paeth filter speed improvements from work by Siarhei Siamashka. This
|
||||
@@ -3735,7 +3734,7 @@ Version 1.5.7beta03 [November 17, 2011]
|
||||
gray (on palette) itself.
|
||||
Fixes for C++ compilation using g++ When libpng source is compiled
|
||||
using g++. The compiler imposes C++ rules on the C source; thus it
|
||||
is desireable to make the source work with either C or C++ rules
|
||||
is desirable to make the source work with either C or C++ rules
|
||||
without throwing away useful error information. This change adds
|
||||
png_voidcast to allow C semantic (void*) cases or the corresponding
|
||||
C++ static_cast operation, as appropriate.
|
||||
@@ -4061,7 +4060,7 @@ Version 1.6.0beta17 [March 10, 2012]
|
||||
possible to call png_inflate() incrementally. A warning is no longer
|
||||
issued if the language tag or translated keyword in the iTXt chunk
|
||||
has zero length.
|
||||
If benign errors are disabled use maximum window on ancilliary inflate.
|
||||
If benign errors are disabled use maximum window on ancillary inflate.
|
||||
This works round a bug introduced in 1.5.4 where compressed ancillary
|
||||
chunks could end up with a too-small windowBits value in the deflate
|
||||
header.
|
||||
@@ -4176,7 +4175,7 @@ Version 1.6.0beta27 [August 11, 2012]
|
||||
declared even though the functions are never actually defined. This
|
||||
change provides a dummy definition so that the declarations work, yet any
|
||||
implementation will fail to compile because of an incomplete type.
|
||||
Re-eliminated the use of strcpy() in pngtest.c. An unncessary use of
|
||||
Re-eliminated the use of strcpy() in pngtest.c. An unnecessary use of
|
||||
strcpy() was accidentally re-introduced in libpng16; this change replaces
|
||||
it with strncpy().
|
||||
Eliminated use of png_sizeof(); use sizeof() instead.
|
||||
@@ -4309,7 +4308,7 @@ Version 1.6.0beta31 [November 1, 2012]
|
||||
resulting in VS2010 having to update the files.
|
||||
Removed non-working ICC profile support code that was mostly added to
|
||||
libpng-1.6.0beta29 and beta30. There was too much code for too little
|
||||
gain; implementing full ICC color correction may be desireable but is left
|
||||
gain; implementing full ICC color correction may be desirable but is left
|
||||
up to applications.
|
||||
|
||||
Version 1.6.0beta32 [November 25, 2012]
|
||||
@@ -4592,7 +4591,7 @@ Version 1.6.3beta07 [June 8, 2013]
|
||||
the optimizations ('check' vs 'api') are exposed in the public header files
|
||||
except that the new setting PNG_ARM_NEON_OPT documents how libpng makes the
|
||||
decision about whether or not to use the optimizations.
|
||||
Protect symbol prefixing against CC/CPPFLAGS/CFLAGS useage.
|
||||
Protect symbol prefixing against CC/CPPFLAGS/CFLAGS usage.
|
||||
Previous iOS/Xcode fixes for the ARM NEON optimizations moved the test
|
||||
on __ARM_NEON__ from configure time to compile time. This breaks symbol
|
||||
prefixing because the definition of the special png_init_filter_functions
|
||||
@@ -5635,7 +5634,7 @@ Version 1.6.24beta02 [June 23, 2016]
|
||||
to All and adds a list of the warnings that need to be turned off. This is
|
||||
semi-documentary; the intent is to tell libpng users which warnings have
|
||||
been examined and judged non-fixable at present. The warning about
|
||||
structure padding is fixable, but it would be a signficant change (moving
|
||||
structure padding is fixable, but it would be a significant change (moving
|
||||
structure members around).
|
||||
|
||||
Version 1.6.24beta03 [July 4, 2016]
|
||||
@@ -5781,7 +5780,7 @@ Version 1.6.28rc01 [January 3, 2017]
|
||||
Added option to Cmake build allowing a custom location of zlib to be
|
||||
specified in a scenario where libpng is being built as a subproject
|
||||
alongside zlib by another project (Sam Serrels).
|
||||
Changed png_ptr->options from a png_byte to png_uint_32, to accomodate
|
||||
Changed png_ptr->options from a png_byte to png_uint_32, to accommodate
|
||||
up to 16 options.
|
||||
|
||||
Version 1.6.28rc02 [January 4, 2017]
|
||||
@@ -5932,7 +5931,7 @@ Version 1.6.32beta04 [August 2, 2017]
|
||||
Update libpng.3 and libpng-manual.txt about eXIf functions.
|
||||
|
||||
Version 1.6.32beta05 [August 2, 2017]
|
||||
Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.
|
||||
Restored png_get_eXIf() and png_set_eXIf() to maintain API compatibility.
|
||||
|
||||
Version 1.6.32beta06 [August 2, 2017]
|
||||
Removed png_get_eXIf_1() and png_set_eXIf_1().
|
||||
@@ -6038,14 +6037,35 @@ Version 1.6.33 [September 28, 2017]
|
||||
Add end_info structure and png_read_end() to the libpng fuzzer.
|
||||
|
||||
Version 1.6.34 [September 29, 2017]
|
||||
Removed contrib/pngsuite/i*.png; some of these were incorrect and caused
|
||||
test failures.
|
||||
Removed contrib/pngsuite/i*.png; some of them caused test failures.
|
||||
|
||||
Version 1.6.35beta01 [March 6, 2018]
|
||||
Restored 21 of the contrib/pngsuite/i*.png, which do not cause test
|
||||
failures. Placed the remainder in contrib/pngsuite/interlaced/i*.png.
|
||||
Added calls to png_set_*() transforms commonly used by browsers to
|
||||
the fuzzer.
|
||||
Removed some unnecessary brackets in pngrtran.c
|
||||
Fixed miscellaneous typos (Patch by github user "luzpaz").
|
||||
Change "ASM C" to "C ASM" in CMakeLists.txt
|
||||
Fixed incorrect handling of bKGD chunk in sub-8-bit files (Cosmin)
|
||||
Added hardware optimization directories to zip and 7z distributions.
|
||||
Fixed incorrect bitmask for options.
|
||||
Fixed many spelling typos.
|
||||
|
||||
Version 1.6.35beta02 [March 28, 2018]
|
||||
Make png_get_iCCP consistent with man page (allow compression-type argument
|
||||
to be NULL, bug report by Lenard Szolnoki).
|
||||
|
||||
Version 1.6.35 [July 15, 2018]
|
||||
Replaced the remaining uses of png_size_t with size_t (Cosmin)
|
||||
Fixed the calculation of row_factor in png_check_chunk_length
|
||||
(reported by Thuan Pham in SourceForge issue #278)
|
||||
Added missing parentheses to a macro definition
|
||||
(suggested by "irwir" in GitHub issue #216)
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe)
|
||||
or to glennrp at users.sourceforge.net
|
||||
to subscribe).
|
||||
|
||||
Glenn R-P
|
||||
#endif
|
||||
|
||||
Vendored
+1
-1
@@ -63,7 +63,7 @@ endif(MSVC)
|
||||
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wimplicit-fallthrough)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wcast-align -Wimplicit-fallthrough)
|
||||
|
||||
set_target_properties(${PNG_LIBRARY}
|
||||
PROPERTIES OUTPUT_NAME ${PNG_LIBRARY}
|
||||
|
||||
Vendored
+3
-3
@@ -10,8 +10,8 @@ this sentence.
|
||||
|
||||
This code is released under the libpng license.
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
|
||||
libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2018 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:
|
||||
@@ -130,4 +130,4 @@ any encryption software. See the EAR, paragraphs 734.3(b)(3) and
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
September 29, 2017
|
||||
July 15, 2018
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
README for libpng version 1.6.34 - September 29, 2017 (shared library 16.0)
|
||||
README for libpng version 1.6.35 - July 15, 2018 (shared library 16.0)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
@@ -118,7 +118,7 @@ development group.
|
||||
Send comments/corrections/commendations to png-mng-implement at
|
||||
lists.sourceforge.net (subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe) or to glennrp at users.sourceforge.net
|
||||
to subscribe).
|
||||
|
||||
You can't reach Guy, the original libpng author, at the addresses
|
||||
given in previous versions of this document. He and Andreas will
|
||||
|
||||
+6
-6
@@ -71,7 +71,7 @@ void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
|
||||
* There is no pixel to the left of the first pixel. It's encoded directly.
|
||||
* That works with our main loop if we just say that left pixel was zero.
|
||||
*/
|
||||
png_size_t rb;
|
||||
size_t rb;
|
||||
|
||||
__m128i a, d = _mm_setzero_si128();
|
||||
|
||||
@@ -104,7 +104,7 @@ void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row,
|
||||
* There is no pixel to the left of the first pixel. It's encoded directly.
|
||||
* That works with our main loop if we just say that left pixel was zero.
|
||||
*/
|
||||
png_size_t rb;
|
||||
size_t rb;
|
||||
|
||||
__m128i a, d = _mm_setzero_si128();
|
||||
|
||||
@@ -131,7 +131,7 @@ void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
|
||||
* perfectly with our loop if we make sure a starts at zero.
|
||||
*/
|
||||
|
||||
png_size_t rb;
|
||||
size_t rb;
|
||||
|
||||
const __m128i zero = _mm_setzero_si128();
|
||||
|
||||
@@ -185,7 +185,7 @@ void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row,
|
||||
* predicted to be half of the pixel above it. So again, this works
|
||||
* perfectly with our loop if we make sure a starts at zero.
|
||||
*/
|
||||
png_size_t rb;
|
||||
size_t rb;
|
||||
const __m128i zero = _mm_setzero_si128();
|
||||
__m128i b;
|
||||
__m128i a, d = zero;
|
||||
@@ -257,7 +257,7 @@ void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row,
|
||||
* Here we zero b and d, which become c and a respectively at the start of
|
||||
* the loop.
|
||||
*/
|
||||
png_size_t rb;
|
||||
size_t rb;
|
||||
const __m128i zero = _mm_setzero_si128();
|
||||
__m128i c, b = zero,
|
||||
a, d = zero;
|
||||
@@ -356,7 +356,7 @@ void png_read_filter_row_paeth4_sse2(png_row_infop row_info, png_bytep row,
|
||||
* Here we zero b and d, which become c and a respectively at the start of
|
||||
* the loop.
|
||||
*/
|
||||
png_size_t rb;
|
||||
size_t rb;
|
||||
const __m128i zero = _mm_setzero_si128();
|
||||
__m128i pa,pb,pc,smallest,nearest;
|
||||
__m128i c, b = zero,
|
||||
|
||||
Vendored
-38
@@ -1,38 +0,0 @@
|
||||
--- a/3rdparty/libpng/pngpriv.h
|
||||
+++ b/3rdparty/libpng/pngpriv.h
|
||||
@@ -214,7 +214,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
-#if PNG_INTEL_SSE_OPT > 0
|
||||
+#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0
|
||||
# ifndef PNG_INTEL_SSE_IMPLEMENTATION
|
||||
# if defined(__SSE4_1__) || defined(__AVX__)
|
||||
/* We are not actually using AVX, but checking for AVX is the best
|
||||
@@ -547,7 +547,7 @@
|
||||
|
||||
/* Memory model/platform independent fns */
|
||||
#ifndef PNG_ABORT
|
||||
-# ifdef _WINDOWS_
|
||||
+# if defined(_WINDOWS_) && !defined(WINRT)
|
||||
# define PNG_ABORT() ExitProcess(0)
|
||||
# else
|
||||
# define PNG_ABORT() abort()
|
||||
@@ -1340,7 +1340,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
|
||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||
#endif
|
||||
|
||||
-#if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||
+#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
|
||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
|
||||
@@ -2099,7 +2099,7 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
|
||||
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
||||
#endif
|
||||
|
||||
-# if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||
+# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
|
||||
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
||||
# endif
|
||||
Vendored
+20
-20
@@ -1,8 +1,8 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Last changed in libpng 1.6.33 [September 28, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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_6_34 Your_png_h_is_not_version_1_6_34;
|
||||
typedef png_libpng_version_1_6_35 Your_png_h_is_not_version_1_6_35;
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* The version tests may need to be added to, but the problem warning has
|
||||
@@ -71,7 +71,7 @@ png_set_sig_bytes(png_structrp png_ptr, int num_bytes)
|
||||
* PNG signature (this is the same behavior as strcmp, memcmp, etc).
|
||||
*/
|
||||
int PNGAPI
|
||||
png_sig_cmp(png_const_bytep sig, png_size_t start, png_size_t num_to_check)
|
||||
png_sig_cmp(png_const_bytep sig, size_t start, size_t num_to_check)
|
||||
{
|
||||
png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
||||
|
||||
@@ -136,7 +136,7 @@ png_reset_crc(png_structrp png_ptr)
|
||||
* trouble of calculating it.
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length)
|
||||
png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, size_t length)
|
||||
{
|
||||
int need_crc = 1;
|
||||
|
||||
@@ -421,7 +421,7 @@ png_destroy_info_struct(png_const_structrp png_ptr, png_infopp info_ptr_ptr)
|
||||
* those cases where it does anything other than a memset.
|
||||
*/
|
||||
PNG_FUNCTION(void,PNGAPI
|
||||
png_info_init_3,(png_infopp ptr_ptr, png_size_t png_info_struct_size),
|
||||
png_info_init_3,(png_infopp ptr_ptr, size_t png_info_struct_size),
|
||||
PNG_DEPRECATED)
|
||||
{
|
||||
png_inforp info_ptr = *ptr_ptr;
|
||||
@@ -816,15 +816,15 @@ png_get_copyright(png_const_structrp png_ptr)
|
||||
#else
|
||||
# ifdef __STDC__
|
||||
return PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.34 - September 29, 2017" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
|
||||
"libpng version 1.6.35 - July 15, 2018" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2002,2004,2006-2018 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.6.34 - September 29, 2017\
|
||||
Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
|
||||
return "libpng version 1.6.35 - July 15, 2018\
|
||||
Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
||||
# endif
|
||||
@@ -942,7 +942,7 @@ png_handle_as_unknown(png_const_structrp png_ptr, png_const_bytep chunk_name)
|
||||
|
||||
/* The code is the fifth byte after each four byte string. Historically this
|
||||
* code was always searched from the end of the list, this is no longer
|
||||
* necessary because the 'set' routine handles duplicate entries correcty.
|
||||
* necessary because the 'set' routine handles duplicate entries correctly.
|
||||
*/
|
||||
do /* num_chunk_list > 0, so at least one */
|
||||
{
|
||||
@@ -2067,7 +2067,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
||||
*/
|
||||
|
||||
/* Data checks (could be skipped). These checks must be independent of the
|
||||
* version number; however, the version number doesn't accomodate changes in
|
||||
* version number; however, the version number doesn't accommodate changes in
|
||||
* the header fields (just the known tags and the interpretation of the
|
||||
* data.)
|
||||
*/
|
||||
@@ -2707,7 +2707,7 @@ png_check_IHDR(png_const_structrp png_ptr,
|
||||
|
||||
#if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED)
|
||||
/* ASCII to fp functions */
|
||||
/* Check an ASCII formated floating point value, see the more detailed
|
||||
/* Check an ASCII formatted floating point value, see the more detailed
|
||||
* comments in pngpriv.h
|
||||
*/
|
||||
/* The following is used internally to preserve the sticky flags */
|
||||
@@ -2715,11 +2715,11 @@ png_check_IHDR(png_const_structrp png_ptr,
|
||||
#define png_fp_set(state, value) ((state) = (value) | ((state) & PNG_FP_STICKY))
|
||||
|
||||
int /* PRIVATE */
|
||||
png_check_fp_number(png_const_charp string, png_size_t size, int *statep,
|
||||
png_check_fp_number(png_const_charp string, size_t size, int *statep,
|
||||
png_size_tp whereami)
|
||||
{
|
||||
int state = *statep;
|
||||
png_size_t i = *whereami;
|
||||
size_t i = *whereami;
|
||||
|
||||
while (i < size)
|
||||
{
|
||||
@@ -2842,10 +2842,10 @@ PNG_FP_End:
|
||||
|
||||
/* The same but for a complete string. */
|
||||
int
|
||||
png_check_fp_string(png_const_charp string, png_size_t size)
|
||||
png_check_fp_string(png_const_charp string, size_t size)
|
||||
{
|
||||
int state=0;
|
||||
png_size_t char_index=0;
|
||||
size_t char_index=0;
|
||||
|
||||
if (png_check_fp_number(string, size, &state, &char_index) != 0 &&
|
||||
(char_index == size || string[char_index] == 0))
|
||||
@@ -2906,7 +2906,7 @@ png_pow10(int power)
|
||||
#pragma GCC diagnostic warning "-Wstrict-overflow=2"
|
||||
#endif /* GCC_STRICT_OVERFLOW */
|
||||
void /* PRIVATE */
|
||||
png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
||||
png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, size_t size,
|
||||
double fp, unsigned int precision)
|
||||
{
|
||||
/* We use standard functions from math.h, but not printf because
|
||||
@@ -3237,7 +3237,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
|
||||
png_size_t size, png_fixed_point fp)
|
||||
size_t size, png_fixed_point fp)
|
||||
{
|
||||
/* Require space for 10 decimal digits, a decimal point, a minus sign and a
|
||||
* trailing \0, 13 characters:
|
||||
@@ -4344,7 +4344,7 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
|
||||
png_uint_32 setting = (2U + (onoff != 0)) << option;
|
||||
png_uint_32 current = png_ptr->options;
|
||||
|
||||
png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff);
|
||||
png_ptr->options = (png_uint_32)((current & ~mask) | setting);
|
||||
|
||||
return (int)(current & mask) >> option;
|
||||
}
|
||||
|
||||
Vendored
+40
-40
@@ -1,9 +1,9 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.6.34, September 29, 2017
|
||||
* libpng version 1.6.35, July 15, 2018
|
||||
*
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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.)
|
||||
*
|
||||
@@ -12,7 +12,7 @@
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.6.34, September 29, 2017:
|
||||
* libpng versions 0.97, January 1998, through 1.6.35, July 15, 2018:
|
||||
* Glenn Randers-Pehrson.
|
||||
* See also "Contributing Authors", below.
|
||||
*/
|
||||
@@ -25,8 +25,8 @@
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
*
|
||||
* libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
|
||||
* libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2018 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:
|
||||
@@ -213,7 +213,7 @@
|
||||
* ...
|
||||
* 1.5.30 15 10527 15.so.15.30[.0]
|
||||
* ...
|
||||
* 1.6.34 16 10633 16.so.16.34[.0]
|
||||
* 1.6.35 16 10635 16.so.16.35[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major
|
||||
* and minor numbers; the shared-library major version number will be
|
||||
@@ -241,13 +241,13 @@
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* September 29, 2017
|
||||
* July 15, 2018
|
||||
*
|
||||
* 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.6.34 are Y2K compliant. It is my belief that
|
||||
* upward through 1.6.35 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
|
||||
@@ -309,8 +309,8 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.34"
|
||||
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.34 - September 29, 2017\n"
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.35"
|
||||
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.35 - July 15, 2018\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 16
|
||||
#define PNG_LIBPNG_VER_DLLNUM 16
|
||||
@@ -318,13 +318,13 @@
|
||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
#define PNG_LIBPNG_VER_MAJOR 1
|
||||
#define PNG_LIBPNG_VER_MINOR 6
|
||||
#define PNG_LIBPNG_VER_RELEASE 34
|
||||
#define PNG_LIBPNG_VER_RELEASE 35
|
||||
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||
*/
|
||||
|
||||
#define PNG_LIBPNG_VER_BUILD 0
|
||||
#define PNG_LIBPNG_VER_BUILD 02
|
||||
|
||||
/* Release Status */
|
||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||
@@ -341,7 +341,7 @@
|
||||
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
|
||||
PNG_LIBPNG_BUILD_PRIVATE */
|
||||
|
||||
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
|
||||
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA
|
||||
|
||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||
* We must not include leading zeros.
|
||||
@@ -349,7 +349,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 10634 /* 1.6.34 */
|
||||
#define PNG_LIBPNG_VER 10635 /* 1.6.35 */
|
||||
|
||||
/* Library configuration: these options cannot be changed after
|
||||
* the library has been built.
|
||||
@@ -459,7 +459,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_6_34;
|
||||
typedef char* png_libpng_version_1_6_35;
|
||||
|
||||
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
||||
*
|
||||
@@ -600,8 +600,8 @@ typedef struct png_text_struct
|
||||
png_charp key; /* keyword, 1-79 character description of "text" */
|
||||
png_charp text; /* comment, may be an empty string (ie "")
|
||||
or a NULL pointer */
|
||||
png_size_t text_length; /* length of the text string */
|
||||
png_size_t itxt_length; /* length of the itxt string */
|
||||
size_t text_length; /* length of the text string */
|
||||
size_t itxt_length; /* length of the itxt string */
|
||||
png_charp lang; /* language code, 0-79 characters
|
||||
or a NULL pointer */
|
||||
png_charp lang_key; /* keyword translated UTF-8 string, 0 or more
|
||||
@@ -654,7 +654,7 @@ typedef struct png_unknown_chunk_t
|
||||
{
|
||||
png_byte name[5]; /* Textual chunk name with '\0' terminator */
|
||||
png_byte *data; /* Data, should not be modified on read! */
|
||||
png_size_t size;
|
||||
size_t size;
|
||||
|
||||
/* On write 'location' must be set using the flag values listed below.
|
||||
* Notice that on read it is set by libpng however the values stored have
|
||||
@@ -679,7 +679,7 @@ typedef png_unknown_chunk * * png_unknown_chunkpp;
|
||||
/* Maximum positive integer used in PNG is (2^31)-1 */
|
||||
#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
|
||||
#define PNG_UINT_32_MAX ((png_uint_32)(-1))
|
||||
#define PNG_SIZE_MAX ((png_size_t)(-1))
|
||||
#define PNG_SIZE_MAX ((size_t)(-1))
|
||||
|
||||
/* These are constants for fixed point values encoded in the
|
||||
* PNG specification manner (x100000)
|
||||
@@ -785,7 +785,7 @@ typedef png_unknown_chunk * * png_unknown_chunkpp;
|
||||
typedef struct png_row_info_struct
|
||||
{
|
||||
png_uint_32 width; /* width of row */
|
||||
png_size_t rowbytes; /* number of bytes in row */
|
||||
size_t rowbytes; /* number of bytes in row */
|
||||
png_byte color_type; /* color type of row */
|
||||
png_byte bit_depth; /* bit depth of row */
|
||||
png_byte channels; /* number of channels (1, 2, 3, or 4) */
|
||||
@@ -804,7 +804,7 @@ typedef png_row_info * * png_row_infopp;
|
||||
* expected to return the read data in the buffer.
|
||||
*/
|
||||
typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp));
|
||||
typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t));
|
||||
typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, size_t));
|
||||
typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp));
|
||||
typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32,
|
||||
int));
|
||||
@@ -941,8 +941,8 @@ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));
|
||||
* signature, and non-zero otherwise. Having num_to_check == 0 or
|
||||
* start > 7 will always fail (ie return non-zero).
|
||||
*/
|
||||
PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start,
|
||||
png_size_t num_to_check));
|
||||
PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, size_t start,
|
||||
size_t num_to_check));
|
||||
|
||||
/* Simple signature checking function. This is the same as calling
|
||||
* png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
|
||||
@@ -961,11 +961,11 @@ PNG_EXPORTA(5, png_structp, png_create_write_struct,
|
||||
png_error_ptr warn_fn),
|
||||
PNG_ALLOCATED);
|
||||
|
||||
PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,
|
||||
PNG_EXPORT(6, size_t, png_get_compression_buffer_size,
|
||||
(png_const_structrp png_ptr));
|
||||
|
||||
PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr,
|
||||
png_size_t size));
|
||||
size_t size));
|
||||
|
||||
/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp
|
||||
* match up.
|
||||
@@ -1018,7 +1018,7 @@ PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr));
|
||||
|
||||
/* Write a PNG chunk - size, type, (optional) data, CRC. */
|
||||
PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep
|
||||
chunk_name, png_const_bytep data, png_size_t length));
|
||||
chunk_name, png_const_bytep data, size_t length));
|
||||
|
||||
/* Write the start of a PNG chunk - length and chunk name. */
|
||||
PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,
|
||||
@@ -1026,7 +1026,7 @@ PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,
|
||||
|
||||
/* Write the data of a PNG chunk started with png_write_chunk_start(). */
|
||||
PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr,
|
||||
png_const_bytep data, png_size_t length));
|
||||
png_const_bytep data, size_t length));
|
||||
|
||||
/* Finish a chunk started with png_write_chunk_start() (includes CRC). */
|
||||
PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr));
|
||||
@@ -1040,7 +1040,7 @@ PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr),
|
||||
* the API will be removed in the future.
|
||||
*/
|
||||
PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr,
|
||||
png_size_t png_info_struct_size), PNG_DEPRECATED);
|
||||
size_t png_info_struct_size), PNG_DEPRECATED);
|
||||
|
||||
/* Writes all the PNG information before the image. */
|
||||
PNG_EXPORT(20, void, png_write_info_before_PLTE,
|
||||
@@ -1137,7 +1137,7 @@ PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
|
||||
* corresponding composited pixel, and the color channels are unassociated
|
||||
* (not premultiplied). The gamma encoded color channels must be scaled
|
||||
* according to the contribution and to do this it is necessary to undo
|
||||
* the encoding, scale the color values, perform the composition and reencode
|
||||
* the encoding, scale the color values, perform the composition and re-encode
|
||||
* the values. This is the 'PNG' mode.
|
||||
*
|
||||
* The alternative is to 'associate' the alpha with the color information by
|
||||
@@ -1193,7 +1193,7 @@ PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,
|
||||
*
|
||||
* png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);
|
||||
* In this case the output is assumed to be something like an sRGB conformant
|
||||
* display preceeded by a power-law lookup table of power 1.45. This is how
|
||||
* display preceded by a power-law lookup table of power 1.45. This is how
|
||||
* early Mac systems behaved.
|
||||
*
|
||||
* png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);
|
||||
@@ -1240,7 +1240,7 @@ PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,
|
||||
*
|
||||
* When the default gamma of PNG files doesn't match the output gamma.
|
||||
* If you have PNG files with no gamma information png_set_alpha_mode allows
|
||||
* you to provide a default gamma, but it also sets the ouput gamma to the
|
||||
* you to provide a default gamma, but it also sets the output gamma to the
|
||||
* matching value. If you know your PNG files have a gamma that doesn't
|
||||
* match the output you can take advantage of the fact that
|
||||
* png_set_alpha_mode always sets the output gamma but only sets the PNG
|
||||
@@ -1691,7 +1691,7 @@ PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp));
|
||||
* chunk will cause an error at this point unless it is to be saved.
|
||||
* positive: The chunk was handled, libpng will ignore/discard it.
|
||||
*
|
||||
* See "INTERACTION WTIH USER CHUNK CALLBACKS" below for important notes about
|
||||
* See "INTERACTION WITH USER CHUNK CALLBACKS" below for important notes about
|
||||
* how this behavior will change in libpng 1.7
|
||||
*/
|
||||
PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr,
|
||||
@@ -1716,7 +1716,7 @@ PNG_EXPORT(91, png_voidp, png_get_progressive_ptr,
|
||||
|
||||
/* Function to be called when data becomes available */
|
||||
PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,
|
||||
png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size));
|
||||
png_inforp info_ptr, png_bytep buffer, size_t buffer_size));
|
||||
|
||||
/* A function which may be called *only* within png_process_data to stop the
|
||||
* processing of any more data. The function returns the number of bytes
|
||||
@@ -1725,7 +1725,7 @@ PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,
|
||||
* 'save' is set to true the routine will first save all the pending data and
|
||||
* will always return 0.
|
||||
*/
|
||||
PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save));
|
||||
PNG_EXPORT(219, size_t, png_process_data_pause, (png_structrp, int save));
|
||||
|
||||
/* A function which may be called *only* outside (after) a call to
|
||||
* png_process_data. It returns the number of bytes of data to skip in the
|
||||
@@ -1870,7 +1870,7 @@ PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr,
|
||||
png_const_inforp info_ptr, png_uint_32 flag));
|
||||
|
||||
/* Returns number of bytes needed to hold a transformed row. */
|
||||
PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr,
|
||||
PNG_EXPORT(111, size_t, png_get_rowbytes, (png_const_structrp png_ptr,
|
||||
png_const_inforp info_ptr));
|
||||
|
||||
#ifdef PNG_INFO_IMAGE_SUPPORTED
|
||||
@@ -2239,7 +2239,7 @@ PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,
|
||||
* to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks
|
||||
* it simply resets the behavior to the libpng default.
|
||||
*
|
||||
* INTERACTION WTIH USER CHUNK CALLBACKS:
|
||||
* INTERACTION WITH USER CHUNK CALLBACKS:
|
||||
* The per-chunk handling is always used when there is a png_user_chunk_ptr
|
||||
* callback and the callback returns 0; the chunk is then always stored *unless*
|
||||
* it is critical and the per-chunk setting is other than ALWAYS. Notice that
|
||||
@@ -2658,7 +2658,7 @@ PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,
|
||||
* The simplified API hides the details of both libpng and the PNG file format
|
||||
* itself. It allows PNG files to be read into a very limited number of
|
||||
* in-memory bitmap formats or to be written from the same formats. If these
|
||||
* formats do not accomodate your needs then you can, and should, use the more
|
||||
* formats do not accommodate your needs then you can, and should, use the more
|
||||
* sophisticated APIs above - these support a wide variety of in-memory formats
|
||||
* and a wide variety of sophisticated transformations to those formats as well
|
||||
* as a wide variety of APIs to manipulate ancillary information.
|
||||
@@ -3020,7 +3020,7 @@ PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,
|
||||
#endif /* STDIO */
|
||||
|
||||
PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image,
|
||||
png_const_voidp memory, png_size_t size));
|
||||
png_const_voidp memory, size_t size));
|
||||
/* The PNG header is read from the given memory buffer. */
|
||||
|
||||
PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image,
|
||||
@@ -3133,7 +3133,7 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
|
||||
* than or equal to the original value.
|
||||
*
|
||||
* If the function returns false and *memory_bytes was not changed an error
|
||||
* occured during write. If *memory_bytes was changed, or is not 0 if
|
||||
* occurred during write. If *memory_bytes was changed, or is not 0 if
|
||||
* 'memory' was NULL, the write would have succeeded but for the memory
|
||||
* buffer being too small. *memory_bytes contains the required number of
|
||||
* bytes and will be bigger that the original value.
|
||||
@@ -3217,7 +3217,7 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
|
||||
* 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,
|
||||
* HARDWARE: normally hardware capabilities, 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
|
||||
|
||||
Vendored
+15
-14
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.6.34, September 29, 2017
|
||||
* libpng version 1.6.35, July 15, 2018
|
||||
*
|
||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 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.)
|
||||
*
|
||||
@@ -127,7 +127,7 @@
|
||||
*
|
||||
* These cases only differ if the operating system does not use the C
|
||||
* calling convention, at present this just means the above cases
|
||||
* (x86 DOS/Windows sytems) and, even then, this does not apply to
|
||||
* (x86 DOS/Windows systems) and, even then, this does not apply to
|
||||
* Cygwin running on those systems.
|
||||
*
|
||||
* Note that the value must be defined in pnglibconf.h so that what
|
||||
@@ -515,8 +515,10 @@
|
||||
# error "libpng requires an unsigned 32-bit (or more) type"
|
||||
#endif
|
||||
|
||||
/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
|
||||
* requires an ISOC90 compiler and relies on consistent behavior of sizeof.
|
||||
/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.
|
||||
* From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant
|
||||
* behavior of sizeof and ptrdiff_t are required.
|
||||
* The legacy typedefs are provided here for backwards compatibility.
|
||||
*/
|
||||
typedef size_t png_size_t;
|
||||
typedef ptrdiff_t png_ptrdiff_t;
|
||||
@@ -537,13 +539,12 @@ typedef ptrdiff_t png_ptrdiff_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no
|
||||
* smaller than png_uint_32. Casts from png_size_t or png_uint_32 to
|
||||
* png_alloc_size_t are not necessary; in fact, it is recommended not to use
|
||||
* them at all so that the compiler can complain when something turns out to be
|
||||
* problematic.
|
||||
/* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller
|
||||
* than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are
|
||||
* not necessary; in fact, it is recommended not to use them at all, so that
|
||||
* the compiler can complain when something turns out to be problematic.
|
||||
*
|
||||
* Casts in the other direction (from png_alloc_size_t to png_size_t or
|
||||
* Casts in the other direction (from png_alloc_size_t to size_t or
|
||||
* png_uint_32) should be explicitly applied; however, we do not expect to
|
||||
* encounter practical situations that require such conversions.
|
||||
*
|
||||
@@ -553,7 +554,7 @@ typedef ptrdiff_t png_ptrdiff_t;
|
||||
#ifdef PNG_SMALL_SIZE_T
|
||||
typedef png_uint_32 png_alloc_size_t;
|
||||
#else
|
||||
typedef png_size_t png_alloc_size_t;
|
||||
typedef size_t png_alloc_size_t;
|
||||
#endif
|
||||
|
||||
/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
|
||||
@@ -589,8 +590,8 @@ typedef char * png_charp;
|
||||
typedef const char * png_const_charp;
|
||||
typedef png_fixed_point * png_fixed_point_p;
|
||||
typedef const png_fixed_point * png_const_fixed_point_p;
|
||||
typedef png_size_t * png_size_tp;
|
||||
typedef const png_size_t * png_const_size_tp;
|
||||
typedef size_t * png_size_tp;
|
||||
typedef const size_t * png_const_size_tp;
|
||||
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
typedef FILE * png_FILE_p;
|
||||
|
||||
Vendored
+9
-8
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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 @@ png_get_valid(png_const_structrp png_ptr, png_const_inforp info_ptr,
|
||||
return(0);
|
||||
}
|
||||
|
||||
png_size_t PNGAPI
|
||||
size_t PNGAPI
|
||||
png_get_rowbytes(png_const_structrp png_ptr, png_const_inforp info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
@@ -367,7 +367,7 @@ png_get_y_pixels_per_inch(png_const_structrp png_ptr, png_const_inforp info_ptr)
|
||||
static png_fixed_point
|
||||
png_fixed_inches_from_microns(png_const_structrp png_ptr, png_int_32 microns)
|
||||
{
|
||||
/* Convert from metres * 1,000,000 to inches * 100,000, meters to
|
||||
/* Convert from meters * 1,000,000 to inches * 100,000, meters to
|
||||
* inches is simply *(100/2.54), so we want *(10/2.54) == 500/127.
|
||||
* Notice that this can overflow - a warning is output and 0 is
|
||||
* returned.
|
||||
@@ -741,8 +741,7 @@ png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
|
||||
if (png_ptr != NULL && info_ptr != NULL &&
|
||||
(info_ptr->valid & PNG_INFO_iCCP) != 0 &&
|
||||
name != NULL && compression_type != NULL && profile != NULL &&
|
||||
proflen != NULL)
|
||||
name != NULL && profile != NULL && proflen != NULL)
|
||||
{
|
||||
*name = info_ptr->iccp_name;
|
||||
*profile = info_ptr->iccp_profile;
|
||||
@@ -750,11 +749,13 @@ png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
/* This is somewhat irrelevant since the profile data returned has
|
||||
* actually been uncompressed.
|
||||
*/
|
||||
*compression_type = PNG_COMPRESSION_TYPE_BASE;
|
||||
if (compression_type != NULL)
|
||||
*compression_type = PNG_COMPRESSION_TYPE_BASE;
|
||||
return (PNG_INFO_iCCP);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1164,7 +1165,7 @@ png_get_user_chunk_ptr(png_const_structrp png_ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
png_size_t PNGAPI
|
||||
size_t PNGAPI
|
||||
png_get_compression_buffer_size(png_const_structrp png_ptr)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
|
||||
Vendored
+7
-7
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pnginfo.h - header file for PNG reference library
|
||||
*
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2013,2018 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.)
|
||||
*
|
||||
@@ -55,10 +55,10 @@
|
||||
struct png_info_def
|
||||
{
|
||||
/* The following are necessary for every PNG file */
|
||||
png_uint_32 width; /* width of image in pixels (from IHDR) */
|
||||
png_uint_32 height; /* height of image in pixels (from IHDR) */
|
||||
png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */
|
||||
png_size_t rowbytes; /* bytes needed to hold an untransformed row */
|
||||
png_uint_32 width; /* width of image in pixels (from IHDR) */
|
||||
png_uint_32 height; /* height of image in pixels (from IHDR) */
|
||||
png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */
|
||||
size_t rowbytes; /* bytes needed to hold an untransformed row */
|
||||
png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */
|
||||
png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */
|
||||
png_uint_16 num_trans; /* number of transparent palette color (tRNS) */
|
||||
@@ -247,7 +247,7 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
/* The sCAL chunk describes the actual physical dimensions of the
|
||||
* subject matter of the graphic. The chunk contains a unit specification
|
||||
* a byte value, and two ASCII strings representing floating-point
|
||||
* values. The values are width and height corresponsing to one pixel
|
||||
* values. The values are width and height corresponding to one pixel
|
||||
* in the image. Data values are valid if (valid & PNG_INFO_sCAL) is
|
||||
* non-zero.
|
||||
*/
|
||||
|
||||
Vendored
+19
-19
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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,7 +34,7 @@ if (png_ptr->buffer_size < N) \
|
||||
|
||||
void PNGAPI
|
||||
png_process_data(png_structrp png_ptr, png_inforp info_ptr,
|
||||
png_bytep buffer, png_size_t buffer_size)
|
||||
png_bytep buffer, size_t buffer_size)
|
||||
{
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
@@ -47,7 +47,7 @@ png_process_data(png_structrp png_ptr, png_inforp info_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
png_size_t PNGAPI
|
||||
size_t PNGAPI
|
||||
png_process_data_pause(png_structrp png_ptr, int save)
|
||||
{
|
||||
if (png_ptr != NULL)
|
||||
@@ -60,7 +60,7 @@ png_process_data_pause(png_structrp png_ptr, int save)
|
||||
else
|
||||
{
|
||||
/* This includes any pending saved bytes: */
|
||||
png_size_t remaining = png_ptr->buffer_size;
|
||||
size_t remaining = png_ptr->buffer_size;
|
||||
png_ptr->buffer_size = 0;
|
||||
|
||||
/* So subtract the saved buffer size, unless all the data
|
||||
@@ -133,8 +133,8 @@ png_process_some_data(png_structrp png_ptr, png_inforp info_ptr)
|
||||
void /* PRIVATE */
|
||||
png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr)
|
||||
{
|
||||
png_size_t num_checked = png_ptr->sig_bytes, /* SAFE, does not exceed 8 */
|
||||
num_to_check = 8 - num_checked;
|
||||
size_t num_checked = png_ptr->sig_bytes; /* SAFE, does not exceed 8 */
|
||||
size_t num_to_check = 8 - num_checked;
|
||||
|
||||
if (png_ptr->buffer_size < num_to_check)
|
||||
{
|
||||
@@ -418,7 +418,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
|
||||
}
|
||||
|
||||
void PNGCBAPI
|
||||
png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
|
||||
png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, size_t length)
|
||||
{
|
||||
png_bytep ptr;
|
||||
|
||||
@@ -428,7 +428,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
|
||||
ptr = buffer;
|
||||
if (png_ptr->save_buffer_size != 0)
|
||||
{
|
||||
png_size_t save_size;
|
||||
size_t save_size;
|
||||
|
||||
if (length < png_ptr->save_buffer_size)
|
||||
save_size = length;
|
||||
@@ -445,7 +445,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
|
||||
}
|
||||
if (length != 0 && png_ptr->current_buffer_size != 0)
|
||||
{
|
||||
png_size_t save_size;
|
||||
size_t save_size;
|
||||
|
||||
if (length < png_ptr->current_buffer_size)
|
||||
save_size = length;
|
||||
@@ -467,7 +467,7 @@ png_push_save_buffer(png_structrp png_ptr)
|
||||
{
|
||||
if (png_ptr->save_buffer_ptr != png_ptr->save_buffer)
|
||||
{
|
||||
png_size_t i, istop;
|
||||
size_t i, istop;
|
||||
png_bytep sp;
|
||||
png_bytep dp;
|
||||
|
||||
@@ -482,7 +482,7 @@ png_push_save_buffer(png_structrp png_ptr)
|
||||
if (png_ptr->save_buffer_size + png_ptr->current_buffer_size >
|
||||
png_ptr->save_buffer_max)
|
||||
{
|
||||
png_size_t new_max;
|
||||
size_t new_max;
|
||||
png_bytep old_buffer;
|
||||
|
||||
if (png_ptr->save_buffer_size > PNG_SIZE_MAX -
|
||||
@@ -494,7 +494,7 @@ png_push_save_buffer(png_structrp png_ptr)
|
||||
new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256;
|
||||
old_buffer = png_ptr->save_buffer;
|
||||
png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr,
|
||||
(png_size_t)new_max);
|
||||
(size_t)new_max);
|
||||
|
||||
if (png_ptr->save_buffer == NULL)
|
||||
{
|
||||
@@ -522,7 +522,7 @@ png_push_save_buffer(png_structrp png_ptr)
|
||||
|
||||
void /* PRIVATE */
|
||||
png_push_restore_buffer(png_structrp png_ptr, png_bytep buffer,
|
||||
png_size_t buffer_length)
|
||||
size_t buffer_length)
|
||||
{
|
||||
png_ptr->current_buffer = buffer;
|
||||
png_ptr->current_buffer_size = buffer_length;
|
||||
@@ -562,7 +562,7 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
|
||||
if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0)
|
||||
{
|
||||
png_size_t save_size = png_ptr->save_buffer_size;
|
||||
size_t save_size = png_ptr->save_buffer_size;
|
||||
png_uint_32 idat_size = png_ptr->idat_size;
|
||||
|
||||
/* We want the smaller of 'idat_size' and 'current_buffer_size', but they
|
||||
@@ -572,7 +572,7 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
* will break on either 16-bit or 64-bit platforms.
|
||||
*/
|
||||
if (idat_size < save_size)
|
||||
save_size = (png_size_t)idat_size;
|
||||
save_size = (size_t)idat_size;
|
||||
|
||||
else
|
||||
idat_size = (png_uint_32)save_size;
|
||||
@@ -589,7 +589,7 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
|
||||
if (png_ptr->idat_size != 0 && png_ptr->current_buffer_size != 0)
|
||||
{
|
||||
png_size_t save_size = png_ptr->current_buffer_size;
|
||||
size_t save_size = png_ptr->current_buffer_size;
|
||||
png_uint_32 idat_size = png_ptr->idat_size;
|
||||
|
||||
/* We want the smaller of 'idat_size' and 'current_buffer_size', but they
|
||||
@@ -598,7 +598,7 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
* larger - this cannot overflow.
|
||||
*/
|
||||
if (idat_size < save_size)
|
||||
save_size = (png_size_t)idat_size;
|
||||
save_size = (size_t)idat_size;
|
||||
|
||||
else
|
||||
idat_size = (png_uint_32)save_size;
|
||||
@@ -625,7 +625,7 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
|
||||
void /* PRIVATE */
|
||||
png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
|
||||
png_size_t buffer_length)
|
||||
size_t buffer_length)
|
||||
{
|
||||
/* The caller checks for a non-zero buffer length. */
|
||||
if (!(buffer_length > 0) || buffer == NULL)
|
||||
|
||||
Vendored
+29
-23
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngpriv.h - private declarations for use inside libpng
|
||||
*
|
||||
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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.)
|
||||
*
|
||||
@@ -210,11 +210,15 @@
|
||||
defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
|
||||
(defined(_M_IX86_FP) && _M_IX86_FP >= 2)
|
||||
# define PNG_INTEL_SSE_OPT 1
|
||||
# else
|
||||
# define PNG_INTEL_SSE_OPT 0
|
||||
# endif
|
||||
# else
|
||||
# define PNG_INTEL_SSE_OPT 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0
|
||||
#if PNG_INTEL_SSE_OPT > 0
|
||||
# ifndef PNG_INTEL_SSE_IMPLEMENTATION
|
||||
# if defined(__SSE4_1__) || defined(__AVX__)
|
||||
/* We are not actually using AVX, but checking for AVX is the best
|
||||
@@ -234,6 +238,8 @@
|
||||
# if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
|
||||
# endif
|
||||
#else
|
||||
# define PNG_INTEL_SSE_IMPLEMENTATION 0
|
||||
#endif
|
||||
|
||||
#if PNG_MIPS_MSA_OPT > 0
|
||||
@@ -547,7 +553,7 @@
|
||||
|
||||
/* Memory model/platform independent fns */
|
||||
#ifndef PNG_ABORT
|
||||
# if defined(_WINDOWS_) && !defined(WINRT)
|
||||
# ifdef _WINDOWS_
|
||||
# define PNG_ABORT() ExitProcess(0)
|
||||
# else
|
||||
# define PNG_ABORT() abort()
|
||||
@@ -728,8 +734,8 @@
|
||||
/* Added to libpng-1.2.6 JB */
|
||||
#define PNG_ROWBYTES(pixel_bits, width) \
|
||||
((pixel_bits) >= 8 ? \
|
||||
((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \
|
||||
(( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) )
|
||||
((size_t)(width) * (((size_t)(pixel_bits)) >> 3)) : \
|
||||
(( ((size_t)(width) * ((size_t)(pixel_bits))) + 7) >> 3) )
|
||||
|
||||
/* This returns the number of trailing bits in the last byte of a row, 0 if the
|
||||
* last byte is completely full of pixels. It is, in principle, (pixel_bits x
|
||||
@@ -917,7 +923,7 @@
|
||||
* PNG files the -I directives must match.
|
||||
*
|
||||
* The most likely explanation is that you passed a -I in CFLAGS. This will
|
||||
* not work; all the preprocessor directories and in particular all the -I
|
||||
* not work; all the preprocessor directives and in particular all the -I
|
||||
* directives must be in CPPFLAGS.
|
||||
*/
|
||||
#endif
|
||||
@@ -1046,15 +1052,15 @@ PNG_INTERNAL_FUNCTION(void,png_zfree,(voidpf png_ptr, voidpf ptr),PNG_EMPTY);
|
||||
*/
|
||||
|
||||
PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_read_data,(png_structp png_ptr,
|
||||
png_bytep data, png_size_t length),PNG_EMPTY);
|
||||
png_bytep data, size_t length),PNG_EMPTY);
|
||||
|
||||
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
||||
PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_push_fill_buffer,(png_structp png_ptr,
|
||||
png_bytep buffer, png_size_t length),PNG_EMPTY);
|
||||
png_bytep buffer, size_t length),PNG_EMPTY);
|
||||
#endif
|
||||
|
||||
PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_write_data,(png_structp png_ptr,
|
||||
png_bytep data, png_size_t length),PNG_EMPTY);
|
||||
png_bytep data, size_t length),PNG_EMPTY);
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
# ifdef PNG_STDIO_SUPPORTED
|
||||
@@ -1068,7 +1074,7 @@ PNG_INTERNAL_FUNCTION(void,png_reset_crc,(png_structrp png_ptr),PNG_EMPTY);
|
||||
|
||||
/* Write the "data" buffer to whatever output you are using */
|
||||
PNG_INTERNAL_FUNCTION(void,png_write_data,(png_structrp png_ptr,
|
||||
png_const_bytep data, png_size_t length),PNG_EMPTY);
|
||||
png_const_bytep data, size_t length),PNG_EMPTY);
|
||||
|
||||
/* Read and check the PNG file signature */
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_sig,(png_structrp png_ptr,
|
||||
@@ -1080,7 +1086,7 @@ PNG_INTERNAL_FUNCTION(png_uint_32,png_read_chunk_header,(png_structrp png_ptr),
|
||||
|
||||
/* Read data from whatever input you are using into the "data" buffer */
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_data,(png_structrp png_ptr, png_bytep data,
|
||||
png_size_t length),PNG_EMPTY);
|
||||
size_t length),PNG_EMPTY);
|
||||
|
||||
/* Read bytes into buf, and update png_ptr->crc */
|
||||
PNG_INTERNAL_FUNCTION(void,png_crc_read,(png_structrp png_ptr, png_bytep buf,
|
||||
@@ -1098,7 +1104,7 @@ PNG_INTERNAL_FUNCTION(int,png_crc_error,(png_structrp png_ptr),PNG_EMPTY);
|
||||
* since this is the maximum buffer size we can specify.
|
||||
*/
|
||||
PNG_INTERNAL_FUNCTION(void,png_calculate_crc,(png_structrp png_ptr,
|
||||
png_const_bytep ptr, png_size_t length),PNG_EMPTY);
|
||||
png_const_bytep ptr, size_t length),PNG_EMPTY);
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
PNG_INTERNAL_FUNCTION(void,png_flush,(png_structrp png_ptr),PNG_EMPTY);
|
||||
@@ -1181,7 +1187,7 @@ PNG_INTERNAL_FUNCTION(void,png_write_hIST,(png_structrp png_ptr,
|
||||
/* Chunks that have keywords */
|
||||
#ifdef PNG_WRITE_tEXt_SUPPORTED
|
||||
PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr,
|
||||
png_const_charp key, png_const_charp text, png_size_t text_len),PNG_EMPTY);
|
||||
png_const_charp key, png_const_charp text, size_t text_len),PNG_EMPTY);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_zTXt_SUPPORTED
|
||||
@@ -1340,7 +1346,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
|
||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||
#endif
|
||||
|
||||
#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||
#if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
|
||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
|
||||
@@ -1574,10 +1580,10 @@ PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr),
|
||||
PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr,
|
||||
png_bytep buffer, png_size_t buffer_length),PNG_EMPTY);
|
||||
png_bytep buffer, size_t buffer_length),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_push_read_IDAT,(png_structrp png_ptr),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_process_IDAT_data,(png_structrp png_ptr,
|
||||
png_bytep buffer, png_size_t buffer_length),PNG_EMPTY);
|
||||
png_bytep buffer, size_t buffer_length),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr),
|
||||
PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_push_handle_unknown,(png_structrp png_ptr,
|
||||
@@ -1847,13 +1853,13 @@ PNG_INTERNAL_FUNCTION(void,png_chunk_report,(png_const_structrp png_ptr,
|
||||
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
PNG_INTERNAL_FUNCTION(void,png_ascii_from_fp,(png_const_structrp png_ptr,
|
||||
png_charp ascii, png_size_t size, double fp, unsigned int precision),
|
||||
png_charp ascii, size_t size, double fp, unsigned int precision),
|
||||
PNG_EMPTY);
|
||||
#endif /* FLOATING_POINT */
|
||||
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr,
|
||||
png_charp ascii, png_size_t size, png_fixed_point fp),PNG_EMPTY);
|
||||
png_charp ascii, size_t size, png_fixed_point fp),PNG_EMPTY);
|
||||
#endif /* FIXED_POINT */
|
||||
#endif /* sCAL */
|
||||
|
||||
@@ -1946,7 +1952,7 @@ PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr,
|
||||
* the problem character.) This has not been tested within libpng.
|
||||
*/
|
||||
PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string,
|
||||
png_size_t size, int *statep, png_size_tp whereami),PNG_EMPTY);
|
||||
size_t size, int *statep, png_size_tp whereami),PNG_EMPTY);
|
||||
|
||||
/* This is the same but it checks a complete string and returns true
|
||||
* only if it just contains a floating point number. As of 1.5.4 this
|
||||
@@ -1955,7 +1961,7 @@ PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string,
|
||||
* for negative or zero values using the sticky flag.
|
||||
*/
|
||||
PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string,
|
||||
png_size_t size),PNG_EMPTY);
|
||||
size_t size),PNG_EMPTY);
|
||||
#endif /* pCAL || sCAL */
|
||||
|
||||
#if defined(PNG_GAMMA_SUPPORTED) ||\
|
||||
@@ -2030,7 +2036,7 @@ typedef struct png_control
|
||||
png_voidp error_buf; /* Always a jmp_buf at present. */
|
||||
|
||||
png_const_bytep memory; /* Memory buffer. */
|
||||
png_size_t size; /* Size of the memory buffer. */
|
||||
size_t size; /* Size of the memory buffer. */
|
||||
|
||||
unsigned int for_write :1; /* Otherwise it is a read structure */
|
||||
unsigned int owned_file :1; /* We own the file in io_ptr */
|
||||
@@ -2099,7 +2105,7 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
|
||||
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
||||
#endif
|
||||
|
||||
# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||
# if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
|
||||
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
||||
# endif
|
||||
|
||||
Vendored
+6
-6
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.33 [September 28, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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.)
|
||||
*
|
||||
@@ -1532,7 +1532,7 @@ png_image_begin_read_from_file(png_imagep image, const char *file_name)
|
||||
#endif /* STDIO */
|
||||
|
||||
static void PNGCBAPI
|
||||
png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need)
|
||||
png_image_memory_read(png_structp png_ptr, png_bytep out, size_t need)
|
||||
{
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
@@ -1543,7 +1543,7 @@ png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need)
|
||||
if (cp != NULL)
|
||||
{
|
||||
png_const_bytep memory = cp->memory;
|
||||
png_size_t size = cp->size;
|
||||
size_t size = cp->size;
|
||||
|
||||
if (memory != NULL && size >= need)
|
||||
{
|
||||
@@ -1562,7 +1562,7 @@ png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need)
|
||||
}
|
||||
|
||||
int PNGAPI png_image_begin_read_from_memory(png_imagep image,
|
||||
png_const_voidp memory, png_size_t size)
|
||||
png_const_voidp memory, size_t size)
|
||||
{
|
||||
if (image != NULL && image->version == PNG_IMAGE_VERSION)
|
||||
{
|
||||
@@ -4150,7 +4150,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
|
||||
*
|
||||
* NOTE: this will be changed in 1.7 because PNG_IMAGE_BUFFER_SIZE
|
||||
* will be changed to use png_alloc_size_t; bigger images can be
|
||||
* accomodated on 64-bit systems.
|
||||
* accommodated on 64-bit systems.
|
||||
*/
|
||||
if (image->height <=
|
||||
0xffffffffU/PNG_IMAGE_PIXEL_COMPONENT_SIZE(image->format)/check)
|
||||
|
||||
Vendored
+6
-6
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 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.)
|
||||
*
|
||||
@@ -29,7 +29,7 @@
|
||||
* to read more than 64K on a 16-bit machine.
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length)
|
||||
png_read_data(png_structrp png_ptr, png_bytep data, size_t length)
|
||||
{
|
||||
png_debug1(4, "reading %d bytes", (int)length);
|
||||
|
||||
@@ -47,14 +47,14 @@ png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length)
|
||||
* than changing the library.
|
||||
*/
|
||||
void PNGCBAPI
|
||||
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
png_default_read_data(png_structp png_ptr, png_bytep data, size_t length)
|
||||
{
|
||||
png_size_t check;
|
||||
size_t check;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
|
||||
/* fread() returns 0 on error, so it is OK to store this in a size_t
|
||||
* instead of an int, which is what fread() actually returns.
|
||||
*/
|
||||
check = fread(data, 1, length, png_voidcast(png_FILE_p, png_ptr->io_ptr));
|
||||
|
||||
Vendored
+920
-926
File diff suppressed because it is too large
Load Diff
Vendored
+46
-25
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.33 [September 28, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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.)
|
||||
*
|
||||
@@ -102,7 +102,7 @@ png_get_int_32)(png_const_bytep buf)
|
||||
png_uint_16 (PNGAPI
|
||||
png_get_uint_16)(png_const_bytep buf)
|
||||
{
|
||||
/* ANSI-C requires an int value to accomodate at least 16 bits so this
|
||||
/* ANSI-C requires an int value to accommodate at least 16 bits so this
|
||||
* works and allows the compiler not to worry about possible narrowing
|
||||
* on 32-bit systems. (Pre-ANSI systems did not make integers smaller
|
||||
* than 16 bits either.)
|
||||
@@ -120,7 +120,7 @@ png_get_uint_16)(png_const_bytep buf)
|
||||
void /* PRIVATE */
|
||||
png_read_sig(png_structrp png_ptr, png_inforp info_ptr)
|
||||
{
|
||||
png_size_t num_checked, num_to_check;
|
||||
size_t num_checked, num_to_check;
|
||||
|
||||
/* Exit if the user application does not expect a signature. */
|
||||
if (png_ptr->sig_bytes >= 8)
|
||||
@@ -1648,7 +1648,7 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
|
||||
int entry_size, i;
|
||||
png_uint_32 skip = 0;
|
||||
png_uint_32 dl;
|
||||
png_size_t max_dl;
|
||||
size_t max_dl;
|
||||
|
||||
png_debug(1, "in png_handle_sPLT");
|
||||
|
||||
@@ -1997,6 +1997,15 @@ png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
|
||||
|
||||
else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0) /* GRAY */
|
||||
{
|
||||
if (png_ptr->bit_depth <= 8)
|
||||
{
|
||||
if (buf[0] != 0 || buf[1] >= (unsigned int)(1 << png_ptr->bit_depth))
|
||||
{
|
||||
png_chunk_benign_error(png_ptr, "invalid gray level");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
background.index = 0;
|
||||
background.red =
|
||||
background.green =
|
||||
@@ -2006,6 +2015,15 @@ png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
|
||||
|
||||
else
|
||||
{
|
||||
if (png_ptr->bit_depth <= 8)
|
||||
{
|
||||
if (buf[0] != 0 || buf[2] != 0 || buf[4] != 0)
|
||||
{
|
||||
png_chunk_benign_error(png_ptr, "invalid color");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
background.index = 0;
|
||||
background.red = png_get_uint_16(buf);
|
||||
background.green = png_get_uint_16(buf + 2);
|
||||
@@ -2359,7 +2377,7 @@ void /* PRIVATE */
|
||||
png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
|
||||
{
|
||||
png_bytep buffer;
|
||||
png_size_t i;
|
||||
size_t i;
|
||||
int state;
|
||||
|
||||
png_debug(1, "in png_handle_sCAL");
|
||||
@@ -2429,7 +2447,7 @@ png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
|
||||
|
||||
else
|
||||
{
|
||||
png_size_t heighti = i;
|
||||
size_t heighti = i;
|
||||
|
||||
state = 0;
|
||||
if (png_check_fp_number((png_const_charp)buffer, length,
|
||||
@@ -2867,7 +2885,7 @@ png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length)
|
||||
{
|
||||
PNG_CSTRING_FROM_CHUNK(png_ptr->unknown_chunk.name, png_ptr->chunk_name);
|
||||
/* The following is safe because of the PNG_SIZE_MAX init above */
|
||||
png_ptr->unknown_chunk.size = (png_size_t)length/*SAFE*/;
|
||||
png_ptr->unknown_chunk.size = (size_t)length/*SAFE*/;
|
||||
/* 'mode' is a flag array, only the bottom four bits matter here */
|
||||
png_ptr->unknown_chunk.location = (png_byte)png_ptr->mode/*SAFE*/;
|
||||
|
||||
@@ -3149,10 +3167,13 @@ png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length)
|
||||
{
|
||||
png_alloc_size_t idat_limit = PNG_UINT_31_MAX;
|
||||
size_t row_factor =
|
||||
(png_ptr->width * png_ptr->channels * (png_ptr->bit_depth > 8? 2: 1)
|
||||
+ 1 + (png_ptr->interlaced? 6: 0));
|
||||
(size_t)png_ptr->width
|
||||
* (size_t)png_ptr->channels
|
||||
* (png_ptr->bit_depth > 8? 2: 1)
|
||||
+ 1
|
||||
+ (png_ptr->interlaced? 6: 0);
|
||||
if (png_ptr->height > PNG_UINT_32_MAX/row_factor)
|
||||
idat_limit=PNG_UINT_31_MAX;
|
||||
idat_limit = PNG_UINT_31_MAX;
|
||||
else
|
||||
idat_limit = png_ptr->height * row_factor;
|
||||
row_factor = row_factor > 32566? 32566 : row_factor;
|
||||
@@ -3679,8 +3700,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 3);
|
||||
png_bytep dp = row + (png_size_t)((final_width - 1) >> 3);
|
||||
png_bytep sp = row + (size_t)((row_info->width - 1) >> 3);
|
||||
png_bytep dp = row + (size_t)((final_width - 1) >> 3);
|
||||
unsigned int sshift, dshift;
|
||||
unsigned int s_start, s_end;
|
||||
int s_inc;
|
||||
@@ -3806,8 +3827,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
|
||||
|
||||
case 4:
|
||||
{
|
||||
png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 1);
|
||||
png_bytep dp = row + (png_size_t)((final_width - 1) >> 1);
|
||||
png_bytep sp = row + (size_t)((row_info->width - 1) >> 1);
|
||||
png_bytep dp = row + (size_t)((final_width - 1) >> 1);
|
||||
unsigned int sshift, dshift;
|
||||
unsigned int s_start, s_end;
|
||||
int s_inc;
|
||||
@@ -3869,12 +3890,12 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
|
||||
|
||||
default:
|
||||
{
|
||||
png_size_t pixel_bytes = (row_info->pixel_depth >> 3);
|
||||
size_t pixel_bytes = (row_info->pixel_depth >> 3);
|
||||
|
||||
png_bytep sp = row + (png_size_t)(row_info->width - 1)
|
||||
png_bytep sp = row + (size_t)(row_info->width - 1)
|
||||
* pixel_bytes;
|
||||
|
||||
png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes;
|
||||
png_bytep dp = row + (size_t)(final_width - 1) * pixel_bytes;
|
||||
|
||||
int jstop = (int)png_pass_inc[pass];
|
||||
png_uint_32 i;
|
||||
@@ -3911,8 +3932,8 @@ static void
|
||||
png_read_filter_row_sub(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_size_t i;
|
||||
png_size_t istop = row_info->rowbytes;
|
||||
size_t i;
|
||||
size_t istop = row_info->rowbytes;
|
||||
unsigned int bpp = (row_info->pixel_depth + 7) >> 3;
|
||||
png_bytep rp = row + bpp;
|
||||
|
||||
@@ -3929,8 +3950,8 @@ static void
|
||||
png_read_filter_row_up(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_size_t i;
|
||||
png_size_t istop = row_info->rowbytes;
|
||||
size_t i;
|
||||
size_t istop = row_info->rowbytes;
|
||||
png_bytep rp = row;
|
||||
png_const_bytep pp = prev_row;
|
||||
|
||||
@@ -3945,11 +3966,11 @@ static void
|
||||
png_read_filter_row_avg(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
png_size_t i;
|
||||
size_t i;
|
||||
png_bytep rp = row;
|
||||
png_const_bytep pp = prev_row;
|
||||
unsigned int bpp = (row_info->pixel_depth + 7) >> 3;
|
||||
png_size_t istop = row_info->rowbytes - bpp;
|
||||
size_t istop = row_info->rowbytes - bpp;
|
||||
|
||||
for (i = 0; i < bpp; i++)
|
||||
{
|
||||
@@ -4385,7 +4406,7 @@ png_read_start_row(png_structrp png_ptr)
|
||||
static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
|
||||
unsigned int max_pixel_depth;
|
||||
png_size_t row_bytes;
|
||||
size_t row_bytes;
|
||||
|
||||
png_debug(1, "in png_read_start_row");
|
||||
|
||||
|
||||
Vendored
+9
-9
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||
* Copyright (c) 1998-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2018 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.)
|
||||
*
|
||||
@@ -313,7 +313,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp 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_size_t length;
|
||||
size_t length;
|
||||
int i;
|
||||
|
||||
png_debug1(1, "in %s storage function", "pCAL");
|
||||
@@ -390,7 +390,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
memcpy(info_ptr->pcal_units, units, length);
|
||||
|
||||
info_ptr->pcal_params = png_voidcast(png_charpp, png_malloc_warn(png_ptr,
|
||||
(png_size_t)(((unsigned int)nparams + 1) * (sizeof (png_charp)))));
|
||||
(size_t)(((unsigned int)nparams + 1) * (sizeof (png_charp)))));
|
||||
|
||||
if (info_ptr->pcal_params == NULL)
|
||||
{
|
||||
@@ -430,7 +430,7 @@ void PNGAPI
|
||||
png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
int unit, png_const_charp swidth, png_const_charp sheight)
|
||||
{
|
||||
png_size_t lengthw = 0, lengthh = 0;
|
||||
size_t lengthw = 0, lengthh = 0;
|
||||
|
||||
png_debug1(1, "in %s storage function", "sCAL");
|
||||
|
||||
@@ -691,7 +691,7 @@ png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
{
|
||||
png_charp new_iccp_name;
|
||||
png_bytep new_iccp_profile;
|
||||
png_size_t length;
|
||||
size_t length;
|
||||
|
||||
png_debug1(1, "in %s storage function", "iCCP");
|
||||
|
||||
@@ -1018,7 +1018,7 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr,
|
||||
/* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
|
||||
info_ptr->trans_alpha = png_voidcast(png_bytep,
|
||||
png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH));
|
||||
memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans);
|
||||
memcpy(info_ptr->trans_alpha, trans_alpha, (size_t)num_trans);
|
||||
}
|
||||
png_ptr->trans_alpha = info_ptr->trans_alpha;
|
||||
}
|
||||
@@ -1098,7 +1098,7 @@ png_set_sPLT(png_const_structrp png_ptr,
|
||||
|
||||
do
|
||||
{
|
||||
png_size_t length;
|
||||
size_t length;
|
||||
|
||||
/* Skip invalid input entries */
|
||||
if (entries->name == NULL || entries->entries == NULL)
|
||||
@@ -1563,7 +1563,7 @@ png_set_rows(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
#endif
|
||||
|
||||
void PNGAPI
|
||||
png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
|
||||
png_set_compression_buffer_size(png_structrp png_ptr, size_t size)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
Vendored
+11
-11
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngstruct.h - header file for PNG reference library
|
||||
*
|
||||
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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.)
|
||||
*
|
||||
@@ -47,7 +47,7 @@
|
||||
/* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib
|
||||
* can handle at once. This type need be no larger than 16 bits (so maximum of
|
||||
* 65535), this define allows us to discover how big it is, but limited by the
|
||||
* maximuum for png_size_t. The value can be overriden in a library build
|
||||
* maximum for size_t. The value can be overridden in a library build
|
||||
* (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably
|
||||
* lower value (e.g. 255 works). A lower value may help memory usage (slightly)
|
||||
* and may even improve performance on some systems (and degrade it on others.)
|
||||
@@ -214,7 +214,7 @@ struct png_struct_def
|
||||
png_uint_32 height; /* height of image in pixels */
|
||||
png_uint_32 num_rows; /* number of rows in current pass */
|
||||
png_uint_32 usr_width; /* width of row at start of write */
|
||||
png_size_t rowbytes; /* size of row in bytes */
|
||||
size_t rowbytes; /* size of row in bytes */
|
||||
png_uint_32 iwidth; /* width of current interlaced row in pixels */
|
||||
png_uint_32 row_number; /* current row in interlace pass */
|
||||
png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */
|
||||
@@ -232,7 +232,7 @@ struct png_struct_def
|
||||
png_bytep try_row; /* buffer to save trial row when filtering */
|
||||
png_bytep tst_row; /* buffer to save best trial row when filtering */
|
||||
#endif
|
||||
png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */
|
||||
size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */
|
||||
|
||||
png_uint_32 idat_size; /* current IDAT size for read */
|
||||
png_uint_32 crc; /* current chunk CRC value */
|
||||
@@ -307,7 +307,7 @@ struct png_struct_def
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
|
||||
png_color_8 shift; /* shift for significant bit tranformation */
|
||||
png_color_8 shift; /* shift for significant bit transformation */
|
||||
#endif
|
||||
|
||||
#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
|
||||
@@ -328,10 +328,10 @@ struct png_struct_def
|
||||
png_bytep current_buffer; /* buffer for recently used data */
|
||||
png_uint_32 push_length; /* size of current input chunk */
|
||||
png_uint_32 skip_length; /* bytes to skip in input data */
|
||||
png_size_t save_buffer_size; /* amount of data now in save_buffer */
|
||||
png_size_t save_buffer_max; /* total size of save_buffer */
|
||||
png_size_t buffer_size; /* total amount of available input data */
|
||||
png_size_t current_buffer_size; /* amount of data now in current_buffer */
|
||||
size_t save_buffer_size; /* amount of data now in save_buffer */
|
||||
size_t save_buffer_max; /* total size of save_buffer */
|
||||
size_t buffer_size; /* total amount of available input data */
|
||||
size_t current_buffer_size; /* amount of data now in current_buffer */
|
||||
int process_mode; /* what push library is currently doing */
|
||||
int cur_palette; /* current push library palette index */
|
||||
|
||||
@@ -451,7 +451,7 @@ struct png_struct_def
|
||||
#endif
|
||||
|
||||
/* New member added in libpng-1.2.26 */
|
||||
png_size_t old_big_row_buf_size;
|
||||
size_t old_big_row_buf_size;
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
/* New member added in libpng-1.2.30 */
|
||||
|
||||
Vendored
+9
-9
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* Last changed in libpng 1.6.33 [September 28, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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.)
|
||||
*
|
||||
@@ -269,8 +269,8 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_size_t i;
|
||||
png_size_t istop = row_info->rowbytes;
|
||||
size_t i;
|
||||
size_t istop = row_info->rowbytes;
|
||||
|
||||
for (i = 0; i < istop; i++)
|
||||
{
|
||||
@@ -283,8 +283,8 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
row_info->bit_depth == 8)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_size_t i;
|
||||
png_size_t istop = row_info->rowbytes;
|
||||
size_t i;
|
||||
size_t istop = row_info->rowbytes;
|
||||
|
||||
for (i = 0; i < istop; i += 2)
|
||||
{
|
||||
@@ -298,8 +298,8 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
row_info->bit_depth == 16)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_size_t i;
|
||||
png_size_t istop = row_info->rowbytes;
|
||||
size_t i;
|
||||
size_t istop = row_info->rowbytes;
|
||||
|
||||
for (i = 0; i < istop; i += 4)
|
||||
{
|
||||
@@ -609,7 +609,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
|
||||
return; /* The filler channel has gone already */
|
||||
|
||||
/* Fix the rowbytes value. */
|
||||
row_info->rowbytes = (png_size_t)(dp-row);
|
||||
row_info->rowbytes = (size_t)(dp-row);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Vendored
+5
-5
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngwio.c - functions for data output
|
||||
*
|
||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
||||
* Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2014,2016,2018 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,7 +30,7 @@
|
||||
*/
|
||||
|
||||
void /* PRIVATE */
|
||||
png_write_data(png_structrp png_ptr, png_const_bytep data, png_size_t length)
|
||||
png_write_data(png_structrp png_ptr, png_const_bytep data, size_t length)
|
||||
{
|
||||
/* NOTE: write_data_fn must not change the buffer! */
|
||||
if (png_ptr->write_data_fn != NULL )
|
||||
@@ -48,9 +48,9 @@ png_write_data(png_structrp png_ptr, png_const_bytep data, png_size_t length)
|
||||
* than changing the library.
|
||||
*/
|
||||
void PNGCBAPI
|
||||
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
png_default_write_data(png_structp png_ptr, png_bytep data, size_t length)
|
||||
{
|
||||
png_size_t check;
|
||||
size_t check;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
Vendored
+4
-5
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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.)
|
||||
*
|
||||
@@ -1636,7 +1636,7 @@ png_write_image_16bit(png_voidp argument)
|
||||
* calculation can be done to 15 bits of accuracy; however, the output needs to
|
||||
* be scaled in the range 0..255*65535, so include that scaling here.
|
||||
*/
|
||||
# define UNP_RECIPROCAL(alpha) ((((0xffff*0xff)<<7)+(alpha>>1))/alpha)
|
||||
# define UNP_RECIPROCAL(alpha) ((((0xffff*0xff)<<7)+((alpha)>>1))/(alpha))
|
||||
|
||||
static png_byte
|
||||
png_unpremultiply(png_uint_32 component, png_uint_32 alpha,
|
||||
@@ -2162,8 +2162,7 @@ png_image_write_main(png_voidp argument)
|
||||
|
||||
|
||||
static void (PNGCBAPI
|
||||
image_memory_write)(png_structp png_ptr, png_bytep/*const*/ data,
|
||||
png_size_t size)
|
||||
image_memory_write)(png_structp png_ptr, png_bytep/*const*/ data, size_t size)
|
||||
{
|
||||
png_image_write_control *display = png_voidcast(png_image_write_control*,
|
||||
png_ptr->io_ptr/*backdoor: png_get_io_ptr(png_ptr)*/);
|
||||
|
||||
Vendored
+5
-5
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||
*
|
||||
* Last changed in libpng 1.6.26 [October 20, 2016]
|
||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 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.)
|
||||
*
|
||||
@@ -212,9 +212,9 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
||||
if (row_info->bit_depth < 8)
|
||||
{
|
||||
png_bytep bp = row;
|
||||
png_size_t i;
|
||||
size_t i;
|
||||
unsigned int mask;
|
||||
png_size_t row_bytes = row_info->rowbytes;
|
||||
size_t row_bytes = row_info->rowbytes;
|
||||
|
||||
if (bit_depth->gray == 1 && row_info->bit_depth == 2)
|
||||
mask = 0x55;
|
||||
@@ -514,7 +514,7 @@ png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
|
||||
(png_ptr, /* png_ptr */
|
||||
row_info, /* row_info: */
|
||||
/* png_uint_32 width; width of row */
|
||||
/* png_size_t rowbytes; number of bytes in row */
|
||||
/* size_t rowbytes; number of bytes in row */
|
||||
/* png_byte color_type; color type of pixels */
|
||||
/* png_byte bit_depth; bit depth of samples */
|
||||
/* png_byte channels; number of channels (1-4) */
|
||||
|
||||
Vendored
+79
-82
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.35 [July 15, 2018]
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 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.)
|
||||
*
|
||||
@@ -59,7 +59,7 @@ png_write_sig(png_structrp png_ptr)
|
||||
|
||||
/* Write the rest of the 8 byte signature */
|
||||
png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
|
||||
(png_size_t)(8 - png_ptr->sig_bytes));
|
||||
(size_t)(8 - png_ptr->sig_bytes));
|
||||
|
||||
if (png_ptr->sig_bytes < 3)
|
||||
png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
|
||||
@@ -124,8 +124,7 @@ png_write_chunk_start(png_structrp png_ptr, png_const_bytep chunk_string,
|
||||
* given to png_write_chunk_header().
|
||||
*/
|
||||
void PNGAPI
|
||||
png_write_chunk_data(png_structrp png_ptr, png_const_bytep data,
|
||||
png_size_t length)
|
||||
png_write_chunk_data(png_structrp png_ptr, png_const_bytep data, size_t length)
|
||||
{
|
||||
/* Write the data, and run the CRC over it */
|
||||
if (png_ptr == NULL)
|
||||
@@ -160,7 +159,7 @@ png_write_chunk_end(png_structrp png_ptr)
|
||||
/* Write the crc in a single operation */
|
||||
png_save_uint_32(buf, png_ptr->crc);
|
||||
|
||||
png_write_data(png_ptr, buf, (png_size_t)4);
|
||||
png_write_data(png_ptr, buf, 4);
|
||||
}
|
||||
|
||||
/* Write a PNG chunk all at once. The type is an array of ASCII characters
|
||||
@@ -174,7 +173,7 @@ png_write_chunk_end(png_structrp png_ptr)
|
||||
*/
|
||||
static void
|
||||
png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name,
|
||||
png_const_bytep data, png_size_t length)
|
||||
png_const_bytep data, size_t length)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
@@ -191,7 +190,7 @@ png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name,
|
||||
/* This is the API that calls the internal function above. */
|
||||
void PNGAPI
|
||||
png_write_chunk(png_structrp png_ptr, png_const_bytep chunk_string,
|
||||
png_const_bytep data, png_size_t length)
|
||||
png_const_bytep data, size_t length)
|
||||
{
|
||||
png_write_complete_chunk(png_ptr, PNG_CHUNK_FROM_STRING(chunk_string), data,
|
||||
length);
|
||||
@@ -820,7 +819,7 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
|
||||
buf[12] = (png_byte)interlace_type;
|
||||
|
||||
/* Write the chunk */
|
||||
png_write_complete_chunk(png_ptr, png_IHDR, buf, (png_size_t)13);
|
||||
png_write_complete_chunk(png_ptr, png_IHDR, buf, 13);
|
||||
|
||||
if ((png_ptr->do_filter) == PNG_NO_FILTERS)
|
||||
{
|
||||
@@ -889,7 +888,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
|
||||
buf[0] = pal_ptr->red;
|
||||
buf[1] = pal_ptr->green;
|
||||
buf[2] = pal_ptr->blue;
|
||||
png_write_chunk_data(png_ptr, buf, (png_size_t)3);
|
||||
png_write_chunk_data(png_ptr, buf, 3);
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -903,7 +902,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
|
||||
buf[0] = pal_ptr[i].red;
|
||||
buf[1] = pal_ptr[i].green;
|
||||
buf[2] = pal_ptr[i].blue;
|
||||
png_write_chunk_data(png_ptr, buf, (png_size_t)3);
|
||||
png_write_chunk_data(png_ptr, buf, 3);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1075,7 +1074,7 @@ png_write_IEND(png_structrp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_write_IEND");
|
||||
|
||||
png_write_complete_chunk(png_ptr, png_IEND, NULL, (png_size_t)0);
|
||||
png_write_complete_chunk(png_ptr, png_IEND, NULL, 0);
|
||||
png_ptr->mode |= PNG_HAVE_IEND;
|
||||
}
|
||||
|
||||
@@ -1090,7 +1089,7 @@ png_write_gAMA_fixed(png_structrp png_ptr, png_fixed_point file_gamma)
|
||||
|
||||
/* file_gamma is saved in 1/100,000ths */
|
||||
png_save_uint_32(buf, (png_uint_32)file_gamma);
|
||||
png_write_complete_chunk(png_ptr, png_gAMA, buf, (png_size_t)4);
|
||||
png_write_complete_chunk(png_ptr, png_gAMA, buf, 4);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1108,7 +1107,7 @@ png_write_sRGB(png_structrp png_ptr, int srgb_intent)
|
||||
"Invalid sRGB rendering intent specified");
|
||||
|
||||
buf[0]=(png_byte)srgb_intent;
|
||||
png_write_complete_chunk(png_ptr, png_sRGB, buf, (png_size_t)1);
|
||||
png_write_complete_chunk(png_ptr, png_sRGB, buf, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1182,8 +1181,8 @@ png_write_sPLT(png_structrp png_ptr, png_const_sPLT_tp spalette)
|
||||
png_uint_32 name_len;
|
||||
png_byte new_name[80];
|
||||
png_byte entrybuf[10];
|
||||
png_size_t entry_size = (spalette->depth == 8 ? 6 : 10);
|
||||
png_size_t palette_size = entry_size * (png_size_t)spalette->nentries;
|
||||
size_t entry_size = (spalette->depth == 8 ? 6 : 10);
|
||||
size_t palette_size = entry_size * (size_t)spalette->nentries;
|
||||
png_sPLT_entryp ep;
|
||||
#ifndef PNG_POINTER_INDEXING_SUPPORTED
|
||||
int i;
|
||||
@@ -1200,10 +1199,9 @@ png_write_sPLT(png_structrp png_ptr, png_const_sPLT_tp spalette)
|
||||
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_size_t)(name_len + 1));
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_name, (size_t)(name_len + 1));
|
||||
|
||||
png_write_chunk_data(png_ptr, &spalette->depth, (png_size_t)1);
|
||||
png_write_chunk_data(png_ptr, &spalette->depth, 1);
|
||||
|
||||
/* Loop through each palette entry, writing appropriately */
|
||||
#ifdef PNG_POINTER_INDEXING_SUPPORTED
|
||||
@@ -1265,7 +1263,7 @@ void /* PRIVATE */
|
||||
png_write_sBIT(png_structrp png_ptr, png_const_color_8p sbit, int color_type)
|
||||
{
|
||||
png_byte buf[4];
|
||||
png_size_t size;
|
||||
size_t size;
|
||||
|
||||
png_debug(1, "in png_write_sBIT");
|
||||
|
||||
@@ -1365,7 +1363,7 @@ png_write_tRNS(png_structrp 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);
|
||||
(size_t)num_trans);
|
||||
}
|
||||
|
||||
else if (color_type == PNG_COLOR_TYPE_GRAY)
|
||||
@@ -1380,7 +1378,7 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha,
|
||||
}
|
||||
|
||||
png_save_uint_16(buf, tran->gray);
|
||||
png_write_complete_chunk(png_ptr, png_tRNS, buf, (png_size_t)2);
|
||||
png_write_complete_chunk(png_ptr, png_tRNS, buf, 2);
|
||||
}
|
||||
|
||||
else if (color_type == PNG_COLOR_TYPE_RGB)
|
||||
@@ -1400,7 +1398,7 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha,
|
||||
return;
|
||||
}
|
||||
|
||||
png_write_complete_chunk(png_ptr, png_tRNS, buf, (png_size_t)6);
|
||||
png_write_complete_chunk(png_ptr, png_tRNS, buf, 6);
|
||||
}
|
||||
|
||||
else
|
||||
@@ -1433,7 +1431,7 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
|
||||
}
|
||||
|
||||
buf[0] = back->index;
|
||||
png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)1);
|
||||
png_write_complete_chunk(png_ptr, png_bKGD, buf, 1);
|
||||
}
|
||||
|
||||
else if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
|
||||
@@ -1454,7 +1452,7 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
|
||||
return;
|
||||
}
|
||||
|
||||
png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)6);
|
||||
png_write_complete_chunk(png_ptr, png_bKGD, buf, 6);
|
||||
}
|
||||
|
||||
else
|
||||
@@ -1468,7 +1466,7 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
|
||||
}
|
||||
|
||||
png_save_uint_16(buf, back->gray);
|
||||
png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)2);
|
||||
png_write_complete_chunk(png_ptr, png_bKGD, buf, 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1488,7 +1486,7 @@ png_write_eXIf(png_structrp png_ptr, png_bytep exif, int num_exif)
|
||||
for (i = 0; i < num_exif; i++)
|
||||
{
|
||||
buf[0] = exif[i];
|
||||
png_write_chunk_data(png_ptr, buf, (png_size_t)1);
|
||||
png_write_chunk_data(png_ptr, buf, 1);
|
||||
}
|
||||
|
||||
png_write_chunk_end(png_ptr);
|
||||
@@ -1519,7 +1517,7 @@ png_write_hIST(png_structrp png_ptr, png_const_uint_16p hist, int num_hist)
|
||||
for (i = 0; i < num_hist; i++)
|
||||
{
|
||||
png_save_uint_16(buf, hist[i]);
|
||||
png_write_chunk_data(png_ptr, buf, (png_size_t)2);
|
||||
png_write_chunk_data(png_ptr, buf, 2);
|
||||
}
|
||||
|
||||
png_write_chunk_end(png_ptr);
|
||||
@@ -1530,7 +1528,7 @@ png_write_hIST(png_structrp png_ptr, png_const_uint_16p hist, int num_hist)
|
||||
/* Write a tEXt chunk */
|
||||
void /* PRIVATE */
|
||||
png_write_tEXt(png_structrp png_ptr, png_const_charp key, png_const_charp text,
|
||||
png_size_t text_len)
|
||||
size_t text_len)
|
||||
{
|
||||
png_uint_32 key_len;
|
||||
png_byte new_key[80];
|
||||
@@ -1627,7 +1625,7 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
|
||||
png_const_charp lang, png_const_charp lang_key, png_const_charp text)
|
||||
{
|
||||
png_uint_32 key_len, prefix_len;
|
||||
png_size_t lang_len, lang_key_len;
|
||||
size_t lang_len, lang_key_len;
|
||||
png_byte new_key[82];
|
||||
compression_state comp;
|
||||
|
||||
@@ -1737,7 +1735,7 @@ png_write_oFFs(png_structrp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
|
||||
png_save_int_32(buf + 4, y_offset);
|
||||
buf[8] = (png_byte)unit_type;
|
||||
|
||||
png_write_complete_chunk(png_ptr, png_oFFs, buf, (png_size_t)9);
|
||||
png_write_complete_chunk(png_ptr, png_oFFs, buf, 9);
|
||||
}
|
||||
#endif
|
||||
#ifdef PNG_WRITE_pCAL_SUPPORTED
|
||||
@@ -1748,7 +1746,7 @@ png_write_pCAL(png_structrp png_ptr, png_charp purpose, png_int_32 X0,
|
||||
png_charpp params)
|
||||
{
|
||||
png_uint_32 purpose_len;
|
||||
png_size_t units_len, total_len;
|
||||
size_t units_len, total_len;
|
||||
png_size_tp params_len;
|
||||
png_byte buf[10];
|
||||
png_byte new_purpose[80];
|
||||
@@ -1772,7 +1770,7 @@ png_write_pCAL(png_structrp png_ptr, png_charp purpose, png_int_32 X0,
|
||||
total_len = purpose_len + units_len + 10;
|
||||
|
||||
params_len = (png_size_tp)png_malloc(png_ptr,
|
||||
(png_alloc_size_t)((png_alloc_size_t)nparams * (sizeof (png_size_t))));
|
||||
(png_alloc_size_t)((png_alloc_size_t)nparams * (sizeof (size_t))));
|
||||
|
||||
/* Find the length of each parameter, making sure we don't count the
|
||||
* null terminator for the last parameter.
|
||||
@@ -1792,8 +1790,8 @@ png_write_pCAL(png_structrp png_ptr, png_charp purpose, png_int_32 X0,
|
||||
png_save_int_32(buf + 4, X1);
|
||||
buf[8] = (png_byte)type;
|
||||
buf[9] = (png_byte)nparams;
|
||||
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_write_chunk_data(png_ptr, buf, 10);
|
||||
png_write_chunk_data(png_ptr, (png_const_bytep)units, (size_t)units_len);
|
||||
|
||||
for (i = 0; i < nparams; i++)
|
||||
{
|
||||
@@ -1812,7 +1810,7 @@ png_write_sCAL_s(png_structrp png_ptr, int unit, png_const_charp width,
|
||||
png_const_charp height)
|
||||
{
|
||||
png_byte buf[64];
|
||||
png_size_t wlen, hlen, total_len;
|
||||
size_t wlen, hlen, total_len;
|
||||
|
||||
png_debug(1, "in png_write_sCAL_s");
|
||||
|
||||
@@ -1853,7 +1851,7 @@ png_write_pHYs(png_structrp png_ptr, png_uint_32 x_pixels_per_unit,
|
||||
png_save_uint_32(buf + 4, y_pixels_per_unit);
|
||||
buf[8] = (png_byte)unit_type;
|
||||
|
||||
png_write_complete_chunk(png_ptr, png_pHYs, buf, (png_size_t)9);
|
||||
png_write_complete_chunk(png_ptr, png_pHYs, buf, 9);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1883,7 +1881,7 @@ png_write_tIME(png_structrp png_ptr, png_const_timep mod_time)
|
||||
buf[5] = mod_time->minute;
|
||||
buf[6] = mod_time->second;
|
||||
|
||||
png_write_complete_chunk(png_ptr, png_tIME, buf, (png_size_t)7);
|
||||
png_write_complete_chunk(png_ptr, png_tIME, buf, 7);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2073,8 +2071,8 @@ png_write_finish_row(png_structrp png_ptr)
|
||||
{
|
||||
if (png_ptr->prev_row != NULL)
|
||||
memset(png_ptr->prev_row, 0,
|
||||
(png_size_t)(PNG_ROWBYTES(png_ptr->usr_channels*
|
||||
png_ptr->usr_bit_depth, png_ptr->width)) + 1);
|
||||
PNG_ROWBYTES(png_ptr->usr_channels *
|
||||
png_ptr->usr_bit_depth, png_ptr->width) + 1);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2130,7 +2128,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
||||
for (i = png_pass_start[pass]; i < row_width;
|
||||
i += png_pass_inc[pass])
|
||||
{
|
||||
sp = row + (png_size_t)(i >> 3);
|
||||
sp = row + (size_t)(i >> 3);
|
||||
value = (int)(*sp >> (7 - (int)(i & 0x07))) & 0x01;
|
||||
d |= (value << shift);
|
||||
|
||||
@@ -2168,7 +2166,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
||||
for (i = png_pass_start[pass]; i < row_width;
|
||||
i += png_pass_inc[pass])
|
||||
{
|
||||
sp = row + (png_size_t)(i >> 2);
|
||||
sp = row + (size_t)(i >> 2);
|
||||
value = (*sp >> ((3 - (int)(i & 0x03)) << 1)) & 0x03;
|
||||
d |= (value << shift);
|
||||
|
||||
@@ -2204,7 +2202,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
||||
for (i = png_pass_start[pass]; i < row_width;
|
||||
i += png_pass_inc[pass])
|
||||
{
|
||||
sp = row + (png_size_t)(i >> 1);
|
||||
sp = row + (size_t)(i >> 1);
|
||||
value = (*sp >> ((1 - (int)(i & 0x01)) << 2)) & 0x0f;
|
||||
d |= (value << shift);
|
||||
|
||||
@@ -2230,7 +2228,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
||||
png_bytep dp;
|
||||
png_uint_32 i;
|
||||
png_uint_32 row_width = row_info->width;
|
||||
png_size_t pixel_bytes;
|
||||
size_t pixel_bytes;
|
||||
|
||||
/* Start at the beginning */
|
||||
dp = row;
|
||||
@@ -2243,7 +2241,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
||||
i += png_pass_inc[pass])
|
||||
{
|
||||
/* Find out where the original pixel is */
|
||||
sp = row + (png_size_t)i * pixel_bytes;
|
||||
sp = row + (size_t)i * pixel_bytes;
|
||||
|
||||
/* Move the pixel */
|
||||
if (dp != sp)
|
||||
@@ -2274,16 +2272,16 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
||||
*/
|
||||
static void /* PRIVATE */
|
||||
png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
|
||||
png_size_t row_bytes);
|
||||
size_t row_bytes);
|
||||
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
static png_size_t /* PRIVATE */
|
||||
static size_t /* PRIVATE */
|
||||
png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
const png_size_t row_bytes, const png_size_t lmins)
|
||||
size_t row_bytes, size_t lmins)
|
||||
{
|
||||
png_bytep rp, dp, lp;
|
||||
png_size_t i;
|
||||
png_size_t sum = 0;
|
||||
size_t i;
|
||||
size_t sum = 0;
|
||||
unsigned int v;
|
||||
|
||||
png_ptr->try_row[0] = PNG_FILTER_VALUE_SUB;
|
||||
@@ -2318,10 +2316,10 @@ png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
|
||||
static void /* PRIVATE */
|
||||
png_setup_sub_row_only(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
const png_size_t row_bytes)
|
||||
size_t row_bytes)
|
||||
{
|
||||
png_bytep rp, dp, lp;
|
||||
png_size_t i;
|
||||
size_t i;
|
||||
|
||||
png_ptr->try_row[0] = PNG_FILTER_VALUE_SUB;
|
||||
|
||||
@@ -2338,13 +2336,12 @@ png_setup_sub_row_only(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
}
|
||||
}
|
||||
|
||||
static png_size_t /* PRIVATE */
|
||||
png_setup_up_row(png_structrp png_ptr, const png_size_t row_bytes,
|
||||
const png_size_t lmins)
|
||||
static size_t /* PRIVATE */
|
||||
png_setup_up_row(png_structrp png_ptr, size_t row_bytes, size_t lmins)
|
||||
{
|
||||
png_bytep rp, dp, pp;
|
||||
png_size_t i;
|
||||
png_size_t sum = 0;
|
||||
size_t i;
|
||||
size_t sum = 0;
|
||||
unsigned int v;
|
||||
|
||||
png_ptr->try_row[0] = PNG_FILTER_VALUE_UP;
|
||||
@@ -2367,10 +2364,10 @@ png_setup_up_row(png_structrp png_ptr, const png_size_t row_bytes,
|
||||
return (sum);
|
||||
}
|
||||
static void /* PRIVATE */
|
||||
png_setup_up_row_only(png_structrp png_ptr, const png_size_t row_bytes)
|
||||
png_setup_up_row_only(png_structrp png_ptr, size_t row_bytes)
|
||||
{
|
||||
png_bytep rp, dp, pp;
|
||||
png_size_t i;
|
||||
size_t i;
|
||||
|
||||
png_ptr->try_row[0] = PNG_FILTER_VALUE_UP;
|
||||
|
||||
@@ -2382,13 +2379,13 @@ png_setup_up_row_only(png_structrp png_ptr, const png_size_t row_bytes)
|
||||
}
|
||||
}
|
||||
|
||||
static png_size_t /* PRIVATE */
|
||||
static size_t /* PRIVATE */
|
||||
png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
const png_size_t row_bytes, const png_size_t lmins)
|
||||
size_t row_bytes, size_t lmins)
|
||||
{
|
||||
png_bytep rp, dp, pp, lp;
|
||||
png_uint_32 i;
|
||||
png_size_t sum = 0;
|
||||
size_t sum = 0;
|
||||
unsigned int v;
|
||||
|
||||
png_ptr->try_row[0] = PNG_FILTER_VALUE_AVG;
|
||||
@@ -2424,7 +2421,7 @@ png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
}
|
||||
static void /* PRIVATE */
|
||||
png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
const png_size_t row_bytes)
|
||||
size_t row_bytes)
|
||||
{
|
||||
png_bytep rp, dp, pp, lp;
|
||||
png_uint_32 i;
|
||||
@@ -2444,13 +2441,13 @@ png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
}
|
||||
}
|
||||
|
||||
static png_size_t /* PRIVATE */
|
||||
static size_t /* PRIVATE */
|
||||
png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
const png_size_t row_bytes, const png_size_t lmins)
|
||||
size_t row_bytes, size_t lmins)
|
||||
{
|
||||
png_bytep rp, dp, pp, cp, lp;
|
||||
png_size_t i;
|
||||
png_size_t sum = 0;
|
||||
size_t i;
|
||||
size_t sum = 0;
|
||||
unsigned int v;
|
||||
|
||||
png_ptr->try_row[0] = PNG_FILTER_VALUE_PAETH;
|
||||
@@ -2507,10 +2504,10 @@ png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
}
|
||||
static void /* PRIVATE */
|
||||
png_setup_paeth_row_only(png_structrp png_ptr, const png_uint_32 bpp,
|
||||
const png_size_t row_bytes)
|
||||
size_t row_bytes)
|
||||
{
|
||||
png_bytep rp, dp, pp, cp, lp;
|
||||
png_size_t i;
|
||||
size_t i;
|
||||
|
||||
png_ptr->try_row[0] = PNG_FILTER_VALUE_PAETH;
|
||||
|
||||
@@ -2559,8 +2556,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
|
||||
png_bytep row_buf;
|
||||
png_bytep best_row;
|
||||
png_uint_32 bpp;
|
||||
png_size_t mins;
|
||||
png_size_t row_bytes = row_info->rowbytes;
|
||||
size_t mins;
|
||||
size_t row_bytes = row_info->rowbytes;
|
||||
|
||||
png_debug(1, "in png_write_find_filter");
|
||||
|
||||
@@ -2615,8 +2612,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
|
||||
* 'none' filter.
|
||||
*/
|
||||
png_bytep rp;
|
||||
png_size_t sum = 0;
|
||||
png_size_t i;
|
||||
size_t sum = 0;
|
||||
size_t i;
|
||||
unsigned int v;
|
||||
|
||||
{
|
||||
@@ -2644,8 +2641,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
|
||||
|
||||
else if ((filter_to_do & PNG_FILTER_SUB) != 0)
|
||||
{
|
||||
png_size_t sum;
|
||||
png_size_t lmins = mins;
|
||||
size_t sum;
|
||||
size_t lmins = mins;
|
||||
|
||||
sum = png_setup_sub_row(png_ptr, bpp, row_bytes, lmins);
|
||||
|
||||
@@ -2670,8 +2667,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
|
||||
|
||||
else if ((filter_to_do & PNG_FILTER_UP) != 0)
|
||||
{
|
||||
png_size_t sum;
|
||||
png_size_t lmins = mins;
|
||||
size_t sum;
|
||||
size_t lmins = mins;
|
||||
|
||||
sum = png_setup_up_row(png_ptr, row_bytes, lmins);
|
||||
|
||||
@@ -2696,8 +2693,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
|
||||
|
||||
else if ((filter_to_do & PNG_FILTER_AVG) != 0)
|
||||
{
|
||||
png_size_t sum;
|
||||
png_size_t lmins = mins;
|
||||
size_t sum;
|
||||
size_t lmins = mins;
|
||||
|
||||
sum= png_setup_avg_row(png_ptr, bpp, row_bytes, lmins);
|
||||
|
||||
@@ -2722,8 +2719,8 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
|
||||
|
||||
else if ((filter_to_do & PNG_FILTER_PAETH) != 0)
|
||||
{
|
||||
png_size_t sum;
|
||||
png_size_t lmins = mins;
|
||||
size_t sum;
|
||||
size_t lmins = mins;
|
||||
|
||||
sum = png_setup_paeth_row(png_ptr, bpp, row_bytes, lmins);
|
||||
|
||||
@@ -2748,7 +2745,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
|
||||
/* Do the actual writing of a previously filtered row. */
|
||||
static void
|
||||
png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
|
||||
png_size_t full_row_length/*includes filter byte*/)
|
||||
size_t full_row_length/*includes filter byte*/)
|
||||
{
|
||||
png_debug(1, "in png_write_filtered_row");
|
||||
|
||||
|
||||
+2
-2
@@ -42,8 +42,8 @@
|
||||
png_byte i;\
|
||||
png_bytep rp = row + offset;\
|
||||
png_const_bytep pp = prev_row;\
|
||||
png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
|
||||
png_size_t istop;\
|
||||
size_t unaligned_top = 16 - (((size_t)rp % 16));\
|
||||
size_t istop;\
|
||||
if(unaligned_top == 16)\
|
||||
unaligned_top = 0;\
|
||||
istop = row_info->rowbytes;\
|
||||
|
||||
@@ -146,6 +146,14 @@ inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
|
||||
return __atomic_load_n(ptr, __ATOMIC_RELAXED);
|
||||
}
|
||||
|
||||
inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
|
||||
Atomic64 old_value,
|
||||
Atomic64 new_value) {
|
||||
__atomic_compare_exchange_n(ptr, &old_value, new_value, false,
|
||||
__ATOMIC_RELEASE, __ATOMIC_ACQUIRE);
|
||||
return old_value;
|
||||
}
|
||||
|
||||
#endif // defined(__LP64__)
|
||||
|
||||
} // namespace internal
|
||||
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
project(quirc)
|
||||
|
||||
set(CURR_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/include")
|
||||
|
||||
set_property(GLOBAL PROPERTY QUIRC_INCLUDE_DIR ${CURR_INCLUDE_DIR})
|
||||
ocv_include_directories(${CURR_INCLUDE_DIR})
|
||||
|
||||
file(GLOB_RECURSE quirc_headers RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "include/*.h")
|
||||
file(GLOB_RECURSE quirc_sources RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "src/*.c")
|
||||
|
||||
add_library(${PROJECT_NAME} STATIC ${quirc_headers} ${quirc_sources})
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable -Wshadow)
|
||||
|
||||
set_target_properties(${PROJECT_NAME}
|
||||
PROPERTIES OUTPUT_NAME ${PROJECT_NAME}
|
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||
COMPILE_PDB_NAME ${PROJECT_NAME}
|
||||
COMPILE_PDB_NAME_DEBUG "${PROJECT_NAME}${OPENCV_DEBUG_POSTFIX}"
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
||||
)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "3rdparty")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${PROJECT_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(${PROJECT_NAME} LICENSE)
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
quirc -- QR-code recognition library
|
||||
Copyright (C) 2010-2012 Daniel Beer <dlbeer@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for
|
||||
any purpose with or without fee is hereby granted, provided that the
|
||||
above copyright notice and this permission notice appear in all
|
||||
copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
Vendored
+173
@@ -0,0 +1,173 @@
|
||||
/* quirc -- QR-code recognition library
|
||||
* Copyright (C) 2010-2012 Daniel Beer <dlbeer@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef QUIRC_H_
|
||||
#define QUIRC_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct quirc;
|
||||
|
||||
/* Obtain the library version string. */
|
||||
const char *quirc_version(void);
|
||||
|
||||
/* Construct a new QR-code recognizer. This function will return NULL
|
||||
* if sufficient memory could not be allocated.
|
||||
*/
|
||||
struct quirc *quirc_new(void);
|
||||
|
||||
/* Destroy a QR-code recognizer. */
|
||||
void quirc_destroy(struct quirc *q);
|
||||
|
||||
/* Resize the QR-code recognizer. The size of an image must be
|
||||
* specified before codes can be analyzed.
|
||||
*
|
||||
* This function returns 0 on success, or -1 if sufficient memory could
|
||||
* not be allocated.
|
||||
*/
|
||||
int quirc_resize(struct quirc *q, int w, int h);
|
||||
|
||||
/* These functions are used to process images for QR-code recognition.
|
||||
* quirc_begin() must first be called to obtain access to a buffer into
|
||||
* which the input image should be placed. Optionally, the current
|
||||
* width and height may be returned.
|
||||
*
|
||||
* After filling the buffer, quirc_end() should be called to process
|
||||
* the image for QR-code recognition. The locations and content of each
|
||||
* code may be obtained using accessor functions described below.
|
||||
*/
|
||||
uint8_t *quirc_begin(struct quirc *q, int *w, int *h);
|
||||
void quirc_end(struct quirc *q);
|
||||
|
||||
/* This structure describes a location in the input image buffer. */
|
||||
struct quirc_point {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
/* This enum describes the various decoder errors which may occur. */
|
||||
typedef enum {
|
||||
QUIRC_SUCCESS = 0,
|
||||
QUIRC_ERROR_INVALID_GRID_SIZE,
|
||||
QUIRC_ERROR_INVALID_VERSION,
|
||||
QUIRC_ERROR_FORMAT_ECC,
|
||||
QUIRC_ERROR_DATA_ECC,
|
||||
QUIRC_ERROR_UNKNOWN_DATA_TYPE,
|
||||
QUIRC_ERROR_DATA_OVERFLOW,
|
||||
QUIRC_ERROR_DATA_UNDERFLOW
|
||||
} quirc_decode_error_t;
|
||||
|
||||
/* Return a string error message for an error code. */
|
||||
const char *quirc_strerror(quirc_decode_error_t err);
|
||||
|
||||
/* Limits on the maximum size of QR-codes and their content. */
|
||||
#define QUIRC_MAX_BITMAP 3917
|
||||
#define QUIRC_MAX_PAYLOAD 8896
|
||||
|
||||
/* QR-code ECC types. */
|
||||
#define QUIRC_ECC_LEVEL_M 0
|
||||
#define QUIRC_ECC_LEVEL_L 1
|
||||
#define QUIRC_ECC_LEVEL_H 2
|
||||
#define QUIRC_ECC_LEVEL_Q 3
|
||||
|
||||
/* QR-code data types. */
|
||||
#define QUIRC_DATA_TYPE_NUMERIC 1
|
||||
#define QUIRC_DATA_TYPE_ALPHA 2
|
||||
#define QUIRC_DATA_TYPE_BYTE 4
|
||||
#define QUIRC_DATA_TYPE_KANJI 8
|
||||
|
||||
/* Common character encodings */
|
||||
#define QUIRC_ECI_ISO_8859_1 1
|
||||
#define QUIRC_ECI_IBM437 2
|
||||
#define QUIRC_ECI_ISO_8859_2 4
|
||||
#define QUIRC_ECI_ISO_8859_3 5
|
||||
#define QUIRC_ECI_ISO_8859_4 6
|
||||
#define QUIRC_ECI_ISO_8859_5 7
|
||||
#define QUIRC_ECI_ISO_8859_6 8
|
||||
#define QUIRC_ECI_ISO_8859_7 9
|
||||
#define QUIRC_ECI_ISO_8859_8 10
|
||||
#define QUIRC_ECI_ISO_8859_9 11
|
||||
#define QUIRC_ECI_WINDOWS_874 13
|
||||
#define QUIRC_ECI_ISO_8859_13 15
|
||||
#define QUIRC_ECI_ISO_8859_15 17
|
||||
#define QUIRC_ECI_SHIFT_JIS 20
|
||||
#define QUIRC_ECI_UTF_8 26
|
||||
|
||||
/* This structure is used to return information about detected QR codes
|
||||
* in the input image.
|
||||
*/
|
||||
struct quirc_code {
|
||||
/* The four corners of the QR-code, from top left, clockwise */
|
||||
struct quirc_point corners[4];
|
||||
|
||||
/* The number of cells across in the QR-code. The cell bitmap
|
||||
* is a bitmask giving the actual values of cells. If the cell
|
||||
* at (x, y) is black, then the following bit is set:
|
||||
*
|
||||
* cell_bitmap[i >> 3] & (1 << (i & 7))
|
||||
*
|
||||
* where i = (y * size) + x.
|
||||
*/
|
||||
int size;
|
||||
uint8_t cell_bitmap[QUIRC_MAX_BITMAP];
|
||||
};
|
||||
|
||||
/* This structure holds the decoded QR-code data */
|
||||
struct quirc_data {
|
||||
/* Various parameters of the QR-code. These can mostly be
|
||||
* ignored if you only care about the data.
|
||||
*/
|
||||
int version;
|
||||
int ecc_level;
|
||||
int mask;
|
||||
|
||||
/* This field is the highest-valued data type found in the QR
|
||||
* code.
|
||||
*/
|
||||
int data_type;
|
||||
|
||||
/* Data payload. For the Kanji datatype, payload is encoded as
|
||||
* Shift-JIS. For all other datatypes, payload is ASCII text.
|
||||
*/
|
||||
uint8_t payload[QUIRC_MAX_PAYLOAD];
|
||||
int payload_len;
|
||||
|
||||
/* ECI assignment number */
|
||||
uint32_t eci;
|
||||
};
|
||||
|
||||
/* Return the number of QR-codes identified in the last processed
|
||||
* image.
|
||||
*/
|
||||
int quirc_count(const struct quirc *q);
|
||||
|
||||
/* Extract the QR-code specified by the given index. */
|
||||
void quirc_extract(const struct quirc *q, int index,
|
||||
struct quirc_code *code);
|
||||
|
||||
/* Decode a QR-code, returning the payload data. */
|
||||
quirc_decode_error_t quirc_decode(const struct quirc_code *code,
|
||||
struct quirc_data *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
/* quirc -- QR-code recognition library
|
||||
* Copyright (C) 2010-2012 Daniel Beer <dlbeer@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef QUIRC_INTERNAL_H_
|
||||
#define QUIRC_INTERNAL_H_
|
||||
|
||||
#include <quirc.h>
|
||||
|
||||
#define QUIRC_PIXEL_WHITE 0
|
||||
#define QUIRC_PIXEL_BLACK 1
|
||||
#define QUIRC_PIXEL_REGION 2
|
||||
|
||||
#ifndef QUIRC_MAX_REGIONS
|
||||
#define QUIRC_MAX_REGIONS 254
|
||||
#endif
|
||||
#define QUIRC_MAX_CAPSTONES 32
|
||||
#define QUIRC_MAX_GRIDS 8
|
||||
|
||||
#define QUIRC_PERSPECTIVE_PARAMS 8
|
||||
|
||||
#if QUIRC_MAX_REGIONS < UINT8_MAX
|
||||
typedef uint8_t quirc_pixel_t;
|
||||
#elif QUIRC_MAX_REGIONS < UINT16_MAX
|
||||
typedef uint16_t quirc_pixel_t;
|
||||
#else
|
||||
#error "QUIRC_MAX_REGIONS > 65534 is not supported"
|
||||
#endif
|
||||
|
||||
struct quirc_region {
|
||||
struct quirc_point seed;
|
||||
int count;
|
||||
int capstone;
|
||||
};
|
||||
|
||||
struct quirc_capstone {
|
||||
int ring;
|
||||
int stone;
|
||||
|
||||
struct quirc_point corners[4];
|
||||
struct quirc_point center;
|
||||
double c[QUIRC_PERSPECTIVE_PARAMS];
|
||||
|
||||
int qr_grid;
|
||||
};
|
||||
|
||||
struct quirc_grid {
|
||||
/* Capstone indices */
|
||||
int caps[3];
|
||||
|
||||
/* Alignment pattern region and corner */
|
||||
int align_region;
|
||||
struct quirc_point align;
|
||||
|
||||
/* Timing pattern endpoints */
|
||||
struct quirc_point tpep[3];
|
||||
int hscan;
|
||||
int vscan;
|
||||
|
||||
/* Grid size and perspective transform */
|
||||
int grid_size;
|
||||
double c[QUIRC_PERSPECTIVE_PARAMS];
|
||||
};
|
||||
|
||||
struct quirc {
|
||||
uint8_t *image;
|
||||
quirc_pixel_t *pixels;
|
||||
int *row_average; /* used by threshold() */
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int num_regions;
|
||||
struct quirc_region regions[QUIRC_MAX_REGIONS];
|
||||
|
||||
int num_capstones;
|
||||
struct quirc_capstone capstones[QUIRC_MAX_CAPSTONES];
|
||||
|
||||
int num_grids;
|
||||
struct quirc_grid grids[QUIRC_MAX_GRIDS];
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* QR-code version information database
|
||||
*/
|
||||
|
||||
#define QUIRC_MAX_VERSION 40
|
||||
#define QUIRC_MAX_ALIGNMENT 7
|
||||
|
||||
struct quirc_rs_params {
|
||||
int bs; /* Small block size */
|
||||
int dw; /* Small data words */
|
||||
int ns; /* Number of small blocks */
|
||||
};
|
||||
|
||||
struct quirc_version_info {
|
||||
int data_bytes;
|
||||
int apat[QUIRC_MAX_ALIGNMENT];
|
||||
struct quirc_rs_params ecc[4];
|
||||
};
|
||||
|
||||
extern const struct quirc_version_info quirc_version_db[QUIRC_MAX_VERSION + 1];
|
||||
|
||||
#endif
|
||||
Vendored
+919
@@ -0,0 +1,919 @@
|
||||
/* quirc -- QR-code recognition library
|
||||
* Copyright (C) 2010-2012 Daniel Beer <dlbeer@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <quirc_internal.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define MAX_POLY 64
|
||||
|
||||
/************************************************************************
|
||||
* Galois fields
|
||||
*/
|
||||
|
||||
struct galois_field {
|
||||
int p;
|
||||
const uint8_t *log;
|
||||
const uint8_t *exp;
|
||||
};
|
||||
|
||||
static const uint8_t gf16_exp[16] = {
|
||||
0x01, 0x02, 0x04, 0x08, 0x03, 0x06, 0x0c, 0x0b,
|
||||
0x05, 0x0a, 0x07, 0x0e, 0x0f, 0x0d, 0x09, 0x01
|
||||
};
|
||||
|
||||
static const uint8_t gf16_log[16] = {
|
||||
0x00, 0x0f, 0x01, 0x04, 0x02, 0x08, 0x05, 0x0a,
|
||||
0x03, 0x0e, 0x09, 0x07, 0x06, 0x0d, 0x0b, 0x0c
|
||||
};
|
||||
|
||||
static const struct galois_field gf16 = {
|
||||
.p = 15,
|
||||
.log = gf16_log,
|
||||
.exp = gf16_exp
|
||||
};
|
||||
|
||||
static const uint8_t gf256_exp[256] = {
|
||||
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
|
||||
0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26,
|
||||
0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9,
|
||||
0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0,
|
||||
0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35,
|
||||
0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23,
|
||||
0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0,
|
||||
0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1,
|
||||
0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc,
|
||||
0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0,
|
||||
0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f,
|
||||
0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2,
|
||||
0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88,
|
||||
0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce,
|
||||
0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93,
|
||||
0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc,
|
||||
0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9,
|
||||
0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54,
|
||||
0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa,
|
||||
0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73,
|
||||
0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e,
|
||||
0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff,
|
||||
0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4,
|
||||
0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41,
|
||||
0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e,
|
||||
0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6,
|
||||
0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef,
|
||||
0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09,
|
||||
0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5,
|
||||
0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16,
|
||||
0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83,
|
||||
0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x01
|
||||
};
|
||||
|
||||
static const uint8_t gf256_log[256] = {
|
||||
0x00, 0xff, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6,
|
||||
0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b,
|
||||
0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81,
|
||||
0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71,
|
||||
0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21,
|
||||
0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45,
|
||||
0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9,
|
||||
0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6,
|
||||
0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd,
|
||||
0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88,
|
||||
0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd,
|
||||
0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40,
|
||||
0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e,
|
||||
0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d,
|
||||
0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b,
|
||||
0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57,
|
||||
0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d,
|
||||
0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18,
|
||||
0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c,
|
||||
0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e,
|
||||
0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd,
|
||||
0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61,
|
||||
0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e,
|
||||
0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2,
|
||||
0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76,
|
||||
0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6,
|
||||
0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa,
|
||||
0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a,
|
||||
0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51,
|
||||
0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7,
|
||||
0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8,
|
||||
0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf
|
||||
};
|
||||
|
||||
static const struct galois_field gf256 = {
|
||||
.p = 255,
|
||||
.log = gf256_log,
|
||||
.exp = gf256_exp
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* Polynomial operations
|
||||
*/
|
||||
|
||||
static void poly_add(uint8_t *dst, const uint8_t *src, uint8_t c,
|
||||
int shift, const struct galois_field *gf)
|
||||
{
|
||||
int i;
|
||||
int log_c = gf->log[c];
|
||||
|
||||
if (!c)
|
||||
return;
|
||||
|
||||
for (i = 0; i < MAX_POLY; i++) {
|
||||
int p = i + shift;
|
||||
uint8_t v = src[i];
|
||||
|
||||
if (p < 0 || p >= MAX_POLY)
|
||||
continue;
|
||||
if (!v)
|
||||
continue;
|
||||
|
||||
dst[p] ^= gf->exp[(gf->log[v] + log_c) % gf->p];
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t poly_eval(const uint8_t *s, uint8_t x,
|
||||
const struct galois_field *gf)
|
||||
{
|
||||
int i;
|
||||
uint8_t sum = 0;
|
||||
uint8_t log_x = gf->log[x];
|
||||
|
||||
if (!x)
|
||||
return s[0];
|
||||
|
||||
for (i = 0; i < MAX_POLY; i++) {
|
||||
uint8_t c = s[i];
|
||||
|
||||
if (!c)
|
||||
continue;
|
||||
|
||||
sum ^= gf->exp[(gf->log[c] + log_x * i) % gf->p];
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Berlekamp-Massey algorithm for finding error locator polynomials.
|
||||
*/
|
||||
|
||||
static void berlekamp_massey(const uint8_t *s, int N,
|
||||
const struct galois_field *gf,
|
||||
uint8_t *sigma)
|
||||
{
|
||||
uint8_t C[MAX_POLY];
|
||||
uint8_t B[MAX_POLY];
|
||||
int L = 0;
|
||||
int m = 1;
|
||||
uint8_t b = 1;
|
||||
int n;
|
||||
|
||||
memset(B, 0, sizeof(B));
|
||||
memset(C, 0, sizeof(C));
|
||||
B[0] = 1;
|
||||
C[0] = 1;
|
||||
|
||||
for (n = 0; n < N; n++) {
|
||||
uint8_t d = s[n];
|
||||
uint8_t mult;
|
||||
int i;
|
||||
|
||||
for (i = 1; i <= L; i++) {
|
||||
if (!(C[i] && s[n - i]))
|
||||
continue;
|
||||
|
||||
d ^= gf->exp[(gf->log[C[i]] +
|
||||
gf->log[s[n - i]]) %
|
||||
gf->p];
|
||||
}
|
||||
|
||||
mult = gf->exp[(gf->p - gf->log[b] + gf->log[d]) % gf->p];
|
||||
|
||||
if (!d) {
|
||||
m++;
|
||||
} else if (L * 2 <= n) {
|
||||
uint8_t T[MAX_POLY];
|
||||
|
||||
memcpy(T, C, sizeof(T));
|
||||
poly_add(C, B, mult, m, gf);
|
||||
memcpy(B, T, sizeof(B));
|
||||
L = n + 1 - L;
|
||||
b = d;
|
||||
m = 1;
|
||||
} else {
|
||||
poly_add(C, B, mult, m, gf);
|
||||
m++;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(sigma, C, MAX_POLY);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Code stream error correction
|
||||
*
|
||||
* Generator polynomial for GF(2^8) is x^8 + x^4 + x^3 + x^2 + 1
|
||||
*/
|
||||
|
||||
static int block_syndromes(const uint8_t *data, int bs, int npar, uint8_t *s)
|
||||
{
|
||||
int nonzero = 0;
|
||||
int i;
|
||||
|
||||
memset(s, 0, MAX_POLY);
|
||||
|
||||
for (i = 0; i < npar; i++) {
|
||||
int j;
|
||||
|
||||
for (j = 0; j < bs; j++) {
|
||||
uint8_t c = data[bs - j - 1];
|
||||
|
||||
if (!c)
|
||||
continue;
|
||||
|
||||
s[i] ^= gf256_exp[((int)gf256_log[c] +
|
||||
i * j) % 255];
|
||||
}
|
||||
|
||||
if (s[i])
|
||||
nonzero = 1;
|
||||
}
|
||||
|
||||
return nonzero;
|
||||
}
|
||||
|
||||
static void eloc_poly(uint8_t *omega,
|
||||
const uint8_t *s, const uint8_t *sigma,
|
||||
int npar)
|
||||
{
|
||||
int i;
|
||||
|
||||
memset(omega, 0, MAX_POLY);
|
||||
|
||||
for (i = 0; i < npar; i++) {
|
||||
const uint8_t a = sigma[i];
|
||||
const uint8_t log_a = gf256_log[a];
|
||||
int j;
|
||||
|
||||
if (!a)
|
||||
continue;
|
||||
|
||||
for (j = 0; j + 1 < MAX_POLY; j++) {
|
||||
const uint8_t b = s[j + 1];
|
||||
|
||||
if (i + j >= npar)
|
||||
break;
|
||||
|
||||
if (!b)
|
||||
continue;
|
||||
|
||||
omega[i + j] ^=
|
||||
gf256_exp[(log_a + gf256_log[b]) % 255];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static quirc_decode_error_t correct_block(uint8_t *data,
|
||||
const struct quirc_rs_params *ecc)
|
||||
{
|
||||
int npar = ecc->bs - ecc->dw;
|
||||
uint8_t s[MAX_POLY];
|
||||
uint8_t sigma[MAX_POLY];
|
||||
uint8_t sigma_deriv[MAX_POLY];
|
||||
uint8_t omega[MAX_POLY];
|
||||
int i;
|
||||
|
||||
/* Compute syndrome vector */
|
||||
if (!block_syndromes(data, ecc->bs, npar, s))
|
||||
return QUIRC_SUCCESS;
|
||||
|
||||
berlekamp_massey(s, npar, &gf256, sigma);
|
||||
|
||||
/* Compute derivative of sigma */
|
||||
memset(sigma_deriv, 0, MAX_POLY);
|
||||
for (i = 0; i + 1 < MAX_POLY; i += 2)
|
||||
sigma_deriv[i] = sigma[i + 1];
|
||||
|
||||
/* Compute error evaluator polynomial */
|
||||
eloc_poly(omega, s, sigma, npar - 1);
|
||||
|
||||
/* Find error locations and magnitudes */
|
||||
for (i = 0; i < ecc->bs; i++) {
|
||||
uint8_t xinv = gf256_exp[255 - i];
|
||||
|
||||
if (!poly_eval(sigma, xinv, &gf256)) {
|
||||
uint8_t sd_x = poly_eval(sigma_deriv, xinv, &gf256);
|
||||
uint8_t omega_x = poly_eval(omega, xinv, &gf256);
|
||||
uint8_t error = gf256_exp[(255 - gf256_log[sd_x] +
|
||||
gf256_log[omega_x]) % 255];
|
||||
|
||||
data[ecc->bs - i - 1] ^= error;
|
||||
}
|
||||
}
|
||||
|
||||
if (block_syndromes(data, ecc->bs, npar, s))
|
||||
return QUIRC_ERROR_DATA_ECC;
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Format value error correction
|
||||
*
|
||||
* Generator polynomial for GF(2^4) is x^4 + x + 1
|
||||
*/
|
||||
|
||||
#define FORMAT_MAX_ERROR 3
|
||||
#define FORMAT_SYNDROMES (FORMAT_MAX_ERROR * 2)
|
||||
#define FORMAT_BITS 15
|
||||
|
||||
static int format_syndromes(uint16_t u, uint8_t *s)
|
||||
{
|
||||
int i;
|
||||
int nonzero = 0;
|
||||
|
||||
memset(s, 0, MAX_POLY);
|
||||
|
||||
for (i = 0; i < FORMAT_SYNDROMES; i++) {
|
||||
int j;
|
||||
|
||||
s[i] = 0;
|
||||
for (j = 0; j < FORMAT_BITS; j++)
|
||||
if (u & (1 << j))
|
||||
s[i] ^= gf16_exp[((i + 1) * j) % 15];
|
||||
|
||||
if (s[i])
|
||||
nonzero = 1;
|
||||
}
|
||||
|
||||
return nonzero;
|
||||
}
|
||||
|
||||
static quirc_decode_error_t correct_format(uint16_t *f_ret)
|
||||
{
|
||||
uint16_t u = *f_ret;
|
||||
int i;
|
||||
uint8_t s[MAX_POLY];
|
||||
uint8_t sigma[MAX_POLY];
|
||||
|
||||
/* Evaluate U (received codeword) at each of alpha_1 .. alpha_6
|
||||
* to get S_1 .. S_6 (but we index them from 0).
|
||||
*/
|
||||
if (!format_syndromes(u, s))
|
||||
return QUIRC_SUCCESS;
|
||||
|
||||
berlekamp_massey(s, FORMAT_SYNDROMES, &gf16, sigma);
|
||||
|
||||
/* Now, find the roots of the polynomial */
|
||||
for (i = 0; i < 15; i++)
|
||||
if (!poly_eval(sigma, gf16_exp[15 - i], &gf16))
|
||||
u ^= (1 << i);
|
||||
|
||||
if (format_syndromes(u, s))
|
||||
return QUIRC_ERROR_FORMAT_ECC;
|
||||
|
||||
*f_ret = u;
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Decoder algorithm
|
||||
*/
|
||||
|
||||
struct datastream {
|
||||
uint8_t raw[QUIRC_MAX_PAYLOAD];
|
||||
int data_bits;
|
||||
int ptr;
|
||||
|
||||
uint8_t data[QUIRC_MAX_PAYLOAD];
|
||||
};
|
||||
|
||||
static inline int grid_bit(const struct quirc_code *code, int x, int y)
|
||||
{
|
||||
int p = y * code->size + x;
|
||||
|
||||
return (code->cell_bitmap[p >> 3] >> (p & 7)) & 1;
|
||||
}
|
||||
|
||||
static quirc_decode_error_t read_format(const struct quirc_code *code,
|
||||
struct quirc_data *data, int which)
|
||||
{
|
||||
int i;
|
||||
uint16_t format = 0;
|
||||
uint16_t fdata;
|
||||
quirc_decode_error_t err;
|
||||
|
||||
if (which) {
|
||||
for (i = 0; i < 7; i++)
|
||||
format = (format << 1) |
|
||||
grid_bit(code, 8, code->size - 1 - i);
|
||||
for (i = 0; i < 8; i++)
|
||||
format = (format << 1) |
|
||||
grid_bit(code, code->size - 8 + i, 8);
|
||||
} else {
|
||||
static const int xs[15] = {
|
||||
8, 8, 8, 8, 8, 8, 8, 8, 7, 5, 4, 3, 2, 1, 0
|
||||
};
|
||||
static const int ys[15] = {
|
||||
0, 1, 2, 3, 4, 5, 7, 8, 8, 8, 8, 8, 8, 8, 8
|
||||
};
|
||||
|
||||
for (i = 14; i >= 0; i--)
|
||||
format = (format << 1) | grid_bit(code, xs[i], ys[i]);
|
||||
}
|
||||
|
||||
format ^= 0x5412;
|
||||
|
||||
err = correct_format(&format);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
fdata = format >> 10;
|
||||
data->ecc_level = fdata >> 3;
|
||||
data->mask = fdata & 7;
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
static int mask_bit(int mask, int i, int j)
|
||||
{
|
||||
switch (mask) {
|
||||
case 0: return !((i + j) % 2);
|
||||
case 1: return !(i % 2);
|
||||
case 2: return !(j % 3);
|
||||
case 3: return !((i + j) % 3);
|
||||
case 4: return !(((i / 2) + (j / 3)) % 2);
|
||||
case 5: return !((i * j) % 2 + (i * j) % 3);
|
||||
case 6: return !(((i * j) % 2 + (i * j) % 3) % 2);
|
||||
case 7: return !(((i * j) % 3 + (i + j) % 2) % 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reserved_cell(int version, int i, int j)
|
||||
{
|
||||
const struct quirc_version_info *ver = &quirc_version_db[version];
|
||||
int size = version * 4 + 17;
|
||||
int ai = -1, aj = -1, a;
|
||||
|
||||
/* Finder + format: top left */
|
||||
if (i < 9 && j < 9)
|
||||
return 1;
|
||||
|
||||
/* Finder + format: bottom left */
|
||||
if (i + 8 >= size && j < 9)
|
||||
return 1;
|
||||
|
||||
/* Finder + format: top right */
|
||||
if (i < 9 && j + 8 >= size)
|
||||
return 1;
|
||||
|
||||
/* Exclude timing patterns */
|
||||
if (i == 6 || j == 6)
|
||||
return 1;
|
||||
|
||||
/* Exclude version info, if it exists. Version info sits adjacent to
|
||||
* the top-right and bottom-left finders in three rows, bounded by
|
||||
* the timing pattern.
|
||||
*/
|
||||
if (version >= 7) {
|
||||
if (i < 6 && j + 11 >= size)
|
||||
return 1;
|
||||
if (i + 11 >= size && j < 6)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Exclude alignment patterns */
|
||||
for (a = 0; a < QUIRC_MAX_ALIGNMENT && ver->apat[a]; a++) {
|
||||
int p = ver->apat[a];
|
||||
|
||||
if (abs(p - i) < 3)
|
||||
ai = a;
|
||||
if (abs(p - j) < 3)
|
||||
aj = a;
|
||||
}
|
||||
|
||||
if (ai >= 0 && aj >= 0) {
|
||||
a--;
|
||||
if (ai > 0 && ai < a)
|
||||
return 1;
|
||||
if (aj > 0 && aj < a)
|
||||
return 1;
|
||||
if (aj == a && ai == a)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void read_bit(const struct quirc_code *code,
|
||||
struct quirc_data *data,
|
||||
struct datastream *ds, int i, int j)
|
||||
{
|
||||
int bitpos = ds->data_bits & 7;
|
||||
int bytepos = ds->data_bits >> 3;
|
||||
int v = grid_bit(code, j, i);
|
||||
|
||||
if (mask_bit(data->mask, i, j))
|
||||
v ^= 1;
|
||||
|
||||
if (v)
|
||||
ds->raw[bytepos] |= (0x80 >> bitpos);
|
||||
|
||||
ds->data_bits++;
|
||||
}
|
||||
|
||||
static void read_data(const struct quirc_code *code,
|
||||
struct quirc_data *data,
|
||||
struct datastream *ds)
|
||||
{
|
||||
int y = code->size - 1;
|
||||
int x = code->size - 1;
|
||||
int dir = -1;
|
||||
|
||||
while (x > 0) {
|
||||
if (x == 6)
|
||||
x--;
|
||||
|
||||
if (!reserved_cell(data->version, y, x))
|
||||
read_bit(code, data, ds, y, x);
|
||||
|
||||
if (!reserved_cell(data->version, y, x - 1))
|
||||
read_bit(code, data, ds, y, x - 1);
|
||||
|
||||
y += dir;
|
||||
if (y < 0 || y >= code->size) {
|
||||
dir = -dir;
|
||||
x -= 2;
|
||||
y += dir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static quirc_decode_error_t codestream_ecc(struct quirc_data *data,
|
||||
struct datastream *ds)
|
||||
{
|
||||
const struct quirc_version_info *ver =
|
||||
&quirc_version_db[data->version];
|
||||
const struct quirc_rs_params *sb_ecc = &ver->ecc[data->ecc_level];
|
||||
struct quirc_rs_params lb_ecc;
|
||||
const int lb_count =
|
||||
(ver->data_bytes - sb_ecc->bs * sb_ecc->ns) / (sb_ecc->bs + 1);
|
||||
const int bc = lb_count + sb_ecc->ns;
|
||||
const int ecc_offset = sb_ecc->dw * bc + lb_count;
|
||||
int dst_offset = 0;
|
||||
int i;
|
||||
|
||||
memcpy(&lb_ecc, sb_ecc, sizeof(lb_ecc));
|
||||
lb_ecc.dw++;
|
||||
lb_ecc.bs++;
|
||||
|
||||
for (i = 0; i < bc; i++) {
|
||||
uint8_t *dst = ds->data + dst_offset;
|
||||
const struct quirc_rs_params *ecc =
|
||||
(i < sb_ecc->ns) ? sb_ecc : &lb_ecc;
|
||||
const int num_ec = ecc->bs - ecc->dw;
|
||||
quirc_decode_error_t err;
|
||||
int j;
|
||||
|
||||
for (j = 0; j < ecc->dw; j++)
|
||||
dst[j] = ds->raw[j * bc + i];
|
||||
for (j = 0; j < num_ec; j++)
|
||||
dst[ecc->dw + j] = ds->raw[ecc_offset + j * bc + i];
|
||||
|
||||
err = correct_block(dst, ecc);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
dst_offset += ecc->dw;
|
||||
}
|
||||
|
||||
ds->data_bits = dst_offset * 8;
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
static inline int bits_remaining(const struct datastream *ds)
|
||||
{
|
||||
return ds->data_bits - ds->ptr;
|
||||
}
|
||||
|
||||
static int take_bits(struct datastream *ds, int len)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
while (len && (ds->ptr < ds->data_bits)) {
|
||||
uint8_t b = ds->data[ds->ptr >> 3];
|
||||
int bitpos = ds->ptr & 7;
|
||||
|
||||
ret <<= 1;
|
||||
if ((b << bitpos) & 0x80)
|
||||
ret |= 1;
|
||||
|
||||
ds->ptr++;
|
||||
len--;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int numeric_tuple(struct quirc_data *data,
|
||||
struct datastream *ds,
|
||||
int bits, int digits)
|
||||
{
|
||||
int tuple;
|
||||
int i;
|
||||
|
||||
if (bits_remaining(ds) < bits)
|
||||
return -1;
|
||||
|
||||
tuple = take_bits(ds, bits);
|
||||
|
||||
for (i = digits - 1; i >= 0; i--) {
|
||||
data->payload[data->payload_len + i] = tuple % 10 + '0';
|
||||
tuple /= 10;
|
||||
}
|
||||
|
||||
data->payload_len += digits;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static quirc_decode_error_t decode_numeric(struct quirc_data *data,
|
||||
struct datastream *ds)
|
||||
{
|
||||
int bits = 14;
|
||||
int count;
|
||||
|
||||
if (data->version < 10)
|
||||
bits = 10;
|
||||
else if (data->version < 27)
|
||||
bits = 12;
|
||||
|
||||
count = take_bits(ds, bits);
|
||||
if (data->payload_len + count + 1 > QUIRC_MAX_PAYLOAD)
|
||||
return QUIRC_ERROR_DATA_OVERFLOW;
|
||||
|
||||
while (count >= 3) {
|
||||
if (numeric_tuple(data, ds, 10, 3) < 0)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
count -= 3;
|
||||
}
|
||||
|
||||
if (count >= 2) {
|
||||
if (numeric_tuple(data, ds, 7, 2) < 0)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
count -= 2;
|
||||
}
|
||||
|
||||
if (count) {
|
||||
if (numeric_tuple(data, ds, 4, 1) < 0)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
count--;
|
||||
}
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
static int alpha_tuple(struct quirc_data *data,
|
||||
struct datastream *ds,
|
||||
int bits, int digits)
|
||||
{
|
||||
int tuple;
|
||||
int i;
|
||||
|
||||
if (bits_remaining(ds) < bits)
|
||||
return -1;
|
||||
|
||||
tuple = take_bits(ds, bits);
|
||||
|
||||
for (i = 0; i < digits; i++) {
|
||||
static const char *alpha_map =
|
||||
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
||||
|
||||
data->payload[data->payload_len + digits - i - 1] =
|
||||
alpha_map[tuple % 45];
|
||||
tuple /= 45;
|
||||
}
|
||||
|
||||
data->payload_len += digits;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static quirc_decode_error_t decode_alpha(struct quirc_data *data,
|
||||
struct datastream *ds)
|
||||
{
|
||||
int bits = 13;
|
||||
int count;
|
||||
|
||||
if (data->version < 10)
|
||||
bits = 9;
|
||||
else if (data->version < 27)
|
||||
bits = 11;
|
||||
|
||||
count = take_bits(ds, bits);
|
||||
if (data->payload_len + count + 1 > QUIRC_MAX_PAYLOAD)
|
||||
return QUIRC_ERROR_DATA_OVERFLOW;
|
||||
|
||||
while (count >= 2) {
|
||||
if (alpha_tuple(data, ds, 11, 2) < 0)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
count -= 2;
|
||||
}
|
||||
|
||||
if (count) {
|
||||
if (alpha_tuple(data, ds, 6, 1) < 0)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
count--;
|
||||
}
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
static quirc_decode_error_t decode_byte(struct quirc_data *data,
|
||||
struct datastream *ds)
|
||||
{
|
||||
int bits = 16;
|
||||
int count;
|
||||
int i;
|
||||
|
||||
if (data->version < 10)
|
||||
bits = 8;
|
||||
|
||||
count = take_bits(ds, bits);
|
||||
if (data->payload_len + count + 1 > QUIRC_MAX_PAYLOAD)
|
||||
return QUIRC_ERROR_DATA_OVERFLOW;
|
||||
if (bits_remaining(ds) < count * 8)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
data->payload[data->payload_len++] = take_bits(ds, 8);
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
static quirc_decode_error_t decode_kanji(struct quirc_data *data,
|
||||
struct datastream *ds)
|
||||
{
|
||||
int bits = 12;
|
||||
int count;
|
||||
int i;
|
||||
|
||||
if (data->version < 10)
|
||||
bits = 8;
|
||||
else if (data->version < 27)
|
||||
bits = 10;
|
||||
|
||||
count = take_bits(ds, bits);
|
||||
if (data->payload_len + count * 2 + 1 > QUIRC_MAX_PAYLOAD)
|
||||
return QUIRC_ERROR_DATA_OVERFLOW;
|
||||
if (bits_remaining(ds) < count * 13)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
int d = take_bits(ds, 13);
|
||||
int msB = d / 0xc0;
|
||||
int lsB = d % 0xc0;
|
||||
int intermediate = (msB << 8) | lsB;
|
||||
uint16_t sjw;
|
||||
|
||||
if (intermediate + 0x8140 <= 0x9ffc) {
|
||||
/* bytes are in the range 0x8140 to 0x9FFC */
|
||||
sjw = intermediate + 0x8140;
|
||||
} else {
|
||||
/* bytes are in the range 0xE040 to 0xEBBF */
|
||||
sjw = intermediate + 0xc140;
|
||||
}
|
||||
|
||||
data->payload[data->payload_len++] = sjw >> 8;
|
||||
data->payload[data->payload_len++] = sjw & 0xff;
|
||||
}
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
static quirc_decode_error_t decode_eci(struct quirc_data *data,
|
||||
struct datastream *ds)
|
||||
{
|
||||
if (bits_remaining(ds) < 8)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
|
||||
data->eci = take_bits(ds, 8);
|
||||
|
||||
if ((data->eci & 0xc0) == 0x80) {
|
||||
if (bits_remaining(ds) < 8)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
|
||||
data->eci = (data->eci << 8) | take_bits(ds, 8);
|
||||
} else if ((data->eci & 0xe0) == 0xc0) {
|
||||
if (bits_remaining(ds) < 16)
|
||||
return QUIRC_ERROR_DATA_UNDERFLOW;
|
||||
|
||||
data->eci = (data->eci << 16) | take_bits(ds, 16);
|
||||
}
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
static quirc_decode_error_t decode_payload(struct quirc_data *data,
|
||||
struct datastream *ds)
|
||||
{
|
||||
while (bits_remaining(ds) >= 4) {
|
||||
quirc_decode_error_t err = QUIRC_SUCCESS;
|
||||
int type = take_bits(ds, 4);
|
||||
|
||||
switch (type) {
|
||||
case QUIRC_DATA_TYPE_NUMERIC:
|
||||
err = decode_numeric(data, ds);
|
||||
break;
|
||||
|
||||
case QUIRC_DATA_TYPE_ALPHA:
|
||||
err = decode_alpha(data, ds);
|
||||
break;
|
||||
|
||||
case QUIRC_DATA_TYPE_BYTE:
|
||||
err = decode_byte(data, ds);
|
||||
break;
|
||||
|
||||
case QUIRC_DATA_TYPE_KANJI:
|
||||
err = decode_kanji(data, ds);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
err = decode_eci(data, ds);
|
||||
break;
|
||||
|
||||
default:
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!(type & (type - 1)) && (type > data->data_type))
|
||||
data->data_type = type;
|
||||
}
|
||||
done:
|
||||
|
||||
/* Add nul terminator to all payloads */
|
||||
if ((unsigned)data->payload_len >= sizeof(data->payload))
|
||||
data->payload_len--;
|
||||
data->payload[data->payload_len] = 0;
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
|
||||
quirc_decode_error_t quirc_decode(const struct quirc_code *code,
|
||||
struct quirc_data *data)
|
||||
{
|
||||
quirc_decode_error_t err;
|
||||
struct datastream ds;
|
||||
|
||||
if ((code->size - 17) % 4)
|
||||
return QUIRC_ERROR_INVALID_GRID_SIZE;
|
||||
|
||||
memset(data, 0, sizeof(*data));
|
||||
memset(&ds, 0, sizeof(ds));
|
||||
|
||||
data->version = (code->size - 17) / 4;
|
||||
|
||||
if (data->version < 1 ||
|
||||
data->version > QUIRC_MAX_VERSION)
|
||||
return QUIRC_ERROR_INVALID_VERSION;
|
||||
|
||||
/* Read format information -- try both locations */
|
||||
err = read_format(code, data, 0);
|
||||
if (err)
|
||||
err = read_format(code, data, 1);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
read_data(code, data, &ds);
|
||||
err = codestream_ecc(data, &ds);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = decode_payload(data, &ds);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return QUIRC_SUCCESS;
|
||||
}
|
||||
Vendored
+138
@@ -0,0 +1,138 @@
|
||||
/* quirc -- QR-code recognition library
|
||||
* Copyright (C) 2010-2012 Daniel Beer <dlbeer@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <quirc_internal.h>
|
||||
|
||||
const char *quirc_version(void)
|
||||
{
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
struct quirc *quirc_new(void)
|
||||
{
|
||||
struct quirc *q = malloc(sizeof(*q));
|
||||
|
||||
if (!q)
|
||||
return NULL;
|
||||
|
||||
memset(q, 0, sizeof(*q));
|
||||
return q;
|
||||
}
|
||||
|
||||
void quirc_destroy(struct quirc *q)
|
||||
{
|
||||
free(q->image);
|
||||
/* q->pixels may alias q->image when their type representation is of the
|
||||
same size, so we need to be careful here to avoid a double free */
|
||||
if (sizeof(*q->image) != sizeof(*q->pixels))
|
||||
free(q->pixels);
|
||||
free(q->row_average);
|
||||
free(q);
|
||||
}
|
||||
|
||||
int quirc_resize(struct quirc *q, int w, int h)
|
||||
{
|
||||
uint8_t *image = NULL;
|
||||
quirc_pixel_t *pixels = NULL;
|
||||
int *row_average = NULL;
|
||||
|
||||
/*
|
||||
* XXX: w and h should be size_t (or at least unsigned) as negatives
|
||||
* values would not make much sense. The downside is that it would break
|
||||
* both the API and ABI. Thus, at the moment, let's just do a sanity
|
||||
* check.
|
||||
*/
|
||||
if (w < 0 || h < 0)
|
||||
goto fail;
|
||||
|
||||
/*
|
||||
* alloc a new buffer for q->image. We avoid realloc(3) because we want
|
||||
* on failure to be leave `q` in a consistant, unmodified state.
|
||||
*/
|
||||
image = calloc(w, h);
|
||||
if (!image)
|
||||
goto fail;
|
||||
|
||||
/* compute the "old" (i.e. currently allocated) and the "new"
|
||||
(i.e. requested) image dimensions */
|
||||
size_t olddim = q->w * q->h;
|
||||
size_t newdim = w * h;
|
||||
size_t min = (olddim < newdim ? olddim : newdim);
|
||||
|
||||
/*
|
||||
* copy the data into the new buffer, avoiding (a) to read beyond the
|
||||
* old buffer when the new size is greater and (b) to write beyond the
|
||||
* new buffer when the new size is smaller, hence the min computation.
|
||||
*/
|
||||
(void)memcpy(image, q->image, min);
|
||||
|
||||
/* alloc a new buffer for q->pixels if needed */
|
||||
if (sizeof(*q->image) != sizeof(*q->pixels)) {
|
||||
pixels = calloc(newdim, sizeof(quirc_pixel_t));
|
||||
if (!pixels)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* alloc a new buffer for q->row_average */
|
||||
row_average = calloc(w, sizeof(int));
|
||||
if (!row_average)
|
||||
goto fail;
|
||||
|
||||
/* alloc succeeded, update `q` with the new size and buffers */
|
||||
q->w = w;
|
||||
q->h = h;
|
||||
free(q->image);
|
||||
q->image = image;
|
||||
if (sizeof(*q->image) != sizeof(*q->pixels)) {
|
||||
free(q->pixels);
|
||||
q->pixels = pixels;
|
||||
}
|
||||
free(q->row_average);
|
||||
q->row_average = row_average;
|
||||
|
||||
return 0;
|
||||
/* NOTREACHED */
|
||||
fail:
|
||||
free(image);
|
||||
free(pixels);
|
||||
free(row_average);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int quirc_count(const struct quirc *q)
|
||||
{
|
||||
return q->num_grids;
|
||||
}
|
||||
|
||||
static const char *const error_table[] = {
|
||||
[QUIRC_SUCCESS] = "Success",
|
||||
[QUIRC_ERROR_INVALID_GRID_SIZE] = "Invalid grid size",
|
||||
[QUIRC_ERROR_INVALID_VERSION] = "Invalid version",
|
||||
[QUIRC_ERROR_FORMAT_ECC] = "Format data ECC failure",
|
||||
[QUIRC_ERROR_DATA_ECC] = "ECC failure",
|
||||
[QUIRC_ERROR_UNKNOWN_DATA_TYPE] = "Unknown data type",
|
||||
[QUIRC_ERROR_DATA_OVERFLOW] = "Data overflow",
|
||||
[QUIRC_ERROR_DATA_UNDERFLOW] = "Data underflow"
|
||||
};
|
||||
|
||||
const char *quirc_strerror(quirc_decode_error_t err)
|
||||
{
|
||||
if ((int)err < 8) { return error_table[err]; }
|
||||
else { return "Unknown error"; }
|
||||
}
|
||||
Vendored
+430
@@ -0,0 +1,430 @@
|
||||
/* quirc -- QR-code recognition library
|
||||
* Copyright (C) 2010-2012 Daniel Beer <dlbeer@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <quirc_internal.h>
|
||||
|
||||
const struct quirc_version_info quirc_version_db[QUIRC_MAX_VERSION + 1] = {
|
||||
{ /* 0 */
|
||||
.data_bytes = 0,
|
||||
.apat = {0},
|
||||
.ecc = {
|
||||
{.bs = 0, .dw = 0, .ns = 0},
|
||||
{.bs = 0, .dw = 0, .ns = 0},
|
||||
{.bs = 0, .dw = 0, .ns = 0},
|
||||
{.bs = 0, .dw = 0, .ns = 0}
|
||||
}
|
||||
},
|
||||
{ /* Version 1 */
|
||||
.data_bytes = 26,
|
||||
.apat = {0},
|
||||
.ecc = {
|
||||
{.bs = 26, .dw = 16, .ns = 1},
|
||||
{.bs = 26, .dw = 19, .ns = 1},
|
||||
{.bs = 26, .dw = 9, .ns = 1},
|
||||
{.bs = 26, .dw = 13, .ns = 1}
|
||||
}
|
||||
},
|
||||
{ /* Version 2 */
|
||||
.data_bytes = 44,
|
||||
.apat = {6, 18, 0},
|
||||
.ecc = {
|
||||
{.bs = 44, .dw = 28, .ns = 1},
|
||||
{.bs = 44, .dw = 34, .ns = 1},
|
||||
{.bs = 44, .dw = 16, .ns = 1},
|
||||
{.bs = 44, .dw = 22, .ns = 1}
|
||||
}
|
||||
},
|
||||
{ /* Version 3 */
|
||||
.data_bytes = 70,
|
||||
.apat = {6, 22, 0},
|
||||
.ecc = {
|
||||
{.bs = 70, .dw = 44, .ns = 1},
|
||||
{.bs = 70, .dw = 55, .ns = 1},
|
||||
{.bs = 35, .dw = 13, .ns = 2},
|
||||
{.bs = 35, .dw = 17, .ns = 2}
|
||||
}
|
||||
},
|
||||
{ /* Version 4 */
|
||||
.data_bytes = 100,
|
||||
.apat = {6, 26, 0},
|
||||
.ecc = {
|
||||
{.bs = 50, .dw = 32, .ns = 2},
|
||||
{.bs = 100, .dw = 80, .ns = 1},
|
||||
{.bs = 25, .dw = 9, .ns = 4},
|
||||
{.bs = 50, .dw = 24, .ns = 2}
|
||||
}
|
||||
},
|
||||
{ /* Version 5 */
|
||||
.data_bytes = 134,
|
||||
.apat = {6, 30, 0},
|
||||
.ecc = {
|
||||
{.bs = 67, .dw = 43, .ns = 2},
|
||||
{.bs = 134, .dw = 108, .ns = 1},
|
||||
{.bs = 33, .dw = 11, .ns = 2},
|
||||
{.bs = 33, .dw = 15, .ns = 2}
|
||||
}
|
||||
},
|
||||
{ /* Version 6 */
|
||||
.data_bytes = 172,
|
||||
.apat = {6, 34, 0},
|
||||
.ecc = {
|
||||
{.bs = 43, .dw = 27, .ns = 4},
|
||||
{.bs = 86, .dw = 68, .ns = 2},
|
||||
{.bs = 43, .dw = 15, .ns = 4},
|
||||
{.bs = 43, .dw = 19, .ns = 4}
|
||||
}
|
||||
},
|
||||
{ /* Version 7 */
|
||||
.data_bytes = 196,
|
||||
.apat = {6, 22, 38, 0},
|
||||
.ecc = {
|
||||
{.bs = 49, .dw = 31, .ns = 4},
|
||||
{.bs = 98, .dw = 78, .ns = 2},
|
||||
{.bs = 39, .dw = 13, .ns = 4},
|
||||
{.bs = 32, .dw = 14, .ns = 2}
|
||||
}
|
||||
},
|
||||
{ /* Version 8 */
|
||||
.data_bytes = 242,
|
||||
.apat = {6, 24, 42, 0},
|
||||
.ecc = {
|
||||
{.bs = 60, .dw = 38, .ns = 2},
|
||||
{.bs = 121, .dw = 97, .ns = 2},
|
||||
{.bs = 40, .dw = 14, .ns = 4},
|
||||
{.bs = 40, .dw = 18, .ns = 4}
|
||||
}
|
||||
},
|
||||
{ /* Version 9 */
|
||||
.data_bytes = 292,
|
||||
.apat = {6, 26, 46, 0},
|
||||
.ecc = {
|
||||
{.bs = 58, .dw = 36, .ns = 3},
|
||||
{.bs = 146, .dw = 116, .ns = 2},
|
||||
{.bs = 36, .dw = 12, .ns = 4},
|
||||
{.bs = 36, .dw = 16, .ns = 4}
|
||||
}
|
||||
},
|
||||
{ /* Version 10 */
|
||||
.data_bytes = 346,
|
||||
.apat = {6, 28, 50, 0},
|
||||
.ecc = {
|
||||
{.bs = 69, .dw = 43, .ns = 4},
|
||||
{.bs = 86, .dw = 68, .ns = 2},
|
||||
{.bs = 43, .dw = 15, .ns = 6},
|
||||
{.bs = 43, .dw = 19, .ns = 6}
|
||||
}
|
||||
},
|
||||
{ /* Version 11 */
|
||||
.data_bytes = 404,
|
||||
.apat = {6, 30, 54, 0},
|
||||
.ecc = {
|
||||
{.bs = 80, .dw = 50, .ns = 1},
|
||||
{.bs = 101, .dw = 81, .ns = 4},
|
||||
{.bs = 36, .dw = 12, .ns = 3},
|
||||
{.bs = 50, .dw = 22, .ns = 4}
|
||||
}
|
||||
},
|
||||
{ /* Version 12 */
|
||||
.data_bytes = 466,
|
||||
.apat = {6, 32, 58, 0},
|
||||
.ecc = {
|
||||
{.bs = 58, .dw = 36, .ns = 6},
|
||||
{.bs = 116, .dw = 92, .ns = 2},
|
||||
{.bs = 42, .dw = 14, .ns = 7},
|
||||
{.bs = 46, .dw = 20, .ns = 4}
|
||||
}
|
||||
},
|
||||
{ /* Version 13 */
|
||||
.data_bytes = 532,
|
||||
.apat = {6, 34, 62, 0},
|
||||
.ecc = {
|
||||
{.bs = 59, .dw = 37, .ns = 8},
|
||||
{.bs = 133, .dw = 107, .ns = 4},
|
||||
{.bs = 33, .dw = 11, .ns = 12},
|
||||
{.bs = 44, .dw = 20, .ns = 8}
|
||||
}
|
||||
},
|
||||
{ /* Version 14 */
|
||||
.data_bytes = 581,
|
||||
.apat = {6, 26, 46, 66, 0},
|
||||
.ecc = {
|
||||
{.bs = 64, .dw = 40, .ns = 4},
|
||||
{.bs = 145, .dw = 115, .ns = 3},
|
||||
{.bs = 36, .dw = 12, .ns = 11},
|
||||
{.bs = 36, .dw = 16, .ns = 11}
|
||||
}
|
||||
},
|
||||
{ /* Version 15 */
|
||||
.data_bytes = 655,
|
||||
.apat = {6, 26, 48, 70, 0},
|
||||
.ecc = {
|
||||
{.bs = 65, .dw = 41, .ns = 5},
|
||||
{.bs = 109, .dw = 87, .ns = 5},
|
||||
{.bs = 36, .dw = 12, .ns = 11},
|
||||
{.bs = 54, .dw = 24, .ns = 5}
|
||||
}
|
||||
},
|
||||
{ /* Version 16 */
|
||||
.data_bytes = 733,
|
||||
.apat = {6, 26, 50, 74, 0},
|
||||
.ecc = {
|
||||
{.bs = 73, .dw = 45, .ns = 7},
|
||||
{.bs = 122, .dw = 98, .ns = 5},
|
||||
{.bs = 45, .dw = 15, .ns = 3},
|
||||
{.bs = 43, .dw = 19, .ns = 15}
|
||||
}
|
||||
},
|
||||
{ /* Version 17 */
|
||||
.data_bytes = 815,
|
||||
.apat = {6, 30, 54, 78, 0},
|
||||
.ecc = {
|
||||
{.bs = 74, .dw = 46, .ns = 10},
|
||||
{.bs = 135, .dw = 107, .ns = 1},
|
||||
{.bs = 42, .dw = 14, .ns = 2},
|
||||
{.bs = 50, .dw = 22, .ns = 1}
|
||||
}
|
||||
},
|
||||
{ /* Version 18 */
|
||||
.data_bytes = 901,
|
||||
.apat = {6, 30, 56, 82, 0},
|
||||
.ecc = {
|
||||
{.bs = 69, .dw = 43, .ns = 9},
|
||||
{.bs = 150, .dw = 120, .ns = 5},
|
||||
{.bs = 42, .dw = 14, .ns = 2},
|
||||
{.bs = 50, .dw = 22, .ns = 17}
|
||||
}
|
||||
},
|
||||
{ /* Version 19 */
|
||||
.data_bytes = 991,
|
||||
.apat = {6, 30, 58, 86, 0},
|
||||
.ecc = {
|
||||
{.bs = 70, .dw = 44, .ns = 3},
|
||||
{.bs = 141, .dw = 113, .ns = 3},
|
||||
{.bs = 39, .dw = 13, .ns = 9},
|
||||
{.bs = 47, .dw = 21, .ns = 17}
|
||||
}
|
||||
},
|
||||
{ /* Version 20 */
|
||||
.data_bytes = 1085,
|
||||
.apat = {6, 34, 62, 90, 0},
|
||||
.ecc = {
|
||||
{.bs = 67, .dw = 41, .ns = 3},
|
||||
{.bs = 135, .dw = 107, .ns = 3},
|
||||
{.bs = 43, .dw = 15, .ns = 15},
|
||||
{.bs = 54, .dw = 24, .ns = 15}
|
||||
}
|
||||
},
|
||||
{ /* Version 21 */
|
||||
.data_bytes = 1156,
|
||||
.apat = {6, 28, 50, 72, 92, 0},
|
||||
.ecc = {
|
||||
{.bs = 68, .dw = 42, .ns = 17},
|
||||
{.bs = 144, .dw = 116, .ns = 4},
|
||||
{.bs = 46, .dw = 16, .ns = 19},
|
||||
{.bs = 50, .dw = 22, .ns = 17}
|
||||
}
|
||||
},
|
||||
{ /* Version 22 */
|
||||
.data_bytes = 1258,
|
||||
.apat = {6, 26, 50, 74, 98, 0},
|
||||
.ecc = {
|
||||
{.bs = 74, .dw = 46, .ns = 17},
|
||||
{.bs = 139, .dw = 111, .ns = 2},
|
||||
{.bs = 37, .dw = 13, .ns = 34},
|
||||
{.bs = 54, .dw = 24, .ns = 7}
|
||||
}
|
||||
},
|
||||
{ /* Version 23 */
|
||||
.data_bytes = 1364,
|
||||
.apat = {6, 30, 54, 78, 102, 0},
|
||||
.ecc = {
|
||||
{.bs = 75, .dw = 47, .ns = 4},
|
||||
{.bs = 151, .dw = 121, .ns = 4},
|
||||
{.bs = 45, .dw = 15, .ns = 16},
|
||||
{.bs = 54, .dw = 24, .ns = 11}
|
||||
}
|
||||
},
|
||||
{ /* Version 24 */
|
||||
.data_bytes = 1474,
|
||||
.apat = {6, 28, 54, 80, 106, 0},
|
||||
.ecc = {
|
||||
{.bs = 73, .dw = 45, .ns = 6},
|
||||
{.bs = 147, .dw = 117, .ns = 6},
|
||||
{.bs = 46, .dw = 16, .ns = 30},
|
||||
{.bs = 54, .dw = 24, .ns = 11}
|
||||
}
|
||||
},
|
||||
{ /* Version 25 */
|
||||
.data_bytes = 1588,
|
||||
.apat = {6, 32, 58, 84, 110, 0},
|
||||
.ecc = {
|
||||
{.bs = 75, .dw = 47, .ns = 8},
|
||||
{.bs = 132, .dw = 106, .ns = 8},
|
||||
{.bs = 45, .dw = 15, .ns = 22},
|
||||
{.bs = 54, .dw = 24, .ns = 7}
|
||||
}
|
||||
},
|
||||
{ /* Version 26 */
|
||||
.data_bytes = 1706,
|
||||
.apat = {6, 30, 58, 86, 114, 0},
|
||||
.ecc = {
|
||||
{.bs = 74, .dw = 46, .ns = 19},
|
||||
{.bs = 142, .dw = 114, .ns = 10},
|
||||
{.bs = 46, .dw = 16, .ns = 33},
|
||||
{.bs = 50, .dw = 22, .ns = 28}
|
||||
}
|
||||
},
|
||||
{ /* Version 27 */
|
||||
.data_bytes = 1828,
|
||||
.apat = {6, 34, 62, 90, 118, 0},
|
||||
.ecc = {
|
||||
{.bs = 73, .dw = 45, .ns = 22},
|
||||
{.bs = 152, .dw = 122, .ns = 8},
|
||||
{.bs = 45, .dw = 15, .ns = 12},
|
||||
{.bs = 53, .dw = 23, .ns = 8}
|
||||
}
|
||||
},
|
||||
{ /* Version 28 */
|
||||
.data_bytes = 1921,
|
||||
.apat = {6, 26, 50, 74, 98, 122, 0},
|
||||
.ecc = {
|
||||
{.bs = 73, .dw = 45, .ns = 3},
|
||||
{.bs = 147, .dw = 117, .ns = 3},
|
||||
{.bs = 45, .dw = 15, .ns = 11},
|
||||
{.bs = 54, .dw = 24, .ns = 4}
|
||||
}
|
||||
},
|
||||
{ /* Version 29 */
|
||||
.data_bytes = 2051,
|
||||
.apat = {6, 30, 54, 78, 102, 126, 0},
|
||||
.ecc = {
|
||||
{.bs = 73, .dw = 45, .ns = 21},
|
||||
{.bs = 146, .dw = 116, .ns = 7},
|
||||
{.bs = 45, .dw = 15, .ns = 19},
|
||||
{.bs = 53, .dw = 23, .ns = 1}
|
||||
}
|
||||
},
|
||||
{ /* Version 30 */
|
||||
.data_bytes = 2185,
|
||||
.apat = {6, 26, 52, 78, 104, 130, 0},
|
||||
.ecc = {
|
||||
{.bs = 75, .dw = 47, .ns = 19},
|
||||
{.bs = 145, .dw = 115, .ns = 5},
|
||||
{.bs = 45, .dw = 15, .ns = 23},
|
||||
{.bs = 54, .dw = 24, .ns = 15}
|
||||
}
|
||||
},
|
||||
{ /* Version 31 */
|
||||
.data_bytes = 2323,
|
||||
.apat = {6, 30, 56, 82, 108, 134, 0},
|
||||
.ecc = {
|
||||
{.bs = 74, .dw = 46, .ns = 2},
|
||||
{.bs = 145, .dw = 115, .ns = 13},
|
||||
{.bs = 45, .dw = 15, .ns = 23},
|
||||
{.bs = 54, .dw = 24, .ns = 42}
|
||||
}
|
||||
},
|
||||
{ /* Version 32 */
|
||||
.data_bytes = 2465,
|
||||
.apat = {6, 34, 60, 86, 112, 138, 0},
|
||||
.ecc = {
|
||||
{.bs = 74, .dw = 46, .ns = 10},
|
||||
{.bs = 145, .dw = 115, .ns = 17},
|
||||
{.bs = 45, .dw = 15, .ns = 19},
|
||||
{.bs = 54, .dw = 24, .ns = 10}
|
||||
}
|
||||
},
|
||||
{ /* Version 33 */
|
||||
.data_bytes = 2611,
|
||||
.apat = {6, 30, 58, 86, 114, 142, 0},
|
||||
.ecc = {
|
||||
{.bs = 74, .dw = 46, .ns = 14},
|
||||
{.bs = 145, .dw = 115, .ns = 17},
|
||||
{.bs = 45, .dw = 15, .ns = 11},
|
||||
{.bs = 54, .dw = 24, .ns = 29}
|
||||
}
|
||||
},
|
||||
{ /* Version 34 */
|
||||
.data_bytes = 2761,
|
||||
.apat = {6, 34, 62, 90, 118, 146, 0},
|
||||
.ecc = {
|
||||
{.bs = 74, .dw = 46, .ns = 14},
|
||||
{.bs = 145, .dw = 115, .ns = 13},
|
||||
{.bs = 46, .dw = 16, .ns = 59},
|
||||
{.bs = 54, .dw = 24, .ns = 44}
|
||||
}
|
||||
},
|
||||
{ /* Version 35 */
|
||||
.data_bytes = 2876,
|
||||
.apat = {6, 30, 54, 78, 102, 126, 150},
|
||||
.ecc = {
|
||||
{.bs = 75, .dw = 47, .ns = 12},
|
||||
{.bs = 151, .dw = 121, .ns = 12},
|
||||
{.bs = 45, .dw = 15, .ns = 22},
|
||||
{.bs = 54, .dw = 24, .ns = 39}
|
||||
}
|
||||
},
|
||||
{ /* Version 36 */
|
||||
.data_bytes = 3034,
|
||||
.apat = {6, 24, 50, 76, 102, 128, 154},
|
||||
.ecc = {
|
||||
{.bs = 75, .dw = 47, .ns = 6},
|
||||
{.bs = 151, .dw = 121, .ns = 6},
|
||||
{.bs = 45, .dw = 15, .ns = 2},
|
||||
{.bs = 54, .dw = 24, .ns = 46}
|
||||
}
|
||||
},
|
||||
{ /* Version 37 */
|
||||
.data_bytes = 3196,
|
||||
.apat = {6, 28, 54, 80, 106, 132, 158},
|
||||
.ecc = {
|
||||
{.bs = 74, .dw = 46, .ns = 29},
|
||||
{.bs = 152, .dw = 122, .ns = 17},
|
||||
{.bs = 45, .dw = 15, .ns = 24},
|
||||
{.bs = 54, .dw = 24, .ns = 49}
|
||||
}
|
||||
},
|
||||
{ /* Version 38 */
|
||||
.data_bytes = 3362,
|
||||
.apat = {6, 32, 58, 84, 110, 136, 162},
|
||||
.ecc = {
|
||||
{.bs = 74, .dw = 46, .ns = 13},
|
||||
{.bs = 152, .dw = 122, .ns = 4},
|
||||
{.bs = 45, .dw = 15, .ns = 42},
|
||||
{.bs = 54, .dw = 24, .ns = 48}
|
||||
}
|
||||
},
|
||||
{ /* Version 39 */
|
||||
.data_bytes = 3532,
|
||||
.apat = {6, 26, 54, 82, 110, 138, 166},
|
||||
.ecc = {
|
||||
{.bs = 75, .dw = 47, .ns = 40},
|
||||
{.bs = 147, .dw = 117, .ns = 20},
|
||||
{.bs = 45, .dw = 15, .ns = 10},
|
||||
{.bs = 54, .dw = 24, .ns = 43}
|
||||
}
|
||||
},
|
||||
{ /* Version 40 */
|
||||
.data_bytes = 3706,
|
||||
.apat = {6, 30, 58, 86, 114, 142, 170},
|
||||
.ecc = {
|
||||
{.bs = 75, .dw = 47, .ns = 18},
|
||||
{.bs = 148, .dw = 118, .ns = 19},
|
||||
{.bs = 45, .dw = 15, .ns = 20},
|
||||
{.bs = 54, .dw = 24, .ns = 34}
|
||||
}
|
||||
}
|
||||
};
|
||||
+249
-98
@@ -96,6 +96,10 @@ if(POLICY CMP0051)
|
||||
cmake_policy(SET CMP0051 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0054) # CMake 3.1: Only interpret if() arguments as variables or keywords when unquoted.
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0056)
|
||||
cmake_policy(SET CMP0056 NEW)
|
||||
endif()
|
||||
@@ -202,87 +206,226 @@ endif()
|
||||
OCV_OPTION(OPENCV_ENABLE_NONFREE "Enable non-free algorithms" OFF)
|
||||
|
||||
# 3rd party libs
|
||||
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE)
|
||||
OCV_OPTION(BUILD_TIFF "Build libtiff from source" WIN32 OR ANDROID OR APPLE)
|
||||
OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 OR ANDROID OR APPLE)
|
||||
OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE)
|
||||
OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE)
|
||||
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" (WIN32 OR ANDROID OR APPLE) AND NOT WINRT)
|
||||
OCV_OPTION(BUILD_WEBP "Build WebP from source" (WIN32 OR ANDROID OR APPLE) AND NOT WINRT)
|
||||
OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID )
|
||||
OCV_OPTION(BUILD_IPP_IW "Build IPP IW from source" NOT MINGW IF (X86_64 OR X86) AND NOT WINRT )
|
||||
OCV_OPTION(BUILD_ITT "Build Intel ITT from source" NOT MINGW IF (X86_64 OR X86) AND NOT WINRT AND NOT APPLE_FRAMEWORK )
|
||||
OCV_OPTION(OPENCV_FORCE_3RDPARTY_BUILD "Force using 3rdparty code from source" OFF)
|
||||
OCV_OPTION(BUILD_ZLIB "Build zlib from source" (WIN32 OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
|
||||
OCV_OPTION(BUILD_TIFF "Build libtiff from source" (WIN32 OR ANDROID OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
|
||||
OCV_OPTION(BUILD_JASPER "Build libjasper from source" (WIN32 OR ANDROID OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
|
||||
OCV_OPTION(BUILD_JPEG "Build libjpeg from source" (WIN32 OR ANDROID OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
|
||||
OCV_OPTION(BUILD_PNG "Build libpng from source" (WIN32 OR ANDROID OR APPLE OR OPENCV_FORCE_3RDPARTY_BUILD) )
|
||||
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" (((WIN32 OR ANDROID OR APPLE) AND NOT WINRT) OR OPENCV_FORCE_3RDPARTY_BUILD) )
|
||||
OCV_OPTION(BUILD_WEBP "Build WebP from source" (((WIN32 OR ANDROID OR APPLE) AND NOT WINRT) OR OPENCV_FORCE_3RDPARTY_BUILD) )
|
||||
OCV_OPTION(BUILD_TBB "Download and build TBB from source" (ANDROID OR OPENCV_FORCE_3RDPARTY_BUILD) )
|
||||
OCV_OPTION(BUILD_IPP_IW "Build IPP IW from source" (NOT MINGW OR OPENCV_FORCE_3RDPARTY_BUILD) IF (X86_64 OR X86) AND NOT WINRT )
|
||||
OCV_OPTION(BUILD_ITT "Build Intel ITT from source" (NOT MINGW OR OPENCV_FORCE_3RDPARTY_BUILD) IF (X86_64 OR X86) AND NOT WINRT AND NOT APPLE_FRAMEWORK )
|
||||
|
||||
# Optional 3rd party components
|
||||
# ===================================================
|
||||
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
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_CAROTENE "Use NVidia carotene acceleration library for ARM platform" ON IF (ARM OR AARCH64) AND NOT IOS AND NOT (CMAKE_VERSION VERSION_LESS "2.8.11"))
|
||||
OCV_OPTION(WITH_CPUFEATURES "Use cpufeatures Android library" ON IF ANDROID)
|
||||
OCV_OPTION(WITH_VTK "Include VTK library support (and build opencv_viz module eiher)" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT AND NOT CMAKE_CROSSCOMPILING) )
|
||||
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" OFF IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" ON IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" ON IF (NOT IOS AND NOT APPLE) )
|
||||
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" (NOT CV_DISABLE_OPTIMIZATION) IF (NOT WINRT AND NOT CMAKE_CROSSCOMPILING) )
|
||||
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 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
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_GTK_2_X "Use GTK version 2" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_IPP "Include Intel IPP support" (NOT MINGW AND NOT CV_DISABLE_OPTIMIZATION) IF (X86_64 OR X86) AND NOT WINRT AND NOT IOS )
|
||||
OCV_OPTION(WITH_HALIDE "Include Halide support" OFF)
|
||||
OCV_OPTION(WITH_INF_ENGINE "Include Intel Inference Engine support" OFF)
|
||||
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_JPEG "Include JPEG support" ON)
|
||||
OCV_OPTION(WITH_WEBP "Include WebP support" ON IF (NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENVX "Include OpenVX support" OFF)
|
||||
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENNI2 "Include OpenNI2 support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_PNG "Include PNG support" ON)
|
||||
OCV_OPTION(WITH_GDCM "Include DICOM support" OFF)
|
||||
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_ARAVIS "Include Aravis GigE support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT AND NOT WIN32) )
|
||||
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF WIN32 AND NOT WINRT)
|
||||
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 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENMP "Include OpenMP support" OFF)
|
||||
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF (WIN32 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_PTHREADS_PF "Use pthreads-based parallel_for" ON IF (NOT WIN32 OR MINGW) )
|
||||
OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID AND NOT APPLE) )
|
||||
OCV_OPTION(WITH_LIBV4L "Use libv4l for Video 4 Linux support" OFF IF (UNIX AND NOT ANDROID AND NOT APPLE) )
|
||||
OCV_OPTION(WITH_DSHOW "Build VideoIO with DirectShow support" ON IF (WIN32 AND NOT ARM AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_MSMF "Build VideoIO with Media Foundation support" ON IF WIN32 )
|
||||
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF)
|
||||
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" (NOT ANDROID AND NOT CV_DISABLE_OPTIMIZATION) IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENCL_SVM "Include OpenCL Shared Virtual Memory support" OFF ) # experimental
|
||||
OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_DIRECTX "Include DirectX support" ON IF (WIN32 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF IF (WIN32 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_MATLAB "Include Matlab support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT))
|
||||
OCV_OPTION(WITH_VA "Include VA support" OFF IF (UNIX AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_VA_INTEL "Include Intel VA-API/OpenCL support" OFF IF (UNIX AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_MFX "Include Intel Media SDK support" OFF IF ((UNIX AND NOT ANDROID) OR (WIN32 AND NOT WINRT AND NOT MINGW)) )
|
||||
OCV_OPTION(WITH_GDAL "Include GDAL Support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_GPHOTO2 "Include gPhoto2 library support" ON IF (UNIX AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_LAPACK "Include Lapack library support" (NOT CV_DISABLE_OPTIMIZATION) IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_ITT "Include Intel ITT support" ON IF (NOT APPLE_FRAMEWORK) )
|
||||
OCV_OPTION(WITH_PROTOBUF "Enable libprotobuf" ON )
|
||||
OCV_OPTION(WITH_IMGCODEC_HDR "Include HDR support" ON)
|
||||
OCV_OPTION(WITH_IMGCODEC_SUNRASTER "Include SUNRASTER support" ON)
|
||||
OCV_OPTION(WITH_IMGCODEC_PXM "Include PNM (PBM,PGM,PPM) and PAM formats support" ON)
|
||||
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_DC1394)
|
||||
OCV_OPTION(WITH_AVFOUNDATION "Use AVFoundation for Video I/O (iOS/Mac)" ON
|
||||
VISIBLE_IF APPLE
|
||||
VERIFY HAVE_AVFOUNDATION)
|
||||
OCV_OPTION(WITH_CARBON "Use Carbon for UI instead of Cocoa (OBSOLETE)" OFF
|
||||
VISIBLE_IF APPLE
|
||||
VERIFY HAVE_CARBON OR HAVE_COCOA)
|
||||
OCV_OPTION(WITH_CAROTENE "Use NVidia carotene acceleration library for ARM platform" ON
|
||||
VISIBLE_IF (ARM OR AARCH64) AND NOT IOS AND NOT (CMAKE_VERSION VERSION_LESS "2.8.11"))
|
||||
OCV_OPTION(WITH_CPUFEATURES "Use cpufeatures Android library" ON
|
||||
VISIBLE_IF ANDROID
|
||||
VERIFY HAVE_CPUFEATURES)
|
||||
OCV_OPTION(WITH_VTK "Include VTK library support (and build opencv_viz module eiher)" ON
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT AND NOT CMAKE_CROSSCOMPILING
|
||||
VERIFY HAVE_VTK)
|
||||
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" OFF
|
||||
VISIBLE_IF NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_CUDA)
|
||||
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" WITH_CUDA
|
||||
VISIBLE_IF WITH_CUDA
|
||||
VERIFY HAVE_CUFFT)
|
||||
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" WITH_CUDA
|
||||
VISIBLE_IF WITH_CUDA
|
||||
VERIFY HAVE_CUBLAS)
|
||||
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" WITH_CUDA
|
||||
VISIBLE_IF WITH_CUDA
|
||||
VERIFY HAVE_NVCUVID)
|
||||
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" (NOT CV_DISABLE_OPTIMIZATION)
|
||||
VISIBLE_IF NOT WINRT AND NOT CMAKE_CROSSCOMPILING
|
||||
VERIFY HAVE_EIGEN)
|
||||
OCV_OPTION(WITH_VFW "Include Video for Windows support (deprecated, consider using MSMF)" OFF
|
||||
VISIBLE_IF WIN32
|
||||
VERIFY HAVE_VFW)
|
||||
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_FFMPEG)
|
||||
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_GSTREAMER AND GSTREAMER_BASE_VERSION VERSION_GREATER "0.99")
|
||||
OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_GSTREAMER AND GSTREAMER_BASE_VERSION VERSION_LESS "1.0")
|
||||
OCV_OPTION(WITH_GTK "Include GTK support" ON
|
||||
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
|
||||
VERIFY HAVE_GTK)
|
||||
OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF
|
||||
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
|
||||
VERIFY HAVE_GTK AND NOT HAVE_GTK3)
|
||||
OCV_OPTION(WITH_IPP "Include Intel IPP support" (NOT MINGW AND NOT CV_DISABLE_OPTIMIZATION)
|
||||
VISIBLE_IF (X86_64 OR X86) AND NOT WINRT AND NOT IOS
|
||||
VERIFY HAVE_IPP)
|
||||
OCV_OPTION(WITH_HALIDE "Include Halide support" OFF
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_HALIDE)
|
||||
OCV_OPTION(WITH_INF_ENGINE "Include Intel Inference Engine support" OFF
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY INF_ENGINE_TARGET)
|
||||
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON
|
||||
VISIBLE_IF NOT IOS
|
||||
VERIFY HAVE_JASPER)
|
||||
OCV_OPTION(WITH_JPEG "Include JPEG support" ON
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_JPEG)
|
||||
OCV_OPTION(WITH_WEBP "Include WebP support" ON
|
||||
VISIBLE_IF NOT WINRT
|
||||
VERIFY HAVE_WEBP)
|
||||
OCV_OPTION(WITH_OPENEXR "Include ILM support via OpenEXR" ON
|
||||
VISIBLE_IF NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_OPENEXR)
|
||||
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT WINRT
|
||||
VERIFY HAVE_OPENGL)
|
||||
OCV_OPTION(WITH_OPENVX "Include OpenVX support" OFF
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_OPENVX)
|
||||
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_OPENNI)
|
||||
OCV_OPTION(WITH_OPENNI2 "Include OpenNI2 support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_OPENNI2)
|
||||
OCV_OPTION(WITH_PNG "Include PNG support" ON
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_PNG)
|
||||
OCV_OPTION(WITH_GDCM "Include DICOM support" OFF
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_GDCM)
|
||||
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_PVAPI)
|
||||
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_GIGE_API)
|
||||
OCV_OPTION(WITH_ARAVIS "Include Aravis GigE support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT AND NOT WIN32
|
||||
VERIFY HAVE_ARAVIS_API)
|
||||
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_QT)
|
||||
OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON
|
||||
VISIBLE_IF WIN32 AND NOT WINRT
|
||||
VERIFY HAVE_WIN32UI)
|
||||
OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O (OBSOLETE)" OFF
|
||||
VISIBLE_IF APPLE
|
||||
VERIFY HAVE_QUICKTIME)
|
||||
OCV_OPTION(WITH_QTKIT "Use QTKit Video I/O backend" OFF
|
||||
VISIBLE_IF APPLE
|
||||
VERIFY HAVE_QTKIT)
|
||||
OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF
|
||||
VISIBLE_IF NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_TBB)
|
||||
OCV_OPTION(WITH_OPENMP "Include OpenMP support" OFF
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_OPENMP)
|
||||
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF
|
||||
VISIBLE_IF WIN32 AND NOT WINRT
|
||||
VERIFY HAVE_CSTRIPES)
|
||||
OCV_OPTION(WITH_PTHREADS_PF "Use pthreads-based parallel_for" ON
|
||||
VISIBLE_IF NOT WIN32 OR MINGW
|
||||
VERIFY HAVE_PTHREADS_PF)
|
||||
OCV_OPTION(WITH_TIFF "Include TIFF support" ON
|
||||
VISIBLE_IF NOT IOS
|
||||
VERIFY HAVE_TIFF)
|
||||
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF
|
||||
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
|
||||
VERIFY HAVE_UNICAP)
|
||||
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON
|
||||
VISIBLE_IF UNIX AND NOT ANDROID AND NOT APPLE
|
||||
VERIFY HAVE_CAMV4L OR HAVE_CAMV4L2 OR HAVE_VIDEOIO)
|
||||
OCV_OPTION(WITH_LIBV4L "Use libv4l for Video 4 Linux support" OFF
|
||||
VISIBLE_IF UNIX AND NOT ANDROID AND NOT APPLE
|
||||
VERIFY HAVE_LIBV4L)
|
||||
OCV_OPTION(WITH_DSHOW "Build VideoIO with DirectShow support" ON
|
||||
VISIBLE_IF WIN32 AND NOT ARM AND NOT WINRT
|
||||
VERIFY HAVE_DSHOW)
|
||||
OCV_OPTION(WITH_MSMF "Build VideoIO with Media Foundation support" NOT MINGW
|
||||
VISIBLE_IF WIN32
|
||||
VERIFY HAVE_MSMF)
|
||||
OCV_OPTION(WITH_MSMF_DXVA "Enable hardware acceleration in Media Foundation backend" WITH_MSMF
|
||||
VISIBLE_IF WIN32
|
||||
VERIFY HAVE_MSMF_DXVA)
|
||||
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT WINRT
|
||||
VERIFY HAVE_XIMEA)
|
||||
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF
|
||||
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
|
||||
VERIFY HAVE_XINE)
|
||||
OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_CLP)
|
||||
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" (NOT ANDROID AND NOT CV_DISABLE_OPTIMIZATION)
|
||||
VISIBLE_IF NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_OPENCL)
|
||||
OCV_OPTION(WITH_OPENCL_SVM "Include OpenCL Shared Virtual Memory support" OFF
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_OPENCL_SVM) # experimental
|
||||
OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_CLAMDFFT)
|
||||
OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_CLAMDBLAS)
|
||||
OCV_OPTION(WITH_DIRECTX "Include DirectX support" ON
|
||||
VISIBLE_IF WIN32 AND NOT WINRT
|
||||
VERIFY HAVE_DIRECTX)
|
||||
OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF
|
||||
VISIBLE_IF WIN32 AND NOT WINRT
|
||||
VERIFY HAVE_INTELPERC)
|
||||
OCV_OPTION(WITH_VA "Include VA support" OFF
|
||||
VISIBLE_IF UNIX AND NOT ANDROID
|
||||
VERIFY HAVE_VA)
|
||||
OCV_OPTION(WITH_VA_INTEL "Include Intel VA-API/OpenCL support" OFF
|
||||
VISIBLE_IF UNIX AND NOT ANDROID
|
||||
VERIFY HAVE_VA_INTEL)
|
||||
OCV_OPTION(WITH_MFX "Include Intel Media SDK support" OFF
|
||||
VISIBLE_IF (UNIX AND NOT ANDROID) OR (WIN32 AND NOT WINRT AND NOT MINGW)
|
||||
VERIFY HAVE_MFX)
|
||||
OCV_OPTION(WITH_GDAL "Include GDAL Support" OFF
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS AND NOT WINRT
|
||||
VERIFY HAVE_GDAL)
|
||||
OCV_OPTION(WITH_GPHOTO2 "Include gPhoto2 library support" OFF
|
||||
VISIBLE_IF UNIX AND NOT ANDROID AND NOT IOS
|
||||
VERIFY HAVE_GPHOTO2)
|
||||
OCV_OPTION(WITH_LAPACK "Include Lapack library support" (NOT CV_DISABLE_OPTIMIZATION)
|
||||
VISIBLE_IF NOT ANDROID AND NOT IOS
|
||||
VERIFY HAVE_LAPACK)
|
||||
OCV_OPTION(WITH_ITT "Include Intel ITT support" ON
|
||||
VISIBLE_IF NOT APPLE_FRAMEWORK
|
||||
VERIFY HAVE_ITT)
|
||||
OCV_OPTION(WITH_PROTOBUF "Enable libprotobuf" ON
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_PROTOBUF)
|
||||
OCV_OPTION(WITH_IMGCODEC_HDR "Include HDR support" ON
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_IMGCODEC_HDR)
|
||||
OCV_OPTION(WITH_IMGCODEC_SUNRASTER "Include SUNRASTER support" ON
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_IMGCODEC_SUNRASTER)
|
||||
OCV_OPTION(WITH_IMGCODEC_PXM "Include PNM (PBM,PGM,PPM) and PAM formats support" ON
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_IMGCODEC_PXM)
|
||||
OCV_OPTION(WITH_QUIRC "Include library QR-code decoding" ON
|
||||
VISIBLE_IF TRUE
|
||||
VERIFY HAVE_QUIRC)
|
||||
|
||||
# OpenCV build components
|
||||
# ===================================================
|
||||
@@ -294,8 +437,8 @@ OCV_OPTION(BUILD_ANDROID_EXAMPLES "Build examples for Android platform"
|
||||
OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" OFF IF (NOT WINRT AND NOT APPLE_FRAMEWORK))
|
||||
OCV_OPTION(BUILD_EXAMPLES "Build all examples" OFF )
|
||||
OCV_OPTION(BUILD_PACKAGE "Enables 'make package_source' command" ON IF NOT WINRT)
|
||||
OCV_OPTION(BUILD_PERF_TESTS "Build performance tests" ON IF (NOT APPLE_FRAMEWORK) )
|
||||
OCV_OPTION(BUILD_TESTS "Build accuracy & regression tests" ON IF (NOT APPLE_FRAMEWORK) )
|
||||
OCV_OPTION(BUILD_PERF_TESTS "Build performance tests" NOT INSTALL_CREATE_DISTRIB IF (NOT APPLE_FRAMEWORK) )
|
||||
OCV_OPTION(BUILD_TESTS "Build accuracy & regression tests" NOT INSTALL_CREATE_DISTRIB IF (NOT APPLE_FRAMEWORK) )
|
||||
OCV_OPTION(BUILD_WITH_DEBUG_INFO "Include debug info into release binaries ('OFF' means default settings)" OFF )
|
||||
OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of statically linked CRT for statically linked OpenCV" ON IF MSVC )
|
||||
OCV_OPTION(BUILD_WITH_DYNAMIC_IPP "Enables dynamic linking of IPP (only for standalone IPP)" OFF )
|
||||
@@ -322,10 +465,11 @@ OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add
|
||||
OCV_OPTION(ENABLE_COVERAGE "Enable coverage collection with GCov" OFF IF CV_GCC )
|
||||
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CV_GCC )
|
||||
OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CV_GCC AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
|
||||
OCV_OPTION(ENABLE_VSX "Enable POWER8 and above VSX (64-bit little-endian)" ON IF ((CV_GCC OR CV_CLANG) AND PPC64LE) )
|
||||
OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CV_GCC AND (X86 OR X86_64)) )
|
||||
if(NOT IOS) # Use CPU_BASELINE instead
|
||||
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" (NEON OR ANDROID_ARM_NEON OR AARCH64) IF (CV_GCC OR CV_CLANG) AND (ARM OR AARCH64 OR IOS) )
|
||||
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF (CV_GCC OR CV_CLANG) AND (ARM OR AARCH64 OR IOS) )
|
||||
endif()
|
||||
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(ANDROID_EXAMPLES_WITH_LIBS "Build binaries of Android examples with native libraries" OFF IF ANDROID )
|
||||
@@ -336,9 +480,12 @@ OCV_OPTION(ENABLE_BUILD_HARDENING "Enable hardening of the resulting binarie
|
||||
OCV_OPTION(ENABLE_LTO "Enable Link Time Optimization" OFF IF CV_GCC OR MSVC)
|
||||
OCV_OPTION(ENABLE_THIN_LTO "Enable Thin LTO" OFF IF CV_CLANG)
|
||||
OCV_OPTION(GENERATE_ABI_DESCRIPTOR "Generate XML file for abi_compliance_checker tool" OFF IF UNIX)
|
||||
OCV_OPTION(OPENCV_GENERATE_PKGCONFIG "Generate .pc file for pkg-config build tool (deprecated)" ON IF (UNIX AND NOT MSVC AND NOT IOS AND NOT ANDROID) )
|
||||
OCV_OPTION(CV_ENABLE_INTRINSICS "Use intrinsic-based optimized code" ON )
|
||||
OCV_OPTION(CV_DISABLE_OPTIMIZATION "Disable explicit optimized code (dispatched code/intrinsics/loop unrolling/etc)" OFF )
|
||||
OCV_OPTION(CV_TRACE "Enable OpenCV code trace" ON)
|
||||
OCV_OPTION(OPENCV_GENERATE_SETUPVARS "Generate setup_vars* scripts" ON IF (NOT ANDROID AND NOT APPLE_FRAMEWORK) )
|
||||
OCV_OPTION(ENABLE_CONFIG_VERIFICATION "Fail build if actual configuration doesn't match requested (WITH_XXX != HAVE_XXX)" OFF)
|
||||
|
||||
OCV_OPTION(ENABLE_PYLINT "Add target with Pylint checks" (BUILD_DOCS OR BUILD_EXAMPLES) IF (NOT CMAKE_CROSSCOMPILING AND NOT APPLE_FRAMEWORK) )
|
||||
OCV_OPTION(ENABLE_FLAKE8 "Add target with Python flake8 checker" (BUILD_DOCS OR BUILD_EXAMPLES) IF (NOT CMAKE_CROSSCOMPILING AND NOT APPLE_FRAMEWORK) )
|
||||
@@ -461,6 +608,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
ocv_update(OPENCV_INCLUDE_INSTALL_PATH "include")
|
||||
#ocv_update(OPENCV_PYTHON_INSTALL_PATH "python") # no default value, see https://github.com/opencv/opencv/issues/13202
|
||||
endif()
|
||||
|
||||
ocv_update(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
@@ -628,6 +776,8 @@ if(ANDROID AND WITH_CPUFEATURES)
|
||||
set(HAVE_CPUFEATURES 1)
|
||||
endif()
|
||||
|
||||
include(cmake/OpenCVFindFrameworks.cmake)
|
||||
|
||||
include(cmake/OpenCVFindLibsGrfmt.cmake)
|
||||
include(cmake/OpenCVFindLibsGUI.cmake)
|
||||
include(cmake/OpenCVFindLibsVideo.cmake)
|
||||
@@ -693,11 +843,6 @@ if(WITH_DIRECTX)
|
||||
include(cmake/OpenCVDetectDirectX.cmake)
|
||||
endif()
|
||||
|
||||
# --- Matlab/Octave ---
|
||||
if(WITH_MATLAB)
|
||||
include(cmake/OpenCVFindMatlab.cmake)
|
||||
endif()
|
||||
|
||||
if(WITH_VTK)
|
||||
include(cmake/OpenCVDetectVTK.cmake)
|
||||
endif()
|
||||
@@ -706,6 +851,10 @@ if(WITH_OPENVX)
|
||||
include(cmake/FindOpenVX.cmake)
|
||||
endif()
|
||||
|
||||
if(WITH_QUIRC)
|
||||
add_subdirectory(3rdparty/quirc)
|
||||
set(HAVE_QUIRC TRUE)
|
||||
endif()
|
||||
# ----------------------------------------------------------------------------
|
||||
# OpenCV HAL
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -851,6 +1000,7 @@ include(cmake/OpenCVGenHeaders.cmake)
|
||||
|
||||
# Generate opencv.pc for pkg-config command
|
||||
if(NOT OPENCV_SKIP_PKGCONFIG_GENERATION
|
||||
AND OPENCV_GENERATE_PKGCONFIG
|
||||
AND NOT CMAKE_GENERATOR MATCHES "Xcode")
|
||||
include(cmake/OpenCVGenPkgconfig.cmake)
|
||||
endif()
|
||||
@@ -920,6 +1070,10 @@ if(COMMAND ocv_pylint_finalize)
|
||||
ocv_pylint_finalize()
|
||||
endif()
|
||||
|
||||
if(OPENCV_GENERATE_SETUPVARS)
|
||||
include(cmake/OpenCVGenSetupVars.cmake)
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Summary:
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -1327,6 +1481,7 @@ endif()
|
||||
|
||||
if(WITH_MSMF OR HAVE_MSMF)
|
||||
status(" Media Foundation:" HAVE_MSMF THEN YES ELSE NO)
|
||||
status(" DXVA:" HAVE_MSMF_DXVA THEN YES ELSE NO)
|
||||
endif()
|
||||
|
||||
if(WITH_XIMEA OR HAVE_XIMEA)
|
||||
@@ -1396,7 +1551,7 @@ if(WITH_VA OR HAVE_VA)
|
||||
endif()
|
||||
|
||||
if(WITH_VA_INTEL OR HAVE_VA_INTEL)
|
||||
status(" Intel VA-API/OpenCL:" HAVE_VA_INTEL THEN "YES (MSDK: ${VA_INTEL_MSDK_ROOT} OpenCL: ${VA_INTEL_IOCL_ROOT})" ELSE NO)
|
||||
status(" Intel VA-API/OpenCL:" HAVE_VA_INTEL THEN "YES (OpenCL: ${VA_INTEL_IOCL_ROOT})" ELSE NO)
|
||||
endif()
|
||||
|
||||
if(WITH_LAPACK OR HAVE_LAPACK)
|
||||
@@ -1479,7 +1634,7 @@ if(BUILD_opencv_python2)
|
||||
status(" Libraries:" HAVE_opencv_python2 THEN "${PYTHON2_LIBRARIES}" ELSE NO)
|
||||
endif()
|
||||
status(" numpy:" PYTHON2_NUMPY_INCLUDE_DIRS THEN "${PYTHON2_NUMPY_INCLUDE_DIRS} (ver ${PYTHON2_NUMPY_VERSION})" ELSE "NO (Python wrappers can not be generated)")
|
||||
status(" packages path:" PYTHON2_EXECUTABLE THEN "${PYTHON2_PACKAGES_PATH}" ELSE "-")
|
||||
status(" install path:" HAVE_opencv_python2 THEN "${__INSTALL_PATH_PYTHON2}" ELSE "-")
|
||||
endif()
|
||||
|
||||
if(BUILD_opencv_python3)
|
||||
@@ -1492,7 +1647,7 @@ if(BUILD_opencv_python3)
|
||||
status(" Libraries:" HAVE_opencv_python3 THEN "${PYTHON3_LIBRARIES}" ELSE NO)
|
||||
endif()
|
||||
status(" numpy:" PYTHON3_NUMPY_INCLUDE_DIRS THEN "${PYTHON3_NUMPY_INCLUDE_DIRS} (ver ${PYTHON3_NUMPY_VERSION})" ELSE "NO (Python3 wrappers can not be generated)")
|
||||
status(" packages path:" PYTHON3_EXECUTABLE THEN "${PYTHON3_PACKAGES_PATH}" ELSE "-")
|
||||
status(" install path:" HAVE_opencv_python3 THEN "${__INSTALL_PATH_PYTHON3}" ELSE "-")
|
||||
endif()
|
||||
|
||||
status("")
|
||||
@@ -1516,15 +1671,7 @@ if(BUILD_JAVA OR BUILD_opencv_java)
|
||||
status(" Java tests:" BUILD_TESTS AND opencv_test_java_BINARY_DIR THEN YES ELSE NO)
|
||||
endif()
|
||||
|
||||
# ========================= matlab =========================
|
||||
if(WITH_MATLAB OR MATLAB_FOUND)
|
||||
status("")
|
||||
status(" Matlab:" MATLAB_FOUND THEN "YES" ELSE "NO")
|
||||
if(MATLAB_FOUND)
|
||||
status(" mex:" MATLAB_MEX_SCRIPT THEN "${MATLAB_MEX_SCRIPT}" ELSE NO)
|
||||
status(" Compiler/generator:" MEX_WORKS THEN "Working" ELSE "Not working (bindings will not be generated)")
|
||||
endif()
|
||||
endif()
|
||||
ocv_cmake_hook(STATUS_DUMP_EXTRA)
|
||||
|
||||
# ========================== auxiliary ==========================
|
||||
status("")
|
||||
@@ -1535,6 +1682,10 @@ status("")
|
||||
|
||||
ocv_finalize_status()
|
||||
|
||||
if(ENABLE_CONFIG_VERIFICATION)
|
||||
ocv_verify_config()
|
||||
endif()
|
||||
|
||||
ocv_cmake_hook(POST_FINALIZE)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
@@ -103,7 +103,7 @@ bool CalibProcessor::detectAndParseChAruco(const cv::Mat &frame)
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
(void)frame;
|
||||
CV_UNUSED(frame);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ void CvCascadeBoostTrainData::setData( const CvFeatureEvaluator* _featureEvaluat
|
||||
featureEvaluator = _featureEvaluator;
|
||||
|
||||
max_c_count = MAX( 2, featureEvaluator->getMaxCatCount() );
|
||||
_resp = featureEvaluator->getCls();
|
||||
_resp = cvMat(featureEvaluator->getCls());
|
||||
responses = &_resp;
|
||||
// TODO: check responses: elements must be 0 or 1
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
//
|
||||
//M*/
|
||||
|
||||
#ifndef OPENCV_ML_HPP
|
||||
#define OPENCV_ML_HPP
|
||||
#ifndef OPENCV_OLD_ML_HPP
|
||||
#define OPENCV_OLD_ML_HPP
|
||||
|
||||
#ifdef __cplusplus
|
||||
# include "opencv2/core.hpp"
|
||||
@@ -2037,6 +2037,6 @@ template<> void DefaultDeleter<CvDTreeSplit>::operator ()(CvDTreeSplit* obj) con
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
#endif // OPENCV_ML_HPP
|
||||
#endif // OPENCV_OLD_ML_HPP
|
||||
|
||||
/* End of file. */
|
||||
|
||||
@@ -2122,12 +2122,12 @@ CvBoost::train( const Mat& _train_data, int _tflag,
|
||||
const Mat& _missing_mask,
|
||||
CvBoostParams _params, bool _update )
|
||||
{
|
||||
train_data_hdr = _train_data;
|
||||
train_data_hdr = cvMat(_train_data);
|
||||
train_data_mat = _train_data;
|
||||
responses_hdr = _responses;
|
||||
responses_hdr = cvMat(_responses);
|
||||
responses_mat = _responses;
|
||||
|
||||
CvMat vidx = _var_idx, sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
|
||||
CvMat vidx = cvMat(_var_idx), sidx = cvMat(_sample_idx), vtype = cvMat(_var_type), mmask = cvMat(_missing_mask);
|
||||
|
||||
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0,
|
||||
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
|
||||
@@ -2138,7 +2138,7 @@ float
|
||||
CvBoost::predict( const Mat& _sample, const Mat& _missing,
|
||||
const Range& slice, bool raw_mode, bool return_sum ) const
|
||||
{
|
||||
CvMat sample = _sample, mmask = _missing;
|
||||
CvMat sample = cvMat(_sample), mmask = cvMat(_missing);
|
||||
/*if( weak_responses )
|
||||
{
|
||||
int weak_count = cvSliceLength( slice, weak );
|
||||
|
||||
@@ -1592,12 +1592,12 @@ bool CvDTree::train( const Mat& _train_data, int _tflag,
|
||||
const Mat& _sample_idx, const Mat& _var_type,
|
||||
const Mat& _missing_mask, CvDTreeParams _params )
|
||||
{
|
||||
train_data_hdr = _train_data;
|
||||
train_data_hdr = cvMat(_train_data);
|
||||
train_data_mat = _train_data;
|
||||
responses_hdr = _responses;
|
||||
responses_hdr = cvMat(_responses);
|
||||
responses_mat = _responses;
|
||||
|
||||
CvMat vidx=_var_idx, sidx=_sample_idx, vtype=_var_type, mmask=_missing_mask;
|
||||
CvMat vidx=cvMat(_var_idx), sidx=cvMat(_sample_idx), vtype=cvMat(_var_type), mmask=cvMat(_missing_mask);
|
||||
|
||||
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0, sidx.data.ptr ? &sidx : 0,
|
||||
vtype.data.ptr ? &vtype : 0, mmask.data.ptr ? &mmask : 0, _params);
|
||||
@@ -3734,7 +3734,7 @@ CvDTreeNode* CvDTree::predict( const CvMat* _sample,
|
||||
|
||||
CvDTreeNode* CvDTree::predict( const Mat& _sample, const Mat& _missing, bool preprocessed_input ) const
|
||||
{
|
||||
CvMat sample = _sample, mmask = _missing;
|
||||
CvMat sample = cvMat(_sample), mmask = cvMat(_missing);
|
||||
return predict(&sample, mmask.data.ptr ? &mmask : 0, preprocessed_input);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
# AVX / AVX2 / AVX_512F
|
||||
# FMA3
|
||||
|
||||
# ppc64le arch:
|
||||
# VSX (always available on Power8)
|
||||
# VSX3 (always available on Power9)
|
||||
|
||||
# CPU_{opt}_SUPPORTED=ON/OFF - compiler support (possibly with additional flag)
|
||||
# CPU_{opt}_IMPLIES=<list>
|
||||
# CPU_{opt}_FORCE=<list> - subset of "implies" list
|
||||
@@ -26,10 +30,12 @@
|
||||
# CPU_DISPATCH_FINAL=<list> - final list of dispatched optimizations
|
||||
#
|
||||
# CPU_DISPATCH_FLAGS_${opt} - flags for source files compiled separately (<name>.avx2.cpp)
|
||||
#
|
||||
# CPU_{opt}_ENABLED_DEFAULT=ON/OFF - has compiler support without additional flag (CPU_BASELINE_DETECT=ON only)
|
||||
|
||||
set(CPU_ALL_OPTIMIZATIONS "SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F;AVX512_SKX")
|
||||
list(APPEND CPU_ALL_OPTIMIZATIONS NEON VFPV3 FP16)
|
||||
list(APPEND CPU_ALL_OPTIMIZATIONS VSX)
|
||||
list(APPEND CPU_ALL_OPTIMIZATIONS VSX VSX3)
|
||||
list(REMOVE_DUPLICATES CPU_ALL_OPTIMIZATIONS)
|
||||
|
||||
ocv_update(CPU_VFPV3_FEATURE_ALIAS "")
|
||||
@@ -50,13 +56,13 @@ endforeach()
|
||||
|
||||
# process legacy flags
|
||||
macro(ocv_optimization_process_obsolete_option legacy_flag OPT legacy_warn)
|
||||
if(DEFINED ${legacy_flag})
|
||||
if(${legacy_warn})
|
||||
if(DEFINED "${legacy_flag}")
|
||||
if("${legacy_warn}")
|
||||
message(STATUS "WARNING: Option ${legacy_flag}='${${legacy_flag}}' is deprecated and should not be used anymore")
|
||||
message(STATUS " Behaviour of this option is not backward compatible")
|
||||
message(STATUS " Refer to 'CPU_BASELINE'/'CPU_DISPATCH' CMake options documentation")
|
||||
endif()
|
||||
if(${legacy_flag})
|
||||
if("${${legacy_flag}}")
|
||||
if(NOT ";${CPU_BASELINE_REQUIRE};" MATCHES ";${OPT};")
|
||||
set(CPU_BASELINE_REQUIRE "${CPU_BASELINE_REQUIRE};${OPT}" CACHE STRING "${HELP_CPU_BASELINE_REQUIRE}" FORCE)
|
||||
endif()
|
||||
@@ -81,7 +87,7 @@ ocv_optimization_process_obsolete_option(ENABLE_FMA3 FMA3 ON)
|
||||
ocv_optimization_process_obsolete_option(ENABLE_VFPV3 VFPV3 OFF)
|
||||
ocv_optimization_process_obsolete_option(ENABLE_NEON NEON OFF)
|
||||
|
||||
ocv_optimization_process_obsolete_option(ENABLE_VSX VSX OFF)
|
||||
ocv_optimization_process_obsolete_option(ENABLE_VSX VSX ON)
|
||||
|
||||
macro(ocv_is_optimization_in_list resultvar check_opt)
|
||||
set(__checked "")
|
||||
@@ -289,14 +295,24 @@ elseif(ARM OR AARCH64)
|
||||
set(CPU_BASELINE "NEON;FP16" CACHE STRING "${HELP_CPU_BASELINE}")
|
||||
endif()
|
||||
elseif(PPC64LE)
|
||||
ocv_update(CPU_KNOWN_OPTIMIZATIONS "VSX")
|
||||
ocv_update(CPU_KNOWN_OPTIMIZATIONS "VSX;VSX3")
|
||||
ocv_update(CPU_VSX_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_vsx.cpp")
|
||||
ocv_update(CPU_VSX3_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_vsx3.cpp")
|
||||
|
||||
if(NOT OPENCV_CPU_OPT_IMPLIES_IGNORE)
|
||||
ocv_update(CPU_VSX3_IMPLIES "VSX")
|
||||
endif()
|
||||
|
||||
if(CV_CLANG AND (NOT ${CMAKE_CXX_COMPILER} MATCHES "xlc"))
|
||||
ocv_update(CPU_VSX_FLAGS_ON "-mvsx -maltivec")
|
||||
ocv_update(CPU_VSX3_FLAGS_ON "-mpower9-vector")
|
||||
else()
|
||||
ocv_update(CPU_VSX_FLAGS_ON "-mcpu=power8")
|
||||
ocv_update(CPU_VSX3_FLAGS_ON "-mcpu=power9 -mtune=power9")
|
||||
endif()
|
||||
|
||||
set(CPU_DISPATCH "VSX3" CACHE STRING "${HELP_CPU_DISPATCH}")
|
||||
set(CPU_BASELINE "VSX" CACHE STRING "${HELP_CPU_BASELINE}")
|
||||
endif()
|
||||
|
||||
# Helper values for cmake-gui
|
||||
@@ -331,6 +347,7 @@ macro(ocv_check_compiler_optimization OPT)
|
||||
ocv_check_compiler_flag(CXX "${CPU_BASELINE_FLAGS}" "${_varname}" "${CPU_${OPT}_TEST_FILE}")
|
||||
if(${_varname})
|
||||
list(APPEND CPU_BASELINE_FINAL ${OPT})
|
||||
set(CPU_${OPT}_ENABLED_DEFAULT ON)
|
||||
set(__available 1)
|
||||
endif()
|
||||
endif()
|
||||
@@ -448,7 +465,9 @@ foreach(OPT ${CPU_KNOWN_OPTIMIZATIONS})
|
||||
if(NOT ";${CPU_BASELINE_FINAL};" MATCHES ";${OPT};")
|
||||
list(APPEND CPU_BASELINE_FINAL ${OPT})
|
||||
endif()
|
||||
ocv_append_optimization_flag(CPU_BASELINE_FLAGS ${OPT})
|
||||
if(NOT CPU_${OPT}_ENABLED_DEFAULT) # Don't change compiler flags in 'detection' mode
|
||||
ocv_append_optimization_flag(CPU_BASELINE_FLAGS ${OPT})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -86,7 +86,11 @@ endif()
|
||||
if(CV_GCC OR CV_CLANG)
|
||||
# High level of warnings.
|
||||
add_extra_compiler_option(-W)
|
||||
add_extra_compiler_option(-Wall)
|
||||
if (NOT MSVC)
|
||||
# clang-cl interprets -Wall as MSVC would: -Weverything, which is more than
|
||||
# we want.
|
||||
add_extra_compiler_option(-Wall)
|
||||
endif()
|
||||
add_extra_compiler_option(-Werror=return-type)
|
||||
add_extra_compiler_option(-Werror=non-virtual-dtor)
|
||||
add_extra_compiler_option(-Werror=address)
|
||||
@@ -125,8 +129,11 @@ if(CV_GCC OR CV_CLANG)
|
||||
)
|
||||
add_extra_compiler_option(-Wimplicit-fallthrough=3)
|
||||
endif()
|
||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.2.0)
|
||||
add_extra_compiler_option(-Wno-strict-overflow) # Issue is fixed in GCC 7.2.1
|
||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
|
||||
add_extra_compiler_option(-Wno-strict-overflow) # Issue appears when compiling surf.cpp from opencv_contrib/modules/xfeatures2d
|
||||
endif()
|
||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||
add_extra_compiler_option(-Wno-missing-field-initializers) # GCC 4.x emits warnings about {}, fixed in GCC 5+
|
||||
endif()
|
||||
endif()
|
||||
add_extra_compiler_option(-fdiagnostics-show-option)
|
||||
@@ -173,7 +180,7 @@ if(CV_GCC OR CV_CLANG)
|
||||
string(REPLACE "-ffunction-sections" "" ${flags} "${${flags}}")
|
||||
string(REPLACE "-fdata-sections" "" ${flags} "${${flags}}")
|
||||
endforeach()
|
||||
elseif(NOT ((IOS OR ANDROID) AND NOT BUILD_SHARED_LIBS))
|
||||
elseif(NOT ((IOS OR ANDROID) AND NOT BUILD_SHARED_LIBS) AND NOT MSVC)
|
||||
# Remove unreferenced functions: function level linking
|
||||
add_extra_compiler_option(-ffunction-sections)
|
||||
add_extra_compiler_option(-fdata-sections)
|
||||
@@ -266,6 +273,7 @@ endif()
|
||||
|
||||
# set default visibility to hidden
|
||||
if((CV_GCC OR CV_CLANG)
|
||||
AND NOT MSVC
|
||||
AND NOT OPENCV_SKIP_VISIBILITY_HIDDEN
|
||||
AND NOT " ${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}" MATCHES " -fvisibility")
|
||||
add_extra_compiler_option(-fvisibility=hidden)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
set(OPENCV_JAVA_SOURCE_VERSION "" CACHE STRING "Java source version (javac Ant target)")
|
||||
set(OPENCV_JAVA_TARGET_VERSION "" CACHE STRING "Java target version (javac Ant target)")
|
||||
|
||||
file(TO_CMAKE_PATH "$ENV{ANT_DIR}" ANT_DIR_ENV_PATH)
|
||||
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ if(CUDA_FOUND)
|
||||
|
||||
message(STATUS "CUDA detected: " ${CUDA_VERSION})
|
||||
|
||||
set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta")
|
||||
set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing")
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
list(APPEND _generations "Auto")
|
||||
endif()
|
||||
@@ -81,6 +81,8 @@ if(CUDA_FOUND)
|
||||
set(__cuda_arch_bin "6.0 6.1")
|
||||
elseif(CUDA_GENERATION STREQUAL "Volta")
|
||||
set(__cuda_arch_bin "7.0")
|
||||
elseif(CUDA_GENERATION STREQUAL "Turing")
|
||||
set(__cuda_arch_bin "7.5")
|
||||
elseif(CUDA_GENERATION STREQUAL "Auto")
|
||||
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" ${CUDA_NVCC_FLAGS} "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
|
||||
@@ -105,17 +107,19 @@ if(CUDA_FOUND)
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT _nvcc_res EQUAL 0)
|
||||
message(STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures.")
|
||||
set(__cuda_arch_bin "5.3 6.2 7.0")
|
||||
set(__cuda_arch_bin "5.3 6.2 7.2")
|
||||
else()
|
||||
set(__cuda_arch_bin "${_nvcc_out}")
|
||||
string(REPLACE "2.1" "2.1(2.0)" __cuda_arch_bin "${__cuda_arch_bin}")
|
||||
endif()
|
||||
set(__cuda_arch_ptx "")
|
||||
else()
|
||||
if(${CUDA_VERSION} VERSION_LESS "9.0")
|
||||
if(CUDA_VERSION VERSION_LESS "9.0")
|
||||
set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 5.2 6.0 6.1")
|
||||
else()
|
||||
elseif(CUDA_VERSION VERSION_LESS "10.0")
|
||||
set(__cuda_arch_bin "3.0 3.5 3.7 5.0 5.2 6.0 6.1 7.0")
|
||||
else()
|
||||
set(__cuda_arch_bin "3.0 3.5 3.7 5.0 5.2 6.0 6.1 7.0 7.5")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -78,9 +78,9 @@ endif()
|
||||
|
||||
if(INF_ENGINE_TARGET)
|
||||
if(NOT INF_ENGINE_RELEASE)
|
||||
message(WARNING "InferenceEngine version have not been set, 2018R3 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
|
||||
message(WARNING "InferenceEngine version have not been set, 2018R5 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
|
||||
endif()
|
||||
set(INF_ENGINE_RELEASE "2018030000" CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2018R2.0.2 -> 2018020002)")
|
||||
set(INF_ENGINE_RELEASE "2018050000" CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2018R2.0.2 -> 2018020002)")
|
||||
set_target_properties(${INF_ENGINE_TARGET} PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "HAVE_INF_ENGINE=1;INF_ENGINE_RELEASE=${INF_ENGINE_RELEASE}"
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ if(NOT ${found})
|
||||
set(PYTHON_EXECUTABLE "${${executable}}")
|
||||
endif()
|
||||
|
||||
if(WIN32 AND NOT ${executable})
|
||||
if(WIN32 AND NOT ${executable} AND OPENCV_PYTHON_PREFER_WIN32_REGISTRY) # deprecated
|
||||
# search for executable with the same bitness as resulting binaries
|
||||
# standard FindPythonInterp always prefers executable from system path
|
||||
# this is really important because we are using the interpreter for numpy search and for choosing the install location
|
||||
@@ -53,16 +53,53 @@ if(NOT ${found})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "^[0-9]+" _preferred_version_major "${preferred_version}")
|
||||
|
||||
find_host_package(PythonInterp "${preferred_version}")
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
if(preferred_version)
|
||||
set(__python_package_version "${preferred_version} EXACT")
|
||||
find_host_package(PythonInterp "${preferred_version}" EXACT)
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
message(STATUS "Python is not found: ${preferred_version} EXACT")
|
||||
endif()
|
||||
elseif(min_version)
|
||||
set(__python_package_version "${min_version}")
|
||||
find_host_package(PythonInterp "${min_version}")
|
||||
else()
|
||||
set(__python_package_version "")
|
||||
find_host_package(PythonInterp)
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "^[0-9]+" _python_version_major "${min_version}")
|
||||
|
||||
if(PYTHONINTERP_FOUND)
|
||||
# Check if python major version is correct
|
||||
if("${_preferred_version_major}" STREQUAL "" OR "${_preferred_version_major}" STREQUAL "${PYTHON_VERSION_MAJOR}")
|
||||
if(" ${_python_version_major}" STREQUAL " ")
|
||||
set(_python_version_major "${PYTHON_VERSION_MAJOR}")
|
||||
endif()
|
||||
if(NOT "${_python_version_major}" STREQUAL "${PYTHON_VERSION_MAJOR}"
|
||||
AND NOT DEFINED ${executable}
|
||||
)
|
||||
if(NOT OPENCV_SKIP_PYTHON_WARNING)
|
||||
message(WARNING "CMake's 'find_host_package(PythonInterp ${__python_package_version})' founds wrong Python version:\n"
|
||||
"PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}\n"
|
||||
"PYTHON_VERSION_STRING=${PYTHON_VERSION_STRING}\n"
|
||||
"Consider specify '${executable}' variable via CMake command line or environment variables\n")
|
||||
endif()
|
||||
ocv_clear_vars(PYTHONINTERP_FOUND PYTHON_EXECUTABLE PYTHON_VERSION_STRING PYTHON_VERSION_MAJOR PYTHON_VERSION_MINOR PYTHON_VERSION_PATCH)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS "3.12")
|
||||
if(_python_version_major STREQUAL "2")
|
||||
set(__PYTHON_PREFIX Python2)
|
||||
else()
|
||||
set(__PYTHON_PREFIX Python3)
|
||||
endif()
|
||||
find_host_package(${__PYTHON_PREFIX} "${preferred_version}" COMPONENTS Interpreter)
|
||||
if(${__PYTHON_PREFIX}_EXECUTABLE)
|
||||
set(PYTHON_EXECUTABLE "${${__PYTHON_PREFIX}_EXECUTABLE}")
|
||||
find_host_package(PythonInterp "${preferred_version}") # Populate other variables
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Consider using CMake 3.12+ for better Python support")
|
||||
endif()
|
||||
endif()
|
||||
if(PYTHONINTERP_FOUND AND "${_python_version_major}" STREQUAL "${PYTHON_VERSION_MAJOR}")
|
||||
# Copy outputs
|
||||
set(_found ${PYTHONINTERP_FOUND})
|
||||
set(_executable ${PYTHON_EXECUTABLE})
|
||||
@@ -235,7 +272,7 @@ if(OPENCV_PYTHON_SKIP_DETECTION)
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_python(2.7 "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR
|
||||
find_python("" "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR
|
||||
PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING
|
||||
PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND
|
||||
PYTHON2LIBS_VERSION_STRING PYTHON2_LIBRARIES PYTHON2_LIBRARY
|
||||
@@ -243,7 +280,8 @@ find_python(2.7 "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR
|
||||
PYTHON2_INCLUDE_DIR PYTHON2_INCLUDE_DIR2 PYTHON2_PACKAGES_PATH
|
||||
PYTHON2_NUMPY_INCLUDE_DIRS PYTHON2_NUMPY_VERSION)
|
||||
|
||||
find_python(3.4 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
|
||||
option(OPENCV_PYTHON3_VERSION "Python3 version" "")
|
||||
find_python("${OPENCV_PYTHON3_VERSION}" "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
|
||||
PYTHON3INTERP_FOUND PYTHON3_EXECUTABLE PYTHON3_VERSION_STRING
|
||||
PYTHON3_VERSION_MAJOR PYTHON3_VERSION_MINOR PYTHON3LIBS_FOUND
|
||||
PYTHON3LIBS_VERSION_STRING PYTHON3_LIBRARIES PYTHON3_LIBRARY
|
||||
@@ -254,10 +292,12 @@ find_python(3.4 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
|
||||
|
||||
if(PYTHON_DEFAULT_EXECUTABLE)
|
||||
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
|
||||
elseif(PYTHON2INTERP_FOUND) # Use Python 2 as default Python interpreter
|
||||
elseif(PYTHON2_EXECUTABLE AND PYTHON2INTERP_FOUND)
|
||||
# Use Python 2 as default Python interpreter
|
||||
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
|
||||
set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}")
|
||||
elseif(PYTHON3INTERP_FOUND) # Use Python 3 as fallback Python interpreter (if there is no Python 2)
|
||||
elseif(PYTHON3_EXECUTABLE AND PYTHON3INTERP_FOUND)
|
||||
# Use Python 3 as fallback Python interpreter (if there is no Python 2)
|
||||
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
|
||||
set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON3_EXECUTABLE}")
|
||||
endif()
|
||||
|
||||
@@ -20,27 +20,27 @@ if(NOT VTK_FOUND)
|
||||
endif()
|
||||
|
||||
# Don't support earlier VTKs
|
||||
if(${VTK_VERSION} VERSION_LESS "5.8.0")
|
||||
if(VTK_VERSION VERSION_LESS "5.8.0")
|
||||
message(STATUS "VTK support is disabled. VTK ver. 5.8.0 is minimum required, but found VTK ver. ${VTK_VERSION}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Different Qt versions can't be linked together
|
||||
if(HAVE_QT5 AND ${VTK_VERSION} VERSION_LESS "6.0.0")
|
||||
if(HAVE_QT5 AND VTK_VERSION VERSION_LESS "6.0.0")
|
||||
if(VTK_USE_QT)
|
||||
message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Different Qt versions can't be linked together. VTK 6.0.0 doesn't provide a way to get Qt version it was linked with
|
||||
if(HAVE_QT5 AND ${VTK_VERSION} VERSION_EQUAL "6.0.0" AND NOT DEFINED FORCE_VTK)
|
||||
if(HAVE_QT5 AND VTK_VERSION VERSION_EQUAL "6.0.0" AND NOT DEFINED FORCE_VTK)
|
||||
message(STATUS "VTK support is disabled. Possible incompatible combination: OpenCV+Qt5, and VTK ver.${VTK_VERSION} with Qt4")
|
||||
message(STATUS "If it is known that VTK was compiled without Qt4, please define '-DFORCE_VTK=TRUE' flag in CMake")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Different Qt versions can't be linked together
|
||||
if(HAVE_QT AND ${VTK_VERSION} VERSION_GREATER "6.0.0" AND NOT ${VTK_QT_VERSION} STREQUAL "")
|
||||
if(HAVE_QT AND VTK_VERSION VERSION_GREATER "6.0.0" AND NOT ${VTK_QT_VERSION} STREQUAL "")
|
||||
if(HAVE_QT5 AND ${VTK_QT_VERSION} EQUAL "4")
|
||||
message(STATUS "VTK support is disabled. Incompatible combination: OpenCV + Qt5 and VTK ver.${VTK_VERSION} + Qt4")
|
||||
return()
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
# Detect frameworks that may be used by 3rd-party libraries as well as OpenCV
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# --- C= ---
|
||||
if(WITH_CSTRIPES AND NOT HAVE_TBB)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCStripes.cmake")
|
||||
else()
|
||||
set(HAVE_CSTRIPES 0)
|
||||
endif()
|
||||
|
||||
# --- GCD ---
|
||||
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
set(HAVE_GCD 1)
|
||||
else()
|
||||
set(HAVE_GCD 0)
|
||||
endif()
|
||||
|
||||
# --- Concurrency ---
|
||||
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
|
||||
file(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
|
||||
try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
|
||||
file(REMOVE "${_fname}")
|
||||
else()
|
||||
set(HAVE_CONCURRENCY 0)
|
||||
endif()
|
||||
|
||||
# --- OpenMP ---
|
||||
if(WITH_OPENMP)
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
endif()
|
||||
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
||||
endif()
|
||||
|
||||
ocv_clear_vars(HAVE_PTHREADS_PF)
|
||||
if(WITH_PTHREADS_PF AND HAVE_PTHREAD)
|
||||
set(HAVE_PTHREADS_PF 1)
|
||||
else()
|
||||
set(HAVE_PTHREADS_PF 0)
|
||||
endif()
|
||||
@@ -105,7 +105,7 @@ macro(ipp_detect_version)
|
||||
message(STATUS "found Intel IPP${__msg}: ${_MAJOR}.${_MINOR}.${_BUILD} [${IPP_VERSION_STR}]")
|
||||
message(STATUS "at: ${IPP_ROOT_DIR}")
|
||||
|
||||
if(${IPP_VERSION_STR} VERSION_LESS "7.0")
|
||||
if(IPP_VERSION_STR VERSION_LESS "7.0")
|
||||
_ipp_not_supported("Intel IPP ${IPP_VERSION_STR} is not supported")
|
||||
endif()
|
||||
|
||||
@@ -166,7 +166,7 @@ macro(ipp_detect_version)
|
||||
endmacro()
|
||||
|
||||
set(IPP_PREFIX "ipp")
|
||||
if(${IPP_VERSION_STR} VERSION_LESS "8.0")
|
||||
if(IPP_VERSION_STR VERSION_LESS "8.0")
|
||||
if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV)
|
||||
set(IPP_SUFFIX "") # dynamic not threaded libs suffix Intel IPP 7.x
|
||||
else ()
|
||||
@@ -240,11 +240,12 @@ endif()
|
||||
|
||||
if(NOT DEFINED IPPROOT)
|
||||
include("${OpenCV_SOURCE_DIR}/3rdparty/ippicv/ippicv.cmake")
|
||||
download_ippicv(IPPROOT)
|
||||
if(NOT IPPROOT)
|
||||
download_ippicv(ICV_PACKAGE_ROOT)
|
||||
if(NOT ICV_PACKAGE_ROOT)
|
||||
return()
|
||||
endif()
|
||||
ocv_install_3rdparty_licenses(ippicv "${IPPROOT}/readme.htm" "${IPPROOT}/license/ippEULA.txt")
|
||||
set(IPPROOT "${ICV_PACKAGE_ROOT}/icv")
|
||||
ocv_install_3rdparty_licenses(ippicv "${IPPROOT}/readme.htm" "${ICV_PACKAGE_ROOT}/EULA.txt")
|
||||
endif()
|
||||
|
||||
file(TO_CMAKE_PATH "${IPPROOT}" __IPPROOT)
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
# Main variables:
|
||||
# IPP_A_LIBRARIES and IPP_A_INCLUDE to use IPP Async
|
||||
# HAVE_IPP_A for conditional compilation OpenCV with/without IPP Async
|
||||
|
||||
# IPP_ASYNC_ROOT - root of IPP Async installation
|
||||
|
||||
if(X86_64)
|
||||
find_path(
|
||||
IPP_A_INCLUDE_DIR
|
||||
NAMES ipp_async_defs.h
|
||||
PATHS $ENV{IPP_ASYNC_ROOT}
|
||||
PATH_SUFFIXES include
|
||||
DOC "Path to Intel IPP Async interface headers")
|
||||
|
||||
find_file(
|
||||
IPP_A_LIBRARIES
|
||||
NAMES ipp_async_preview.lib
|
||||
PATHS $ENV{IPP_ASYNC_ROOT}
|
||||
PATH_SUFFIXES lib/intel64
|
||||
DOC "Path to Intel IPP Async interface libraries")
|
||||
|
||||
else()
|
||||
find_path(
|
||||
IPP_A_INCLUDE_DIR
|
||||
NAMES ipp_async_defs.h
|
||||
PATHS $ENV{IPP_ASYNC_ROOT}
|
||||
PATH_SUFFIXES include
|
||||
DOC "Path to Intel IPP Async interface headers")
|
||||
|
||||
find_file(
|
||||
IPP_A_LIBRARIES
|
||||
NAMES ipp_async_preview.lib
|
||||
PATHS $ENV{IPP_ASYNC_ROOT}
|
||||
PATH_SUFFIXES lib/ia32
|
||||
DOC "Path to Intel IPP Async interface libraries")
|
||||
endif()
|
||||
|
||||
if(IPP_A_INCLUDE_DIR AND IPP_A_LIBRARIES)
|
||||
set(HAVE_IPP_A TRUE)
|
||||
else()
|
||||
set(HAVE_IPP_A FALSE)
|
||||
message(WARNING "Intel IPP Async library directory (set by IPP_A_LIBRARIES_DIR variable) is not found or does not have Intel IPP Async libraries.")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(FORCE IPP_A_LIBRARIES IPP_A_INCLUDE_DIR)
|
||||
+61
-54
@@ -1,17 +1,19 @@
|
||||
#
|
||||
# The script to detect Intel(R) Integrated Performance Primitives Integration Wrappers (IPP IW)
|
||||
# The script to detect Intel(R) Integrated Performance Primitives Integration Wrappers (IPP Integration Wrappers)
|
||||
# installation/package
|
||||
#
|
||||
#
|
||||
# On return this will define:
|
||||
#
|
||||
# HAVE_IPP_IW - True if Intel IPP found
|
||||
# IPP_IW_PATH - Root of Intel IPP IW directory
|
||||
# IPP_IW_LIBRARIES - Intel IPP IW libraries
|
||||
# IPP_IW_INCLUDES - Intel IPP IW include folder
|
||||
# HAVE_IPP_IW - True if Intel IPP Integration Wrappers found
|
||||
# HAVE_IPP_IW_LL - True if Intel IPP Integration Wrappers found with Low Level API header
|
||||
# IPP_IW_PATH - Root of Intel IPP Integration Wrappers directory
|
||||
# IPP_IW_LIBRARIES - Intel IPP Integration Wrappers libraries
|
||||
# IPP_IW_INCLUDES - Intel IPP Integration Wrappers include folder
|
||||
#
|
||||
|
||||
unset(HAVE_IPP_IW CACHE)
|
||||
unset(HAVE_IPP_IW_LL CACHE)
|
||||
unset(IPP_IW_PATH)
|
||||
unset(IPP_IW_LIBRARIES)
|
||||
unset(IPP_IW_INCLUDES)
|
||||
@@ -29,13 +31,16 @@ macro(ippiw_debugmsg MESSAGE)
|
||||
endmacro()
|
||||
file(TO_CMAKE_PATH "${IPPROOT}" IPPROOT)
|
||||
|
||||
# This function detects Intel IPP IW version by analyzing .h file
|
||||
# This function detects Intel IPP Integration Wrappers version by analyzing .h file
|
||||
macro(ippiw_setup PATH BUILD)
|
||||
set(FILE "${PATH}/include/iw/iw_ll.h") # check if Intel IPP IW is OpenCV specific
|
||||
ippiw_debugmsg("Checking path: ${PATH}")
|
||||
set(FILE "${PATH}/include/iw/iw_version.h")
|
||||
if(${BUILD})
|
||||
ippiw_debugmsg("Checking sources: ${PATH}")
|
||||
else()
|
||||
ippiw_debugmsg("Checking binaries: ${PATH}")
|
||||
endif()
|
||||
if(EXISTS "${FILE}")
|
||||
set(FILE "${PATH}/include/iw/iw_version.h")
|
||||
ippiw_debugmsg("vfile\tok")
|
||||
ippiw_debugmsg("vfile\tfound")
|
||||
file(STRINGS "${FILE}" IW_VERSION_MAJOR REGEX "IW_VERSION_MAJOR")
|
||||
file(STRINGS "${FILE}" IW_VERSION_MINOR REGEX "IW_VERSION_MINOR")
|
||||
file(STRINGS "${FILE}" IW_VERSION_UPDATE REGEX "IW_VERSION_UPDATE")
|
||||
@@ -56,13 +61,13 @@ macro(ippiw_setup PATH BUILD)
|
||||
math(EXPR IW_MIN_COMPATIBLE_IPP_EXP "${IW_MIN_COMPATIBLE_IPP_MAJOR}*10000 + ${IW_MIN_COMPATIBLE_IPP_MINOR}*100 + ${IW_MIN_COMPATIBLE_IPP_UPDATE}")
|
||||
|
||||
if((IPP_VERSION_EXP GREATER IW_MIN_COMPATIBLE_IPP_EXP) OR (IPP_VERSION_EXP EQUAL IW_MIN_COMPATIBLE_IPP_EXP))
|
||||
ippiw_debugmsg("version\tok")
|
||||
ippiw_debugmsg("vcheck\tpassed")
|
||||
if(${BUILD})
|
||||
# check sources
|
||||
if(EXISTS "${PATH}/src/iw_core.c")
|
||||
ippiw_debugmsg("sources\tok")
|
||||
ippiw_debugmsg("sources\tyes")
|
||||
set(IPP_IW_PATH "${PATH}")
|
||||
message(STATUS "found Intel IPP IW sources: ${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE}")
|
||||
message(STATUS "found Intel IPP Integration Wrappers sources: ${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE}")
|
||||
message(STATUS "at: ${IPP_IW_PATH}")
|
||||
|
||||
set(IPP_IW_LIBRARY ippiw)
|
||||
@@ -72,7 +77,13 @@ macro(ippiw_setup PATH BUILD)
|
||||
add_subdirectory("${IPP_IW_PATH}/" ${OpenCV_BINARY_DIR}/3rdparty/ippiw)
|
||||
|
||||
set(HAVE_IPP_IW 1)
|
||||
set(FILE "${PATH}/include/iw/iw_ll.h") # check if Intel IPP Integration Wrappers is OpenCV specific
|
||||
if(EXISTS "${FILE}")
|
||||
set(HAVE_IPP_IW_LL 1)
|
||||
endif()
|
||||
return()
|
||||
else()
|
||||
ippiw_debugmsg("sources\tno")
|
||||
endif()
|
||||
else()
|
||||
# check binaries
|
||||
@@ -82,9 +93,9 @@ macro(ippiw_setup PATH BUILD)
|
||||
set(FILE "${PATH}/lib/ia32/${CMAKE_STATIC_LIBRARY_PREFIX}ipp_iw${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
if(EXISTS ${FILE})
|
||||
ippiw_debugmsg("binaries\tok (64=${IPP_X64})")
|
||||
ippiw_debugmsg("binaries\tyes (64=${IPP_X64})")
|
||||
set(IPP_IW_PATH "${PATH}")
|
||||
message(STATUS "found Intel IPP IW binaries: ${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE}")
|
||||
message(STATUS "found Intel IPP Integration Wrappers binaries: ${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE}")
|
||||
message(STATUS "at: ${IPP_IW_PATH}")
|
||||
|
||||
add_library(ippiw STATIC IMPORTED)
|
||||
@@ -105,81 +116,77 @@ macro(ippiw_setup PATH BUILD)
|
||||
|
||||
set(HAVE_IPP_IW 1)
|
||||
set(BUILD_IPP_IW 0)
|
||||
set(FILE "${PATH}/include/iw/iw_ll.h") # check if Intel IPP Integration Wrappers is OpenCV specific
|
||||
if(EXISTS "${FILE}")
|
||||
set(HAVE_IPP_IW_LL 1)
|
||||
endif()
|
||||
return()
|
||||
else()
|
||||
ippiw_debugmsg("binaries\tno")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
ippiw_debugmsg("vcheck\tfailed")
|
||||
endif()
|
||||
else()
|
||||
ippiw_debugmsg("vfile\tnot found")
|
||||
endif()
|
||||
set(HAVE_IPP_IW 0)
|
||||
set(HAVE_IPP_IW_LL 0)
|
||||
endmacro()
|
||||
|
||||
# check os and architecture
|
||||
if(APPLE)
|
||||
set(IW_PACKAGE_SUBDIR "ippiw_mac")
|
||||
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
|
||||
set(IW_PACKAGE_SUBDIR "ippiw_lnx")
|
||||
elseif(WIN32 AND NOT ARM)
|
||||
set(IW_PACKAGE_SUBDIR "ippiw_win")
|
||||
else()
|
||||
message(SEND_ERROR "Improper system for Intel IPP Integrations Wrappers. This message shouldn't appear. Check Intel IPP configurations steps")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# check build options first
|
||||
if(BUILD_IPP_IW)
|
||||
# custom path
|
||||
if(DEFINED IPPIWROOT)
|
||||
ippiw_setup("${IPPIWROOT}/" 1)
|
||||
message(STATUS "Can't find Intel IPP IW sources at: ${IPPIWROOT}")
|
||||
message(STATUS "Can't find Intel IPP Integration Wrappers sources at: ${IPPIWROOT}")
|
||||
endif()
|
||||
|
||||
# local sources
|
||||
ippiw_setup("${OpenCV_SOURCE_DIR}/3rdparty/ippiw" 1)
|
||||
|
||||
set(IPPIW_ROOT "${IPPROOT}/../${IW_PACKAGE_SUBDIR}")
|
||||
set(IPPIW_ROOT "${IPPROOT}/../iw")
|
||||
ocv_install_3rdparty_licenses(ippiw
|
||||
"${IPPIW_ROOT}/EULA.txt"
|
||||
"${IPPIW_ROOT}/redist.txt"
|
||||
"${IPPIW_ROOT}/support.txt"
|
||||
"${IPPIW_ROOT}/third-party-programs.txt")
|
||||
"${IPPIW_ROOT}/../EULA.txt"
|
||||
"${IPPIW_ROOT}/../support.txt"
|
||||
"${IPPIW_ROOT}/../third-party-programs.txt")
|
||||
|
||||
# Package sources
|
||||
get_filename_component(__PATH "${IPPROOT}/../${IW_PACKAGE_SUBDIR}/" ABSOLUTE)
|
||||
get_filename_component(__PATH "${IPPROOT}/../iw/" ABSOLUTE)
|
||||
ippiw_setup("${__PATH}" 1)
|
||||
|
||||
# take Intel IPP Integration Wrappers from ICV package
|
||||
if(NOT HAVE_IPP_ICV)
|
||||
message(STATUS "Cannot find Intel IPP Integration Wrappers. Checking \"Intel IPP for OpenCV\" package")
|
||||
set(TEMP_ROOT 0)
|
||||
include("${OpenCV_SOURCE_DIR}/3rdparty/ippicv/ippicv.cmake")
|
||||
download_ippicv(TEMP_ROOT)
|
||||
set(IPPIW_ROOT "${TEMP_ROOT}/iw/")
|
||||
ocv_install_3rdparty_licenses(ippiw
|
||||
"${IPPIW_ROOT}/../EULA.txt"
|
||||
"${IPPIW_ROOT}/../support.txt"
|
||||
"${IPPIW_ROOT}/../third-party-programs.txt")
|
||||
|
||||
ippiw_setup("${IPPIW_ROOT}" 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# custom binaries
|
||||
if(DEFINED IPPIWROOT)
|
||||
ippiw_setup("${IPPIWROOT}/" 0)
|
||||
message(STATUS "Can't find Intel IPP IW sources at: ${IPPIWROOT}")
|
||||
message(STATUS "Can't find Intel IPP Integration Wrappers binaries at: ${IPPIWROOT}")
|
||||
endif()
|
||||
|
||||
# check binaries in IPP folder
|
||||
ippiw_setup("${IPPROOT}/" 0)
|
||||
|
||||
# check binaries near IPP folder
|
||||
ippiw_setup("${IPPROOT}/../${IW_PACKAGE_SUBDIR}/" 0)
|
||||
|
||||
|
||||
# take Intel IPP IW from ICV package
|
||||
if(NOT HAVE_IPP_ICV AND BUILD_IPP_IW)
|
||||
message(STATUS "Cannot find Intel IPP IW. Checking \"Intel IPP for OpenCV\" package")
|
||||
set(TEMP_ROOT 0)
|
||||
include("${OpenCV_SOURCE_DIR}/3rdparty/ippicv/ippicv.cmake")
|
||||
download_ippicv(TEMP_ROOT)
|
||||
set(IPPIW_ROOT "${TEMP_ROOT}/../${IW_PACKAGE_SUBDIR}")
|
||||
ocv_install_3rdparty_licenses(ippiw
|
||||
"${IPPIW_ROOT}/EULA.txt"
|
||||
"${IPPIW_ROOT}/redist.txt"
|
||||
"${IPPIW_ROOT}/support.txt"
|
||||
"${IPPIW_ROOT}/third-party-programs.txt")
|
||||
|
||||
# Package sources. Only sources are compatible with regular Intel IPP
|
||||
ippiw_setup("${IPPIW_ROOT}" 1)
|
||||
endif()
|
||||
ippiw_setup("${IPPROOT}/../iw/" 0)
|
||||
|
||||
|
||||
set(HAVE_IPP_IW 0)
|
||||
set(HAVE_IPP_IW_LL 0)
|
||||
message(STATUS "Cannot find Intel IPP Integration Wrappers, optimizations will be limited. Use IPPIWROOT to set custom location")
|
||||
return()
|
||||
|
||||
@@ -28,17 +28,6 @@ if(WITH_IPP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# --- IPP Async ---
|
||||
|
||||
if(WITH_IPP_A)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPPAsync.cmake")
|
||||
if(IPP_A_INCLUDE_DIR AND IPP_A_LIBRARIES)
|
||||
ocv_include_directories(${IPP_A_INCLUDE_DIR})
|
||||
link_directories(${IPP_A_LIBRARIES})
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${IPP_A_LIBRARIES})
|
||||
endif()
|
||||
endif(WITH_IPP_A)
|
||||
|
||||
# --- CUDA ---
|
||||
if(WITH_CUDA)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCUDA.cmake")
|
||||
@@ -103,44 +92,3 @@ if(WITH_CLP)
|
||||
endif()
|
||||
endif()
|
||||
endif(WITH_CLP)
|
||||
|
||||
# --- C= ---
|
||||
if(WITH_CSTRIPES AND NOT HAVE_TBB)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCStripes.cmake")
|
||||
else()
|
||||
set(HAVE_CSTRIPES 0)
|
||||
endif()
|
||||
|
||||
# --- GCD ---
|
||||
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
set(HAVE_GCD 1)
|
||||
else()
|
||||
set(HAVE_GCD 0)
|
||||
endif()
|
||||
|
||||
# --- Concurrency ---
|
||||
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
|
||||
file(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
|
||||
try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
|
||||
file(REMOVE "${_fname}")
|
||||
else()
|
||||
set(HAVE_CONCURRENCY 0)
|
||||
endif()
|
||||
|
||||
# --- OpenMP ---
|
||||
if(WITH_OPENMP)
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
endif()
|
||||
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
||||
endif()
|
||||
|
||||
ocv_clear_vars(HAVE_PTHREADS_PF)
|
||||
if(WITH_PTHREADS_PF AND HAVE_PTHREAD)
|
||||
set(HAVE_PTHREADS_PF 1)
|
||||
else()
|
||||
set(HAVE_PTHREADS_PF 0)
|
||||
endif()
|
||||
|
||||
@@ -274,14 +274,15 @@ endif(WITH_DSHOW)
|
||||
ocv_clear_vars(HAVE_MSMF)
|
||||
if(WITH_MSMF)
|
||||
check_include_file(Mfapi.h HAVE_MSMF)
|
||||
check_include_file(D3D11.h D3D11_found)
|
||||
check_include_file(D3d11_4.h D3D11_4_found)
|
||||
if(D3D11_found AND D3D11_4_found)
|
||||
set(HAVE_DXVA YES)
|
||||
else()
|
||||
set(HAVE_DXVA NO)
|
||||
set(HAVE_MSMF_DXVA "")
|
||||
if(WITH_MSMF_DXVA)
|
||||
check_include_file(D3D11.h D3D11_found)
|
||||
check_include_file(D3d11_4.h D3D11_4_found)
|
||||
if(D3D11_found AND D3D11_4_found)
|
||||
set(HAVE_MSMF_DXVA YES)
|
||||
endif()
|
||||
endif()
|
||||
endif(WITH_MSMF)
|
||||
endif()
|
||||
|
||||
# --- Extra HighGUI and VideoIO libs on Windows ---
|
||||
if(WIN32)
|
||||
|
||||
@@ -94,7 +94,7 @@ else()
|
||||
set(MKL_ARCH_SUFFIX "c")
|
||||
endif()
|
||||
|
||||
if(${MKL_VERSION_STR} VERSION_GREATER "11.3.0" OR ${MKL_VERSION_STR} VERSION_EQUAL "11.3.0")
|
||||
if(MKL_VERSION_STR VERSION_GREATER "11.3.0" OR MKL_VERSION_STR VERSION_EQUAL "11.3.0")
|
||||
set(mkl_lib_find_paths
|
||||
${MKL_ROOT_DIR}/lib
|
||||
${MKL_ROOT_DIR}/lib/${MKL_ARCH} ${MKL_ROOT_DIR}/../tbb/lib/${MKL_ARCH})
|
||||
|
||||
@@ -1,199 +0,0 @@
|
||||
# ----- Find Matlab/Octave -----
|
||||
#
|
||||
# OpenCVFindMatlab.cmake attempts to locate the install path of Matlab in order
|
||||
# to extract the mex headers, libraries and shell scripts. If found
|
||||
# successfully, the following variables will be defined
|
||||
#
|
||||
# MATLAB_FOUND: true/false
|
||||
# MATLAB_ROOT_DIR: Root of Matlab installation
|
||||
# MATLAB_BIN: The main Matlab "executable" (shell script)
|
||||
# MATLAB_MEX_SCRIPT: The mex script used to compile mex files
|
||||
# MATLAB_INCLUDE_DIRS:Path to "mex.h"
|
||||
# MATLAB_LIBRARY_DIRS:Path to mex and matrix libraries
|
||||
# MATLAB_LIBRARIES: The Matlab libs, usually mx, mex, mat
|
||||
# MATLAB_MEXEXT: The mex library extension. It will be one of:
|
||||
# mexwin32, mexwin64, mexglx, mexa64, mexmac,
|
||||
# mexmaci, mexmaci64, mexsol, mexs64
|
||||
# MATLAB_ARCH: The installation architecture. It is **usually**
|
||||
# the MEXEXT with the preceding "mex" removed,
|
||||
# though it's different for linux distros.
|
||||
#
|
||||
# There doesn't appear to be an elegant way to detect all versions of Matlab
|
||||
# across different platforms. If you know the matlab path and want to avoid
|
||||
# the search, you can define the path to the Matlab root when invoking cmake:
|
||||
#
|
||||
# cmake -DMATLAB_ROOT_DIR='/PATH/TO/ROOT_DIR' ..
|
||||
|
||||
|
||||
|
||||
# ----- set_library_presuffix -----
|
||||
#
|
||||
# Matlab tends to use some non-standard prefixes and suffixes on its libraries.
|
||||
# For example, libmx.dll on Windows (Windows does not add prefixes) and
|
||||
# mkl.dylib on OS X (OS X uses "lib" prefixes).
|
||||
# On some versions of Windows the .dll suffix also appears to not be checked.
|
||||
#
|
||||
# This function modifies the library prefixes and suffixes used by
|
||||
# find_library when finding Matlab libraries. It does not affect scopes
|
||||
# outside of this file.
|
||||
function(set_libarch_prefix_suffix)
|
||||
if (UNIX AND NOT APPLE)
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" PARENT_SCOPE)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a" PARENT_SCOPE)
|
||||
elseif (APPLE)
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" PARENT_SCOPE)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".a" PARENT_SCOPE)
|
||||
elseif (WIN32)
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" PARENT_SCOPE)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
|
||||
# ----- locate_matlab_root -----
|
||||
#
|
||||
# Attempt to find the path to the Matlab installation. If successful, sets
|
||||
# the absolute path in the variable MATLAB_ROOT_DIR
|
||||
function(locate_matlab_root)
|
||||
|
||||
# --- UNIX/APPLE ---
|
||||
if (UNIX)
|
||||
# possible root locations, in order of likelihood
|
||||
set(SEARCH_DIRS_ /Applications /usr/local /opt/local /usr /opt)
|
||||
foreach (DIR_ ${SEARCH_DIRS_})
|
||||
file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R* ${DIR_}/MATLAB_R*)
|
||||
if (MATLAB_ROOT_DIR_)
|
||||
# sort in order from highest to lowest
|
||||
# normally it's in the format MATLAB_R[20XX][A/B]
|
||||
# TODO: numerical rather than lexicographic sort. However,
|
||||
# CMake does not support floating-point MATH(EXPR ...) at this time.
|
||||
list(SORT MATLAB_ROOT_DIR_)
|
||||
list(REVERSE MATLAB_ROOT_DIR_)
|
||||
list(GET MATLAB_ROOT_DIR_ 0 MATLAB_ROOT_DIR_)
|
||||
set(MATLAB_ROOT_DIR ${MATLAB_ROOT_DIR_} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# --- WINDOWS ---
|
||||
elseif (WIN32)
|
||||
# 1. search the path environment variable
|
||||
find_program(MATLAB_ROOT_DIR_ matlab PATHS ENV PATH)
|
||||
if (MATLAB_ROOT_DIR_)
|
||||
# get the root directory from the full path
|
||||
# /path/to/matlab/rootdir/bin/matlab.exe
|
||||
get_filename_component(MATLAB_ROOT_DIR_ ${MATLAB_ROOT_DIR_} PATH)
|
||||
get_filename_component(MATLAB_ROOT_DIR_ ${MATLAB_ROOT_DIR_} PATH)
|
||||
set(MATLAB_ROOT_DIR ${MATLAB_ROOT_DIR_} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# 2. search the registry
|
||||
# determine the available Matlab versions
|
||||
set(REG_EXTENSION_ "SOFTWARE\\Mathworks\\MATLAB")
|
||||
set(REG_ROOTS_ "HKEY_LOCAL_MACHINE" "HKEY_CURRENT_USER")
|
||||
foreach(REG_ROOT_ ${REG_ROOTS_})
|
||||
execute_process(COMMAND reg query "${REG_ROOT_}\\${REG_EXTENSION_}" OUTPUT_VARIABLE QUERY_RESPONSE_ ERROR_VARIABLE UNUSED_)
|
||||
if (QUERY_RESPONSE_)
|
||||
string(REGEX MATCHALL "[0-9]\\.[0-9]" VERSION_STRINGS_ ${QUERY_RESPONSE_})
|
||||
list(APPEND VERSIONS_ ${VERSION_STRINGS_})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# select the highest version
|
||||
list(APPEND VERSIONS_ "0.0")
|
||||
list(SORT VERSIONS_)
|
||||
list(REVERSE VERSIONS_)
|
||||
list(GET VERSIONS_ 0 VERSION_)
|
||||
|
||||
# request the MATLABROOT from the registry
|
||||
foreach(REG_ROOT_ ${REG_ROOTS_})
|
||||
get_filename_component(QUERY_RESPONSE_ [${REG_ROOT_}\\${REG_EXTENSION_}\\${VERSION_};MATLABROOT] ABSOLUTE)
|
||||
if (NOT ${QUERY_RESPONSE_} MATCHES "registry$")
|
||||
set(MATLAB_ROOT_DIR ${QUERY_RESPONSE_} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
|
||||
# ----- locate_matlab_components -----
|
||||
#
|
||||
# Given a directory MATLAB_ROOT_DIR, attempt to find the Matlab components
|
||||
# (include directory and libraries) under the root. If everything is found,
|
||||
# sets the variable MATLAB_FOUND to TRUE
|
||||
function(locate_matlab_components MATLAB_ROOT_DIR)
|
||||
# get the mex extension
|
||||
find_file(MATLAB_MEXEXT_SCRIPT_ NAMES mexext mexext.bat PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)
|
||||
execute_process(COMMAND ${MATLAB_MEXEXT_SCRIPT_}
|
||||
OUTPUT_VARIABLE MATLAB_MEXEXT_
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (NOT MATLAB_MEXEXT_)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# map the mexext to an architecture extension
|
||||
set(ARCHITECTURES_ "maci64" "maci" "glnxa64" "glnx64" "sol64" "sola64" "win32" "win64" )
|
||||
foreach(ARCHITECTURE_ ${ARCHITECTURES_})
|
||||
if(EXISTS ${MATLAB_ROOT_DIR}/bin/${ARCHITECTURE_})
|
||||
set(MATLAB_ARCH_ ${ARCHITECTURE_})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# get the path to the libraries
|
||||
set(MATLAB_LIBRARY_DIRS_ ${MATLAB_ROOT_DIR}/bin/${MATLAB_ARCH_})
|
||||
|
||||
# get the libraries
|
||||
set_libarch_prefix_suffix()
|
||||
find_library(MATLAB_LIB_MX_ mx PATHS ${MATLAB_LIBRARY_DIRS_} NO_DEFAULT_PATH)
|
||||
find_library(MATLAB_LIB_MEX_ mex PATHS ${MATLAB_LIBRARY_DIRS_} NO_DEFAULT_PATH)
|
||||
find_library(MATLAB_LIB_MAT_ mat PATHS ${MATLAB_LIBRARY_DIRS_} NO_DEFAULT_PATH)
|
||||
set(MATLAB_LIBRARIES_ ${MATLAB_LIB_MX_} ${MATLAB_LIB_MEX_} ${MATLAB_LIB_MAT_})
|
||||
|
||||
# get the include path
|
||||
find_path(MATLAB_INCLUDE_DIRS_ mex.h ${MATLAB_ROOT_DIR}/extern/include)
|
||||
|
||||
# get the mex shell script
|
||||
find_program(MATLAB_MEX_SCRIPT_ NAMES mex mex.bat PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)
|
||||
|
||||
# get the Matlab executable
|
||||
find_program(MATLAB_BIN_ NAMES matlab PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)
|
||||
|
||||
# export into parent scope
|
||||
if (MATLAB_MEX_SCRIPT_ AND MATLAB_LIBRARIES_ AND MATLAB_INCLUDE_DIRS_)
|
||||
set(MATLAB_BIN ${MATLAB_BIN_} PARENT_SCOPE)
|
||||
set(MATLAB_MEX_SCRIPT ${MATLAB_MEX_SCRIPT_} PARENT_SCOPE)
|
||||
set(MATLAB_INCLUDE_DIRS ${MATLAB_INCLUDE_DIRS_} PARENT_SCOPE)
|
||||
set(MATLAB_LIBRARIES ${MATLAB_LIBRARIES_} PARENT_SCOPE)
|
||||
set(MATLAB_LIBRARY_DIRS ${MATLAB_LIBRARY_DIRS_} PARENT_SCOPE)
|
||||
set(MATLAB_MEXEXT ${MATLAB_MEXEXT_} PARENT_SCOPE)
|
||||
set(MATLAB_ARCH ${MATLAB_ARCH_} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# FIND MATLAB COMPONENTS
|
||||
# ----------------------------------------------------------------------------
|
||||
if (NOT MATLAB_FOUND)
|
||||
|
||||
# attempt to find the Matlab root folder
|
||||
if (NOT MATLAB_ROOT_DIR)
|
||||
locate_matlab_root()
|
||||
endif()
|
||||
|
||||
# given the matlab root folder, find the library locations
|
||||
if (MATLAB_ROOT_DIR)
|
||||
locate_matlab_components(${MATLAB_ROOT_DIR})
|
||||
endif()
|
||||
find_package_handle_standard_args(Matlab DEFAULT_MSG
|
||||
MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS
|
||||
MATLAB_ROOT_DIR MATLAB_LIBRARIES
|
||||
MATLAB_LIBRARY_DIRS MATLAB_MEXEXT
|
||||
MATLAB_ARCH MATLAB_BIN)
|
||||
endif()
|
||||
@@ -44,13 +44,16 @@ else()
|
||||
|
||||
if(Protobuf_FOUND)
|
||||
if(TARGET protobuf::libprotobuf)
|
||||
add_library(libprotobuf INTERFACE)
|
||||
target_link_libraries(libprotobuf INTERFACE protobuf::libprotobuf)
|
||||
add_library(libprotobuf INTERFACE IMPORTED)
|
||||
set_target_properties(libprotobuf PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES protobuf::libprotobuf
|
||||
)
|
||||
else()
|
||||
add_library(libprotobuf UNKNOWN IMPORTED)
|
||||
set_target_properties(libprotobuf PROPERTIES
|
||||
IMPORTED_LOCATION "${Protobuf_LIBRARY}"
|
||||
INTERFACE_INCLUDE_SYSTEM_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
|
||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
|
||||
)
|
||||
get_protobuf_version(Protobuf_VERSION "${Protobuf_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
@@ -12,7 +12,9 @@ endif()
|
||||
|
||||
if(VA_INCLUDE_DIR)
|
||||
set(HAVE_VA TRUE)
|
||||
set(VA_LIBRARIES "-lva" "-lva-drm")
|
||||
if(NOT DEFINED VA_LIBRARIES)
|
||||
set(VA_LIBRARIES "va" "va-drm")
|
||||
endif()
|
||||
else()
|
||||
set(HAVE_VA FALSE)
|
||||
message(WARNING "libva installation is not found.")
|
||||
|
||||
@@ -1,30 +1,16 @@
|
||||
# Main variables:
|
||||
# VA_INTEL_MSDK_INCLUDE_DIR and VA_INTEL_IOCL_INCLUDE_DIR to use VA_INTEL
|
||||
# VA_INTEL_IOCL_INCLUDE_DIR to use VA_INTEL
|
||||
# HAVE_VA_INTEL for conditional compilation OpenCV with/without VA_INTEL
|
||||
|
||||
# VA_INTEL_MSDK_ROOT - root of Intel MSDK installation
|
||||
# VA_INTEL_IOCL_ROOT - root of Intel OCL installation
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
if($ENV{VA_INTEL_MSDK_ROOT})
|
||||
set(VA_INTEL_MSDK_ROOT $ENV{VA_INTEL_MSDK_ROOT})
|
||||
else()
|
||||
set(VA_INTEL_MSDK_ROOT "/opt/intel/mediasdk")
|
||||
endif()
|
||||
|
||||
if($ENV{VA_INTEL_IOCL_ROOT})
|
||||
set(VA_INTEL_IOCL_ROOT $ENV{VA_INTEL_IOCL_ROOT})
|
||||
else()
|
||||
set(VA_INTEL_IOCL_ROOT "/opt/intel/opencl")
|
||||
endif()
|
||||
|
||||
find_path(
|
||||
VA_INTEL_MSDK_INCLUDE_DIR
|
||||
NAMES mfxdefs.h
|
||||
PATHS ${VA_INTEL_MSDK_ROOT}
|
||||
PATH_SUFFIXES include
|
||||
DOC "Path to Intel MSDK headers")
|
||||
|
||||
find_path(
|
||||
VA_INTEL_IOCL_INCLUDE_DIR
|
||||
NAMES CL/va_ext.h
|
||||
@@ -33,12 +19,14 @@ if(UNIX AND NOT ANDROID)
|
||||
DOC "Path to Intel OpenCL headers")
|
||||
endif()
|
||||
|
||||
if(VA_INTEL_MSDK_INCLUDE_DIR AND VA_INTEL_IOCL_INCLUDE_DIR)
|
||||
if(VA_INTEL_IOCL_INCLUDE_DIR)
|
||||
set(HAVE_VA_INTEL TRUE)
|
||||
set(VA_INTEL_LIBRARIES "-lva" "-lva-drm")
|
||||
if(NOT DEFINED VA_INTEL_LIBRARIES)
|
||||
set(VA_INTEL_LIBRARIES "va" "va-drm")
|
||||
endif()
|
||||
else()
|
||||
set(HAVE_VA_INTEL FALSE)
|
||||
message(WARNING "Intel MSDK & OpenCL installation is not found.")
|
||||
message(WARNING "Intel OpenCL installation is not found.")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(FORCE VA_INTEL_MSDK_INCLUDE_DIR VA_INTEL_IOCL_INCLUDE_DIR)
|
||||
mark_as_advanced(FORCE VA_INTEL_IOCL_INCLUDE_DIR)
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
if(WIN32)
|
||||
ocv_update(OPENCV_SETUPVARS_INSTALL_PATH ".")
|
||||
ocv_update(OPENCV_SCRIPT_EXTENSION ".cmd")
|
||||
ocv_update(OPENCV_SETUPVARS_TEMPLATE "setup_vars_win32.cmd.in")
|
||||
else()
|
||||
ocv_update(OPENCV_SETUPVARS_INSTALL_PATH "bin")
|
||||
ocv_update(OPENCV_SCRIPT_EXTENSION ".sh")
|
||||
if(APPLE)
|
||||
ocv_update(OPENCV_SETUPVARS_TEMPLATE "setup_vars_macosx.sh.in")
|
||||
else()
|
||||
ocv_update(OPENCV_SETUPVARS_TEMPLATE "setup_vars_linux.sh.in")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
ocv_update(OPENCV_SETUPVARS_FILENAME "setup_vars_opencv-${OPENCV_VERSION}${OPENCV_SCRIPT_EXTENSION}")
|
||||
else()
|
||||
ocv_update(OPENCV_SETUPVARS_FILENAME setup_vars_opencv3${OPENCV_SCRIPT_EXTENSION})
|
||||
endif()
|
||||
|
||||
##### build directory
|
||||
if(WIN32)
|
||||
set(__build_type "${CMAKE_BUILD_TYPE}")
|
||||
if(NOT __build_type)
|
||||
set(__build_type "Release") # default
|
||||
endif()
|
||||
file(RELATIVE_PATH OPENCV_LIB_RUNTIME_DIR_RELATIVE_CMAKECONFIG "${OpenCV_BINARY_DIR}/" "${EXECUTABLE_OUTPUT_PATH}/${__build_type}/")
|
||||
else()
|
||||
file(RELATIVE_PATH OPENCV_LIB_RUNTIME_DIR_RELATIVE_CMAKECONFIG "${OpenCV_BINARY_DIR}/" "${LIBRARY_OUTPUT_PATH}/")
|
||||
endif()
|
||||
set(OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG "python_loader") # https://github.com/opencv/opencv/pull/12977
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/${OPENCV_SETUPVARS_TEMPLATE}" "${CMAKE_BINARY_DIR}/tmp/setup_vars${OPENCV_SCRIPT_EXTENSION}" @ONLY)
|
||||
file(COPY "${CMAKE_BINARY_DIR}/tmp/setup_vars${OPENCV_SCRIPT_EXTENSION}" DESTINATION "${CMAKE_BINARY_DIR}"
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
|
||||
##### install directory
|
||||
if(WIN32)
|
||||
file(RELATIVE_PATH OPENCV_LIB_RUNTIME_DIR_RELATIVE_CMAKECONFIG
|
||||
"${CMAKE_INSTALL_PREFIX}/${OPENCV_SETUPVARS_INSTALL_PATH}/" "${CMAKE_INSTALL_PREFIX}/${OPENCV_BIN_INSTALL_PATH}/")
|
||||
else()
|
||||
file(RELATIVE_PATH OPENCV_LIB_RUNTIME_DIR_RELATIVE_CMAKECONFIG
|
||||
"${CMAKE_INSTALL_PREFIX}/${OPENCV_SETUPVARS_INSTALL_PATH}/" "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}/")
|
||||
endif()
|
||||
file(RELATIVE_PATH OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG
|
||||
"${CMAKE_INSTALL_PREFIX}/${OPENCV_SETUPVARS_INSTALL_PATH}/" "${CMAKE_INSTALL_PREFIX}/")
|
||||
if(DEFINED OPENCV_PYTHON_INSTALL_PATH)
|
||||
set(__python_path "${OPENCV_PYTHON_INSTALL_PATH}")
|
||||
elseif(DEFINED OPENCV_PYTHON_INSTALL_PATH_SETUPVARS)
|
||||
set(__python_path "${OPENCV_PYTHON_INSTALL_PATH_SETUPVARS}")
|
||||
endif()
|
||||
if(DEFINED __python_path)
|
||||
if(IS_ABSOLUTE "${__python_path}")
|
||||
set(OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG "${__python_path}")
|
||||
message(WARNING "CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install directory")
|
||||
else()
|
||||
ocv_path_join(OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG "${OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG}" "${__python_path}")
|
||||
endif()
|
||||
else()
|
||||
if(DEFINED OPENCV_PYTHON3_INSTALL_PATH)
|
||||
ocv_path_join(OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG "${OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG}" "${OPENCV_PYTHON3_INSTALL_PATH}")
|
||||
else()
|
||||
set(OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG "python_loader_is_not_installed")
|
||||
endif()
|
||||
endif()
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/${OPENCV_SETUPVARS_TEMPLATE}" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/install/${OPENCV_SETUPVARS_FILENAME}" @ONLY)
|
||||
install(FILES "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/install/${OPENCV_SETUPVARS_FILENAME}"
|
||||
DESTINATION "${OPENCV_SETUPVARS_INSTALL_PATH}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
COMPONENT scripts)
|
||||
@@ -1,6 +1,6 @@
|
||||
set(MIN_VER_CMAKE 2.8.12.2)
|
||||
set(MIN_VER_CUDA 6.5)
|
||||
set(MIN_VER_PYTHON2 2.6)
|
||||
set(MIN_VER_PYTHON2 2.7)
|
||||
set(MIN_VER_PYTHON3 3.2)
|
||||
set(MIN_VER_ZLIB 1.2.3)
|
||||
set(MIN_VER_GTK 2.18.0)
|
||||
|
||||
+35
-21
@@ -296,28 +296,29 @@ endfunction()
|
||||
# Calls 'add_subdirectory' for each location.
|
||||
# Note: both input lists should have same length.
|
||||
# Usage: _add_modules_1(<list with paths> <list with names>)
|
||||
function(_add_modules_1 paths names)
|
||||
list(LENGTH ${paths} len)
|
||||
if(len EQUAL 0)
|
||||
return()
|
||||
macro(_add_modules_1 paths names)
|
||||
ocv_debug_message("_add_modules_1(paths=${paths}, names=${names}, ... " ${ARGN} ")")
|
||||
list(LENGTH ${paths} __len)
|
||||
if(NOT __len EQUAL 0)
|
||||
list(LENGTH ${names} __len_verify)
|
||||
if(NOT __len EQUAL __len_verify)
|
||||
message(FATAL_ERROR "Bad configuration! ${__len} != ${__len_verify}")
|
||||
endif()
|
||||
math(EXPR __len "${__len} - 1")
|
||||
foreach(i RANGE ${__len})
|
||||
list(GET ${paths} ${i} __path)
|
||||
list(GET ${names} ${i} __name)
|
||||
#message(STATUS "First pass: ${__name} => ${__path}")
|
||||
include("${__path}/cmake/init.cmake" OPTIONAL)
|
||||
add_subdirectory("${__path}" "${CMAKE_CURRENT_BINARY_DIR}/.firstpass/${__name}")
|
||||
endforeach()
|
||||
endif()
|
||||
list(LENGTH ${names} len_verify)
|
||||
if(NOT len EQUAL len_verify)
|
||||
message(FATAL_ERROR "Bad configuration! ${len} != ${len_verify}")
|
||||
endif()
|
||||
math(EXPR len "${len} - 1")
|
||||
foreach(i RANGE ${len})
|
||||
list(GET ${paths} ${i} path)
|
||||
list(GET ${names} ${i} name)
|
||||
#message(STATUS "First pass: ${name} => ${path}")
|
||||
include("${path}/cmake/init.cmake" OPTIONAL)
|
||||
add_subdirectory("${path}" "${CMAKE_CURRENT_BINARY_DIR}/.firstpass/${name}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
endmacro()
|
||||
|
||||
# Calls 'add_subdirectory' for each module name.
|
||||
# Usage: _add_modules_2([<module> ...])
|
||||
function(_add_modules_2)
|
||||
macro(_add_modules_2)
|
||||
ocv_debug_message("_add_modules_2(" ${ARGN} ")")
|
||||
foreach(m ${ARGN})
|
||||
set(the_module "${m}")
|
||||
ocv_cmake_hook(PRE_MODULES_CREATE_${the_module})
|
||||
@@ -333,7 +334,8 @@ function(_add_modules_2)
|
||||
endif()
|
||||
ocv_cmake_hook(POST_MODULES_CREATE_${the_module})
|
||||
endforeach()
|
||||
endfunction()
|
||||
unset(the_module)
|
||||
endmacro()
|
||||
|
||||
# Check if list of input items is unique.
|
||||
# Usage: _assert_uniqueness(<failure message> <element> [<element> ...])
|
||||
@@ -613,7 +615,7 @@ function(__ocv_resolve_dependencies)
|
||||
list(APPEND LINK_DEPS opencv_world)
|
||||
endif()
|
||||
endif()
|
||||
if(${m} STREQUAL opencv_world)
|
||||
if("${m}" STREQUAL opencv_world)
|
||||
list(APPEND OPENCV_MODULE_opencv_world_DEPS_EXT ${OPENCV_MODULE_${m2}_DEPS_EXT})
|
||||
endif()
|
||||
endif()
|
||||
@@ -840,7 +842,7 @@ macro(ocv_create_module)
|
||||
if(NOT " ${ARGN}" STREQUAL " ")
|
||||
set(OPENCV_MODULE_${the_module}_LINK_DEPS "${OPENCV_MODULE_${the_module}_LINK_DEPS};${ARGN}" CACHE INTERNAL "")
|
||||
endif()
|
||||
if(${BUILD_opencv_world} AND OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD)
|
||||
if(BUILD_opencv_world AND OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD)
|
||||
# nothing
|
||||
set(the_module_target opencv_world)
|
||||
else()
|
||||
@@ -907,6 +909,17 @@ macro(_ocv_create_module)
|
||||
source_group("Src" FILES "${_VS_VERSION_FILE}")
|
||||
endif()
|
||||
endif()
|
||||
if(WIN32 AND NOT (
|
||||
"${the_module}" STREQUAL "opencv_core" OR
|
||||
"${the_module}" STREQUAL "opencv_world" OR
|
||||
"${the_module}" STREQUAL "opencv_cudev"
|
||||
)
|
||||
AND (BUILD_SHARED_LIBS AND NOT "x${OPENCV_MODULE_TYPE}" STREQUAL "xSTATIC")
|
||||
AND NOT OPENCV_SKIP_DLLMAIN_GENERATION
|
||||
)
|
||||
set(_DLLMAIN_FILE "${CMAKE_CURRENT_BINARY_DIR}/${the_module}_main.cpp")
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/dllmain.cpp.in" "${_DLLMAIN_FILE}" @ONLY)
|
||||
endif()
|
||||
|
||||
source_group("Include" FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp")
|
||||
source_group("Src" FILES "${${the_module}_pch}")
|
||||
@@ -916,6 +929,7 @@ macro(_ocv_create_module)
|
||||
"${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp"
|
||||
${${the_module}_pch}
|
||||
${_VS_VERSION_FILE}
|
||||
${_DLLMAIN_FILE}
|
||||
)
|
||||
set_target_properties(${the_module} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module")
|
||||
set_source_files_properties(${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES} ${${the_module}_pch}
|
||||
|
||||
@@ -89,7 +89,7 @@ set(CPACK_COMPONENT_TESTS_DEPENDS libs)
|
||||
|
||||
if(HAVE_CUDA)
|
||||
string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
|
||||
if(${CUDA_VERSION} VERSION_LESS "6.5")
|
||||
if(CUDA_VERSION VERSION_LESS "6.5")
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
|
||||
else()
|
||||
|
||||
+89
-16
@@ -121,8 +121,10 @@ macro(ocv_assert)
|
||||
endmacro()
|
||||
|
||||
macro(ocv_debug_message)
|
||||
# string(REPLACE ";" " " __msg "${ARGN}")
|
||||
# message(STATUS "${__msg}")
|
||||
if(OPENCV_CMAKE_DEBUG_MESSAGES)
|
||||
string(REPLACE ";" " " __msg "${ARGN}")
|
||||
message(STATUS "${__msg}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(ocv_check_environment_variables)
|
||||
@@ -147,7 +149,9 @@ macro(ocv_path_join result_var P1 P2_)
|
||||
else()
|
||||
set(${result_var} "${P1}/${P2}")
|
||||
endif()
|
||||
string(REGEX REPLACE "([/\\]?)[\\.][/\\]" "\\1" ${result_var} "${${result_var}}")
|
||||
string(REPLACE "\\\\" "\\" ${result_var} "${${result_var}}")
|
||||
string(REPLACE "//" "/" ${result_var} "${${result_var}}")
|
||||
string(REGEX REPLACE "(^|[/\\])[\\.][/\\]" "\\1" ${result_var} "${${result_var}}")
|
||||
if("${${result_var}}" STREQUAL "")
|
||||
set(${result_var} ".")
|
||||
endif()
|
||||
@@ -259,7 +263,7 @@ function(ocv_include_directories)
|
||||
ocv_is_opencv_directory(__is_opencv_dir "${dir}")
|
||||
if(__is_opencv_dir)
|
||||
list(APPEND __add_before "${dir}")
|
||||
elseif(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
|
||||
elseif(((CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0") OR CV_CLANG) AND
|
||||
dir MATCHES "/usr/include$")
|
||||
# workaround for GCC 6.x bug
|
||||
else()
|
||||
@@ -504,7 +508,7 @@ macro(ocv_warnings_disable)
|
||||
foreach(var ${_flag_vars})
|
||||
foreach(warning ${_gxx_warnings})
|
||||
if(NOT warning MATCHES "^-Wno-")
|
||||
string(REGEX REPLACE "${warning}(=[^ ]*)?" "" ${var} "${${var}}")
|
||||
string(REGEX REPLACE "(^|[ ]+)${warning}(=[^ ]*)?([ ]+|$)" " " ${var} "${${var}}")
|
||||
string(REPLACE "-W" "-Wno-" warning "${warning}")
|
||||
endif()
|
||||
ocv_check_flag_support(${var} "${warning}" _varname "")
|
||||
@@ -567,14 +571,21 @@ endmacro()
|
||||
# Provides an option that the user can optionally select.
|
||||
# Can accept condition to control when option is available for user.
|
||||
# Usage:
|
||||
# option(<option_variable> "help string describing the option" <initial value or boolean expression> [IF <condition>])
|
||||
# option(<option_variable>
|
||||
# "help string describing the option"
|
||||
# <initial value or boolean expression>
|
||||
# [VISIBLE_IF <condition>]
|
||||
# [VERIFY <condition>])
|
||||
macro(OCV_OPTION variable description value)
|
||||
set(__value ${value})
|
||||
set(__condition "")
|
||||
set(__verification)
|
||||
set(__varname "__value")
|
||||
foreach(arg ${ARGN})
|
||||
if(arg STREQUAL "IF" OR arg STREQUAL "if")
|
||||
if(arg STREQUAL "IF" OR arg STREQUAL "if" OR arg STREQUAL "VISIBLE_IF")
|
||||
set(__varname "__condition")
|
||||
elseif(arg STREQUAL "VERIFY")
|
||||
set(__varname "__verification")
|
||||
else()
|
||||
list(APPEND ${__varname} ${arg})
|
||||
endif()
|
||||
@@ -601,15 +612,55 @@ macro(OCV_OPTION variable description value)
|
||||
option(${variable} "${description}" ${__value})
|
||||
endif()
|
||||
else()
|
||||
if(DEFINED ${variable})
|
||||
# TODO: message(WARNING "Option will be ignored: ${variable} (=${${variable}})")
|
||||
if(DEFINED ${variable} AND "${${variable}}" # emit warnings about turned ON options only.
|
||||
AND NOT (OPENCV_HIDE_WARNING_UNSUPPORTED_OPTION OR "$ENV{OPENCV_HIDE_WARNING_UNSUPPORTED_OPTION}")
|
||||
)
|
||||
message(WARNING "Unexpected option: ${variable} (=${${variable}})\nCondition: IF (${__condition})")
|
||||
endif()
|
||||
unset(${variable} CACHE)
|
||||
if(OPENCV_UNSET_UNSUPPORTED_OPTION)
|
||||
unset(${variable} CACHE)
|
||||
endif()
|
||||
endif()
|
||||
if(__verification)
|
||||
set(OPENCV_VERIFY_${variable} "${__verification}") # variable containing condition to verify
|
||||
list(APPEND OPENCV_VERIFICATIONS "${variable}") # list of variable names (WITH_XXX;WITH_YYY;...)
|
||||
endif()
|
||||
unset(__condition)
|
||||
unset(__value)
|
||||
endmacro()
|
||||
|
||||
|
||||
# Check that each variable stored in OPENCV_VERIFICATIONS list
|
||||
# is consistent with actual detection result (stored as condition in OPENCV_VERIFY_...) variables
|
||||
function(ocv_verify_config)
|
||||
set(broken_options)
|
||||
foreach(var ${OPENCV_VERIFICATIONS})
|
||||
set(evaluated FALSE)
|
||||
if(${OPENCV_VERIFY_${var}})
|
||||
set(evaluated TRUE)
|
||||
endif()
|
||||
status("Verifying ${var}=${${var}} => '${OPENCV_VERIFY_${var}}'=${evaluated}")
|
||||
if (${var} AND NOT evaluated)
|
||||
list(APPEND broken_options ${var})
|
||||
message(WARNING
|
||||
"Option ${var} is enabled but corresponding dependency "
|
||||
"have not been found: \"${OPENCV_VERIFY_${var}}\" is FALSE")
|
||||
elseif(NOT ${var} AND evaluated)
|
||||
list(APPEND broken_options ${var})
|
||||
message(WARNING
|
||||
"Option ${var} is disabled or unset but corresponding dependency "
|
||||
"have been explicitly turned on: \"${OPENCV_VERIFY_${var}}\" is TRUE")
|
||||
endif()
|
||||
endforeach()
|
||||
if(broken_options)
|
||||
string(REPLACE ";" "\n" broken_options "${broken_options}")
|
||||
message(FATAL_ERROR
|
||||
"Some dependencies have not been found or have been forced, "
|
||||
"unset ENABLE_CONFIG_VERIFICATION option to ignore these failures "
|
||||
"or change following options:\n${broken_options}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Usage: ocv_append_build_options(HIGHGUI FFMPEG)
|
||||
macro(ocv_append_build_options var_prefix pkg_prefix)
|
||||
foreach(suffix INCLUDE_DIRS LIBRARIES LIBRARY_DIRS)
|
||||
@@ -997,6 +1048,15 @@ function(ocv_convert_to_lib_name var)
|
||||
set(${var} ${tmp} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if(MSVC AND BUILD_SHARED_LIBS) # no defaults for static libs (modern CMake is required)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.6.0)
|
||||
option(INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL "Don't install PDB files by default" ON)
|
||||
option(INSTALL_PDB "Add install PDB rules" ON)
|
||||
elseif(NOT CMAKE_VERSION VERSION_LESS 3.1.0)
|
||||
option(INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL "Don't install PDB files by default (not supported)" OFF)
|
||||
option(INSTALL_PDB "Add install PDB rules" OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# add install command
|
||||
function(ocv_install_target)
|
||||
@@ -1028,9 +1088,10 @@ function(ocv_install_target)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(INSTALL_PDB AND (NOT INSTALL_IGNORE_PDB))
|
||||
set(__target "${ARGV0}")
|
||||
|
||||
set(__target "${ARGV0}")
|
||||
if(INSTALL_PDB AND NOT INSTALL_IGNORE_PDB
|
||||
AND NOT OPENCV_${__target}_PDB_SKIP
|
||||
)
|
||||
set(__location_key "ARCHIVE") # static libs
|
||||
get_target_property(__target_type ${__target} TYPE)
|
||||
if("${__target_type}" STREQUAL "SHARED_LIBRARY")
|
||||
@@ -1062,16 +1123,28 @@ function(ocv_install_target)
|
||||
if(DEFINED INSTALL_PDB_COMPONENT AND INSTALL_PDB_COMPONENT)
|
||||
set(__pdb_install_component "${INSTALL_PDB_COMPONENT}")
|
||||
endif()
|
||||
set(__pdb_exclude_from_all "")
|
||||
if(INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.6.0)
|
||||
set(__pdb_exclude_from_all EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
message(WARNING "INSTALL_PDB_COMPONENT_EXCLUDE_FROM_ALL requires CMake 3.6+")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# message(STATUS "Adding PDB file installation rule: target=${__target} dst=${__dst} component=${__pdb_install_component}")
|
||||
if("${__target_type}" STREQUAL "SHARED_LIBRARY")
|
||||
install(FILES "$<TARGET_PDB_FILE:${__target}>" DESTINATION "${__dst}" COMPONENT ${__pdb_install_component} OPTIONAL)
|
||||
install(FILES "$<TARGET_PDB_FILE:${__target}>" DESTINATION "${__dst}"
|
||||
COMPONENT ${__pdb_install_component} OPTIONAL ${__pdb_exclude_from_all})
|
||||
else()
|
||||
# There is no generator expression similar to TARGET_PDB_FILE and TARGET_PDB_FILE can't be used: https://gitlab.kitware.com/cmake/cmake/issues/16932
|
||||
# However we still want .pdb files like: 'lib/Debug/opencv_core341d.pdb' or '3rdparty/lib/zlibd.pdb'
|
||||
install(FILES "$<TARGET_PROPERTY:${__target},ARCHIVE_OUTPUT_DIRECTORY>/$<CONFIG>/$<IF:$<BOOL:$<TARGET_PROPERTY:${__target},COMPILE_PDB_NAME_DEBUG>>,$<TARGET_PROPERTY:${__target},COMPILE_PDB_NAME_DEBUG>,$<TARGET_PROPERTY:${__target},COMPILE_PDB_NAME>>.pdb"
|
||||
DESTINATION "${__dst}" CONFIGURATIONS Debug COMPONENT ${__pdb_install_component} OPTIONAL)
|
||||
DESTINATION "${__dst}" CONFIGURATIONS Debug
|
||||
COMPONENT ${__pdb_install_component} OPTIONAL ${__pdb_exclude_from_all})
|
||||
install(FILES "$<TARGET_PROPERTY:${__target},ARCHIVE_OUTPUT_DIRECTORY>/$<CONFIG>/$<IF:$<BOOL:$<TARGET_PROPERTY:${__target},COMPILE_PDB_NAME_RELEASE>>,$<TARGET_PROPERTY:${__target},COMPILE_PDB_NAME_RELEASE>,$<TARGET_PROPERTY:${__target},COMPILE_PDB_NAME>>.pdb"
|
||||
DESTINATION "${__dst}" CONFIGURATIONS Release COMPONENT ${__pdb_install_component} OPTIONAL)
|
||||
DESTINATION "${__dst}" CONFIGURATIONS Release
|
||||
COMPONENT ${__pdb_install_component} OPTIONAL ${__pdb_exclude_from_all})
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "PDB files installation is not supported (need CMake >= 3.1.0)")
|
||||
|
||||
@@ -15,7 +15,7 @@ set(OPENCV_LIBVERSION "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_
|
||||
|
||||
# create a dependency on the version file
|
||||
# we never use the output of the following command but cmake will rerun automatically if the version file changes
|
||||
configure_file("${OPENCV_VERSION_FILE}" "${CMAKE_BINARY_DIR}/junk/version.junk" COPYONLY)
|
||||
configure_file("${OPENCV_VERSION_FILE}" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/opencv_junk/version.junk" COPYONLY)
|
||||
|
||||
ocv_update(OPENCV_VS_VER_FILEVERSION_QUAD "${OPENCV_VERSION_MAJOR},${OPENCV_VERSION_MINOR},${OPENCV_VERSION_PATCH},0")
|
||||
ocv_update(OPENCV_VS_VER_PRODUCTVERSION_QUAD "${OPENCV_VERSION_MAJOR},${OPENCV_VERSION_MINOR},${OPENCV_VERSION_PATCH},0")
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
# if defined(__VSX__)
|
||||
# include <altivec.h>
|
||||
# else
|
||||
# error "VSX is not supported"
|
||||
# endif
|
||||
#if defined(__VSX__)
|
||||
#if defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
|
||||
#include <altivec.h>
|
||||
#else
|
||||
#error "OpenCV only supports little-endian mode"
|
||||
#endif
|
||||
#else
|
||||
#error "VSX is not supported"
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#if defined(__VSX__)
|
||||
#if defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
|
||||
#include <altivec.h>
|
||||
#else
|
||||
#error "OpenCV only supports little-endian mode"
|
||||
#endif
|
||||
#else
|
||||
#error "VSX3 is not supported"
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
__vector unsigned char a = vec_splats((unsigned char)1);
|
||||
__vector unsigned char b = vec_splats((unsigned char)2);
|
||||
__vector unsigned char r = vec_absd(a, b);
|
||||
return 0;
|
||||
}
|
||||
@@ -16,7 +16,7 @@ endif()
|
||||
|
||||
set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES})
|
||||
|
||||
if(${CUDA_VERSION} VERSION_LESS "5.5")
|
||||
if(CUDA_VERSION VERSION_LESS "5.5")
|
||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY})
|
||||
else()
|
||||
find_cuda_helper_libs(nppc)
|
||||
|
||||
@@ -105,9 +105,7 @@
|
||||
#cmakedefine HAVE_IPP
|
||||
#cmakedefine HAVE_IPP_ICV
|
||||
#cmakedefine HAVE_IPP_IW
|
||||
|
||||
/* Intel IPP Async */
|
||||
#cmakedefine HAVE_IPP_A
|
||||
#cmakedefine HAVE_IPP_IW_LL
|
||||
|
||||
/* JPEG-2000 codec */
|
||||
#cmakedefine HAVE_JASPER
|
||||
@@ -244,5 +242,7 @@
|
||||
/* OpenCV trace utilities */
|
||||
#cmakedefine OPENCV_TRACE
|
||||
|
||||
/* Library QR-code decoding */
|
||||
#cmakedefine HAVE_QUIRC
|
||||
|
||||
#endif // OPENCV_CVCONFIG_H_INCLUDED
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// 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.
|
||||
|
||||
#ifndef _WIN32
|
||||
#error "Build configuration error"
|
||||
#endif
|
||||
#ifndef CVAPI_EXPORTS
|
||||
#error "Build configuration error"
|
||||
#endif
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#define OPENCV_MODULE_S "@the_module@"
|
||||
|
||||
namespace cv {
|
||||
extern __declspec(dllimport) bool __termination; // Details: #12750
|
||||
}
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpReserved);
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpReserved)
|
||||
{
|
||||
if (fdwReason == DLL_THREAD_DETACH || fdwReason == DLL_PROCESS_DETACH)
|
||||
{
|
||||
if (lpReserved != NULL) // called after ExitProcess() call
|
||||
{
|
||||
//printf("OpenCV: terminating: " OPENCV_MODULE_S "\n");
|
||||
cv::__termination = true;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
|
||||
[[ ! "${OPENCV_QUIET}" ]] && ( echo "Setting vars for OpenCV @OPENCV_VERSION@" )
|
||||
export LD_LIBRARY_PATH="$SCRIPT_DIR/@OPENCV_LIB_RUNTIME_DIR_RELATIVE_CMAKECONFIG@:$LD_LIBRARY_PATH"
|
||||
|
||||
if [[ ! "$OPENCV_SKIP_PYTHON" ]]; then
|
||||
PYTHONPATH_OPENCV="$SCRIPT_DIR/@OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG@"
|
||||
[[ ! "${OPENCV_QUIET}" ]] && ( echo "Append PYTHONPATH: ${PYTHONPATH_OPENCV}" )
|
||||
export PYTHONPATH="${PYTHONPATH_OPENCV}:$PYTHONPATH"
|
||||
fi
|
||||
|
||||
# Don't exec in "sourced" mode
|
||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
if [[ $# -ne 0 ]]; then
|
||||
[[ ! "${OPENCV_QUIET}" && "${OPENCV_VERBOSE}" ]] && ( echo "Executing: $*" )
|
||||
exec "$@"
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
|
||||
[[ ! "${OPENCV_QUIET}" ]] && ( echo "Setting vars for OpenCV @OPENCV_VERSION@" )
|
||||
export DYLD_LIBRARY_PATH="$SCRIPT_DIR/@OPENCV_LIB_RUNTIME_DIR_RELATIVE_CMAKECONFIG@:$DYLD_LIBRARY_PATH"
|
||||
|
||||
if [[ ! "$OPENCV_SKIP_PYTHON" ]]; then
|
||||
PYTHONPATH_OPENCV="$SCRIPT_DIR/@OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG@"
|
||||
[[ ! "${OPENCV_QUIET}" ]] && ( echo "Append PYTHONPATH: ${PYTHONPATH_OPENCV}" )
|
||||
export PYTHONPATH="${PYTHONPATH_OPENCV}:$PYTHONPATH"
|
||||
fi
|
||||
|
||||
# Don't exec in "sourced" mode
|
||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
if [[ $# -ne 0 ]]; then
|
||||
[[ ! "${OPENCV_QUIET}" && "${OPENCV_VERBOSE}" ]] && ( echo "Executing: $*" )
|
||||
exec "$@"
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,36 @@
|
||||
@ECHO OFF
|
||||
|
||||
SET "SCRIPT_DIR=%~dp0"
|
||||
|
||||
IF NOT DEFINED OPENCV_QUIET ( ECHO Setting vars for OpenCV @OPENCV_VERSION@ )
|
||||
SET "PATH=%SCRIPT_DIR%\@OPENCV_LIB_RUNTIME_DIR_RELATIVE_CMAKECONFIG@;%PATH%"
|
||||
|
||||
IF NOT DEFINED OPENCV_SKIP_PYTHON CALL :SET_PYTHON
|
||||
|
||||
SET SCRIPT_DIR=
|
||||
|
||||
IF NOT [%1] == [] GOTO :RUN_COMMAND
|
||||
|
||||
GOTO :EOF
|
||||
|
||||
:RUN_COMMAND
|
||||
SET RUN_INTERACTIVE=1
|
||||
echo %CMDCMDLINE% | find /i "%~0" >nul
|
||||
IF NOT errorlevel 1 set RUN_INTERACTIVE=0
|
||||
|
||||
%*
|
||||
SET RESULT=%ERRORLEVEL%
|
||||
IF %RESULT% NEQ 0 (
|
||||
IF _%RUN_INTERACTIVE%_==_0_ ( IF NOT DEFINED OPENCV_BATCH_MODE ( pause ) )
|
||||
)
|
||||
EXIT /B %RESULT%
|
||||
|
||||
:SET_PYTHON
|
||||
SET "PYTHONPATH_OPENCV=%SCRIPT_DIR%\@OPENCV_PYTHON_DIR_RELATIVE_CMAKECONFIG@"
|
||||
IF NOT DEFINED OPENCV_QUIET ( ECHO Append PYTHONPATH: %PYTHONPATH_OPENCV% )
|
||||
SET "PYTHONPATH=%PYTHONPATH_OPENCV%;%PYTHONPATH%"
|
||||
SET PYTHONPATH_OPENCV=
|
||||
EXIT /B
|
||||
|
||||
|
||||
:EOF
|
||||
@@ -14,6 +14,7 @@ if(DOXYGEN_FOUND)
|
||||
add_custom_target(doxygen)
|
||||
|
||||
# not documented modules list
|
||||
set(blacklist "${DOXYGEN_BLACKLIST}")
|
||||
list(APPEND blacklist "ts" "java_bindings_generator" "java" "python_bindings_generator" "python2" "python3" "js" "world")
|
||||
unset(CMAKE_DOXYGEN_TUTORIAL_CONTRIB_ROOT)
|
||||
unset(CMAKE_DOXYGEN_TUTORIAL_JS_ROOT)
|
||||
|
||||
+4
-2
@@ -107,7 +107,7 @@ RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = *.inl.hpp *.impl.hpp *_detail.hpp */cudev/**/detail/*.hpp *.m */opencl/runtime/*
|
||||
EXCLUDE_SYMBOLS = cv::DataType<*> cv::traits::* int void CV__*
|
||||
EXCLUDE_SYMBOLS = cv::DataType<*> cv::traits::* int void CV__* T __CV*
|
||||
EXAMPLE_PATH = @CMAKE_DOXYGEN_EXAMPLE_PATH@
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = YES
|
||||
@@ -227,7 +227,6 @@ SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = __cplusplus=1 \
|
||||
HAVE_IPP_A=1 \
|
||||
CVAPI(x)=x \
|
||||
CV_DOXYGEN= \
|
||||
CV_EXPORTS= \
|
||||
@@ -251,6 +250,9 @@ PREDEFINED = __cplusplus=1 \
|
||||
CV_DEFAULT(x)=" = x" \
|
||||
CV_NEON=1 \
|
||||
CV_SSE2=1 \
|
||||
CV__DEBUG_NS_BEGIN= \
|
||||
CV__DEBUG_NS_END= \
|
||||
CV_DEPRECATED_EXTERNAL= \
|
||||
CV_DEPRECATED=
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
|
||||
+343
-314
File diff suppressed because it is too large
Load Diff
@@ -55,10 +55,18 @@ you can get a better result.
|
||||
|
||||

|
||||
|
||||
@note More details to be added
|
||||
There are some parameters when you get familiar with StereoBM, and you may need to fine tune the parameters to get better and smooth results. Parameters:
|
||||
- texture_threshold: filters out areas that don't have enough texture for reliable matching
|
||||
- Speckle range and size: Block-based matchers often produce "speckles" near the boundaries of objects, where the matching window catches the foreground on one side and the background on the other. In this scene it appears that the matcher is also finding small spurious matches in the projected texture on the table. To get rid of these artifacts we post-process the disparity image with a speckle filter controlled by the speckle_size and speckle_range parameters. speckle_size is the number of pixels below which a disparity blob is dismissed as "speckle." speckle_range controls how close in value disparities must be to be considered part of the same blob.
|
||||
- Number of disparities: How many pixels to slide the window over. The larger it is, the larger the range of visible depths, but more computation is required.
|
||||
- min_disparity: the offset from the x-position of the left pixel at which to begin searching.
|
||||
- uniqueness_ratio: Another post-filtering step. If the best matching disparity is not sufficiently better than every other disparity in the search range, the pixel is filtered out. You can try tweaking this if texture_threshold and the speckle filtering are still letting through spurious matches.
|
||||
- prefilter_size and prefilter_cap: The pre-filtering phase, which normalizes image brightness and enhances texture in preparation for block matching. Normally you should not need to adjust these.
|
||||
|
||||
|
||||
Additional Resources
|
||||
--------------------
|
||||
- [Ros stereo img processing wiki page](http://wiki.ros.org/stereo_image_proc/Tutorials/ChoosingGoodStereoParameters)
|
||||
|
||||
Exercises
|
||||
---------
|
||||
|
||||
@@ -153,15 +153,15 @@ padding etc. This function takes following arguments:
|
||||
|
||||
- **borderType** - Flag defining what kind of border to be added. It can be following types:
|
||||
- **cv.BORDER_CONSTANT** - Adds a constant colored border. The value should be given
|
||||
as next argument.
|
||||
- **cv.BORDER_REFLECT** - Border will be mirror reflection of the border elements,
|
||||
like this : *fedcba|abcdefgh|hgfedcb*
|
||||
- **cv.BORDER_REFLECT_101** or **cv.BORDER_DEFAULT** - Same as above, but with a
|
||||
slight change, like this : *gfedcb|abcdefgh|gfedcba*
|
||||
- **cv.BORDER_REPLICATE** - Last element is replicated throughout, like this:
|
||||
*aaaaaa|abcdefgh|hhhhhhh*
|
||||
- **cv.BORDER_WRAP** - Can't explain, it will look like this :
|
||||
*cdefgh|abcdefgh|abcdefg*
|
||||
as next argument.
|
||||
- **cv.BORDER_REFLECT** - Border will be mirror reflection of the border elements,
|
||||
like this : *fedcba|abcdefgh|hgfedcb*
|
||||
- **cv.BORDER_REFLECT_101** or **cv.BORDER_DEFAULT** - Same as above, but with a
|
||||
slight change, like this : *gfedcb|abcdefgh|gfedcba*
|
||||
- **cv.BORDER_REPLICATE** - Last element is replicated throughout, like this:
|
||||
*aaaaaa|abcdefgh|hhhhhhh*
|
||||
- **cv.BORDER_WRAP** - Can't explain, it will look like this :
|
||||
*cdefgh|abcdefgh|abcdefg*
|
||||
|
||||
- **value** - Color of border if border type is cv.BORDER_CONSTANT
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ points.
|
||||
Now an orientation is assigned to each keypoint to achieve invariance to image rotation. A
|
||||
neighbourhood is taken around the keypoint location depending on the scale, and the gradient
|
||||
magnitude and direction is calculated in that region. An orientation histogram with 36 bins covering
|
||||
360 degrees is created. (It is weighted by gradient magnitude and gaussian-weighted circular window
|
||||
with \f$\sigma\f$ equal to 1.5 times the scale of keypoint. The highest peak in the histogram is taken
|
||||
360 degrees is created (It is weighted by gradient magnitude and gaussian-weighted circular window
|
||||
with \f$\sigma\f$ equal to 1.5 times the scale of keypoint). The highest peak in the histogram is taken
|
||||
and any peak above 80% of it is also considered to calculate the orientation. It creates keypoints
|
||||
with same location and scale, but different directions. It contribute to stability of matching.
|
||||
|
||||
@@ -99,7 +99,7 @@ illumination changes, rotation etc.
|
||||
Keypoints between two images are matched by identifying their nearest neighbours. But in some cases,
|
||||
the second closest-match may be very near to the first. It may happen due to noise or some other
|
||||
reasons. In that case, ratio of closest-distance to second-closest distance is taken. If it is
|
||||
greater than 0.8, they are rejected. It eliminaters around 90% of false matches while discards only
|
||||
greater than 0.8, they are rejected. It eliminates around 90% of false matches while discards only
|
||||
5% correct matches, as per the paper.
|
||||
|
||||
So this is a summary of SIFT algorithm. For more details and understanding, reading the original
|
||||
|
||||
@@ -37,6 +37,7 @@ cv.namedWindow('image')
|
||||
|
||||
# create trackbars for color change
|
||||
cv.createTrackbar('R','image',0,255,nothing)
|
||||
|
||||
cv.createTrackbar('G','image',0,255,nothing)
|
||||
cv.createTrackbar('B','image',0,255,nothing)
|
||||
|
||||
|
||||
+3
-3
@@ -79,11 +79,11 @@ using **np.ifft2()** function. The result, again, will be a complex number. You
|
||||
absolute value.
|
||||
@code{.py}
|
||||
rows, cols = img.shape
|
||||
crow,ccol = rows/2 , cols/2
|
||||
fshift[crow-30:crow+30, ccol-30:ccol+30] = 0
|
||||
crow,ccol = rows//2 , cols//2
|
||||
fshift[crow-30:crow+31, ccol-30:ccol+31] = 0
|
||||
f_ishift = np.fft.ifftshift(fshift)
|
||||
img_back = np.fft.ifft2(f_ishift)
|
||||
img_back = np.abs(img_back)
|
||||
img_back = np.real(img_back)
|
||||
|
||||
plt.subplot(131),plt.imshow(img, cmap = 'gray')
|
||||
plt.title('Input Image'), plt.xticks([]), plt.yticks([])
|
||||
|
||||
@@ -85,10 +85,8 @@ we will later have to clip the data in order to avoid overflow.
|
||||
|
||||
@code{.py}
|
||||
# Tonemap HDR image
|
||||
tonemap1 = cv.createTonemapDurand(gamma=2.2)
|
||||
tonemap1 = cv.createTonemap(gamma=2.2)
|
||||
res_debevec = tonemap1.process(hdr_debevec.copy())
|
||||
tonemap2 = cv.createTonemapDurand(gamma=1.3)
|
||||
res_robertson = tonemap2.process(hdr_robertson.copy())
|
||||
@endcode
|
||||
|
||||
### 4. Merge exposures using Mertens fusion
|
||||
@@ -173,5 +171,5 @@ Additional Resources
|
||||
|
||||
Exercises
|
||||
---------
|
||||
1. Try all tonemap algorithms: cv::TonemapDrago, cv::TonemapDurand, cv::TonemapMantiuk and cv::TonemapReinhard
|
||||
1. Try all tonemap algorithms: cv::TonemapDrago, cv::TonemapMantiuk and cv::TonemapReinhard
|
||||
2. Try changing the parameters in the HDR calibration and tonemap methods.
|
||||
|
||||
@@ -20,7 +20,7 @@ extract the moving foreground from static background.
|
||||
If you have an image of background alone, like an image of the room without visitors, image of the road
|
||||
without vehicles etc, it is an easy job. Just subtract the new image from the background. You get
|
||||
the foreground objects alone. But in most of the cases, you may not have such an image, so we need
|
||||
to extract the background from whatever images we have. It become more complicated when there are
|
||||
to extract the background from whatever images we have. It becomes more complicated when there are
|
||||
shadows of the vehicles. Since shadows also move, simple subtraction will mark that also as
|
||||
foreground. It complicates things.
|
||||
|
||||
@@ -72,7 +72,7 @@ papers by Z.Zivkovic, "Improved adaptive Gaussian mixture model for background s
|
||||
and "Efficient Adaptive Density Estimation per Image Pixel for the Task of Background Subtraction"
|
||||
in 2006. One important feature of this algorithm is that it selects the appropriate number of
|
||||
gaussian distribution for each pixel. (Remember, in last case, we took a K gaussian distributions
|
||||
throughout the algorithm). It provides better adaptibility to varying scenes due illumination
|
||||
throughout the algorithm). It provides better adaptability to varying scenes due illumination
|
||||
changes etc.
|
||||
|
||||
As in previous case, we have to create a background subtractor object. Here, you have an option of
|
||||
|
||||
@@ -75,10 +75,10 @@ solution.
|
||||
( Check similarity of inverse matrix with Harris corner detector. It denotes that corners are better
|
||||
points to be tracked.)
|
||||
|
||||
So from user point of view, idea is simple, we give some points to track, we receive the optical
|
||||
So from the user point of view, the idea is simple, we give some points to track, we receive the optical
|
||||
flow vectors of those points. But again there are some problems. Until now, we were dealing with
|
||||
small motions. So it fails when there is large motion. So again we go for pyramids. When we go up in
|
||||
the pyramid, small motions are removed and large motions becomes small motions. So applying
|
||||
small motions, so it fails when there is a large motion. To deal with this we use pyramids. When we go up in
|
||||
the pyramid, small motions are removed and large motions become small motions. So by applying
|
||||
Lucas-Kanade there, we get optical flow along with the scale.
|
||||
|
||||
Lucas-Kanade Optical Flow in OpenCV
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
Changing the contrast and brightness of an image! {#tutorial_basic_linear_transform}
|
||||
=================================================
|
||||
|
||||
@prev_tutorial{tutorial_adding_images}
|
||||
@next_tutorial{tutorial_discrete_fourier_transform}
|
||||
|
||||
Goal
|
||||
----
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Discrete Fourier Transform {#tutorial_discrete_fourier_transform}
|
||||
==========================
|
||||
|
||||
@prev_tutorial{tutorial_random_generator_and_text}
|
||||
@prev_tutorial{tutorial_basic_linear_transform}
|
||||
@next_tutorial{tutorial_file_input_output_with_xml_yml}
|
||||
|
||||
Goal
|
||||
|
||||
+3
@@ -1,6 +1,9 @@
|
||||
File Input and Output using XML and YAML files {#tutorial_file_input_output_with_xml_yml}
|
||||
==============================================
|
||||
|
||||
@prev_tutorial{tutorial_discrete_fourier_transform}
|
||||
@next_tutorial{tutorial_interoperability_with_OpenCV_1}
|
||||
|
||||
Goal
|
||||
----
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
How to scan images, lookup tables and time measurement with OpenCV {#tutorial_how_to_scan_images}
|
||||
==================================================================
|
||||
|
||||
@prev_tutorial{tutorial_mat_the_basic_image_container}
|
||||
@next_tutorial{tutorial_mat_mask_operations}
|
||||
|
||||
Goal
|
||||
----
|
||||
|
||||
@@ -66,7 +69,7 @@ to an integer format. Then we use a simple look and the upper formula to calcula
|
||||
No OpenCV specific stuff here.
|
||||
|
||||
Another issue is how do we measure time? Well OpenCV offers two simple functions to achieve this
|
||||
@ref cv::getTickCount() and @ref cv::getTickFrequency() . The first returns the number of ticks of
|
||||
cv::getTickCount() and cv::getTickFrequency() . The first returns the number of ticks of
|
||||
your systems CPU from a certain event (like since you booted your system). The second returns how
|
||||
many times your CPU emits a tick during a second. So to measure in seconds the number of time
|
||||
elapsed between two operations is easy as:
|
||||
@@ -95,7 +98,7 @@ example in case of an BGR color system:
|
||||
Note that the order of the channels is inverse: BGR instead of RGB. Because in many cases the memory
|
||||
is large enough to store the rows in a successive fashion the rows may follow one after another,
|
||||
creating a single long row. Because everything is in a single place following one after another this
|
||||
may help to speed up the scanning process. We can use the @ref cv::Mat::isContinuous() function to *ask*
|
||||
may help to speed up the scanning process. We can use the cv::Mat::isContinuous() function to *ask*
|
||||
the matrix if this is the case. Continue on to the next section to find an example.
|
||||
|
||||
The efficient way
|
||||
@@ -152,7 +155,7 @@ elements in the image. Its basic usage is to specify the row and column number o
|
||||
to access. During our earlier scanning methods you could already observe that is important through
|
||||
what type we are looking at the image. It's no different here as you need to manually specify what
|
||||
type to use at the automatic lookup. You can observe this in case of the gray scale images for the
|
||||
following source code (the usage of the + @ref cv::at() function):
|
||||
following source code (the usage of the + cv::Mat::at() function):
|
||||
|
||||
@snippet how_to_scan_images.cpp scan-random
|
||||
|
||||
@@ -166,12 +169,12 @@ new row pointer for what we use the C operator[] to acquire the column element.
|
||||
|
||||
If you need to do multiple lookups using this method for an image it may be troublesome and time
|
||||
consuming to enter the type and the at keyword for each of the accesses. To solve this problem
|
||||
OpenCV has a @ref cv::Mat_ data type. It's the same as Mat with the extra need that at definition
|
||||
OpenCV has a cv::Mat_ data type. It's the same as Mat with the extra need that at definition
|
||||
you need to specify the data type through what to look at the data matrix, however in return you can
|
||||
use the operator() for fast access of items. To make things even better this is easily convertible
|
||||
from and to the usual @ref cv::Mat data type. A sample usage of this you can see in case of the
|
||||
from and to the usual cv::Mat data type. A sample usage of this you can see in case of the
|
||||
color images of the upper function. Nevertheless, it's important to note that the same operation
|
||||
(with the same runtime speed) could have been done with the @ref cv::at() function. It's just a less
|
||||
(with the same runtime speed) could have been done with the cv::Mat::at function. It's just a less
|
||||
to write for the lazy programmer trick.
|
||||
|
||||
The Core Function
|
||||
@@ -180,7 +183,7 @@ The Core Function
|
||||
This is a bonus method of achieving lookup table modification in an image. In image
|
||||
processing it's quite common that you want to modify all of a given image values to some other value.
|
||||
OpenCV provides a function for modifying image values, without the need to write the scanning logic
|
||||
of the image. We use the @ref cv::LUT() function of the core module. First we build a Mat type of the
|
||||
of the image. We use the cv::LUT() function of the core module. First we build a Mat type of the
|
||||
lookup table:
|
||||
|
||||
@snippet how_to_scan_images.cpp table-init
|
||||
|
||||
+2
@@ -1,6 +1,8 @@
|
||||
How to use the OpenCV parallel_for_ to parallelize your code {#tutorial_how_to_use_OpenCV_parallel_for_}
|
||||
==================================================================
|
||||
|
||||
@prev_tutorial{tutorial_interoperability_with_OpenCV_1}
|
||||
|
||||
Goal
|
||||
----
|
||||
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
Intel® IPP Asynchronous C/C++ library in OpenCV {#tutorial_how_to_use_ippa_conversion}
|
||||
===============================================
|
||||
|
||||
Goal
|
||||
----
|
||||
|
||||
The tutorial demonstrates the [Intel® IPP Asynchronous
|
||||
C/C++](http://software.intel.com/en-us/intel-ipp-preview) library usage with OpenCV. The code
|
||||
example below illustrates implementation of the Sobel operation, accelerated with Intel® IPP
|
||||
Asynchronous C/C++ functions. In this code example, @ref cv::hpp::getMat and @ref cv::hpp::getHpp
|
||||
functions are used for data conversion between
|
||||
[hppiMatrix](http://software.intel.com/en-us/node/501660) and Mat matrices.
|
||||
|
||||
Code
|
||||
----
|
||||
|
||||
You may also find the source code in the
|
||||
`samples/cpp/tutorial_code/core/ippasync/ippasync_sample.cpp` file of the OpenCV source library or
|
||||
download it from [here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/core/ippasync/ippasync_sample.cpp).
|
||||
|
||||
@include cpp/tutorial_code/core/ippasync/ippasync_sample.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
-# Create parameters for OpenCV:
|
||||
@code{.cpp}
|
||||
VideoCapture cap;
|
||||
Mat image, gray, result;
|
||||
@endcode
|
||||
and IPP Async:
|
||||
@code{.cpp}
|
||||
hppiMatrix* src,* dst;
|
||||
hppAccel accel = 0;
|
||||
hppAccelType accelType;
|
||||
hppStatus sts;
|
||||
hppiVirtualMatrix * virtMatrix;
|
||||
@endcode
|
||||
-# Load input image or video. How to open and read video stream you can see in the
|
||||
@ref tutorial_video_input_psnr_ssim tutorial.
|
||||
@code{.cpp}
|
||||
if( useCamera )
|
||||
{
|
||||
printf("used camera\n");
|
||||
cap.open(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("used image %s\n", file.c_str());
|
||||
cap.open(file.c_str());
|
||||
}
|
||||
|
||||
if( !cap.isOpened() )
|
||||
{
|
||||
printf("can not open camera or video file\n");
|
||||
return -1;
|
||||
}
|
||||
@endcode
|
||||
-# Create accelerator instance using
|
||||
[hppCreateInstance](http://software.intel.com/en-us/node/501686):
|
||||
@code{.cpp}
|
||||
accelType = sAccel == "cpu" ? HPP_ACCEL_TYPE_CPU:
|
||||
sAccel == "gpu" ? HPP_ACCEL_TYPE_GPU:
|
||||
HPP_ACCEL_TYPE_ANY;
|
||||
|
||||
//Create accelerator instance
|
||||
sts = hppCreateInstance(accelType, 0, &accel);
|
||||
CHECK_STATUS(sts, "hppCreateInstance");
|
||||
@endcode
|
||||
-# Create an array of virtual matrices using
|
||||
[hppiCreateVirtualMatrices](http://software.intel.com/en-us/node/501700) function.
|
||||
@code{.cpp}
|
||||
virtMatrix = hppiCreateVirtualMatrices(accel, 1);
|
||||
@endcode
|
||||
-# Prepare a matrix for input and output data:
|
||||
@code{.cpp}
|
||||
cap >> image;
|
||||
if(image.empty())
|
||||
break;
|
||||
|
||||
cvtColor( image, gray, COLOR_BGR2GRAY );
|
||||
|
||||
result.create( image.rows, image.cols, CV_8U);
|
||||
@endcode
|
||||
-# Convert Mat to [hppiMatrix](http://software.intel.com/en-us/node/501660) using @ref cv::hpp::getHpp
|
||||
and call [hppiSobel](http://software.intel.com/en-us/node/474701) function.
|
||||
@code{.cpp}
|
||||
//convert Mat to hppiMatrix
|
||||
src = getHpp(gray, accel);
|
||||
dst = getHpp(result, accel);
|
||||
|
||||
sts = hppiSobel(accel,src, HPP_MASK_SIZE_3X3,HPP_NORM_L1,virtMatrix[0]);
|
||||
CHECK_STATUS(sts,"hppiSobel");
|
||||
|
||||
sts = hppiConvert(accel, virtMatrix[0], 0, HPP_RND_MODE_NEAR, dst, HPP_DATA_TYPE_8U);
|
||||
CHECK_STATUS(sts,"hppiConvert");
|
||||
|
||||
// Wait for tasks to complete
|
||||
sts = hppWait(accel, HPP_TIME_OUT_INFINITE);
|
||||
CHECK_STATUS(sts, "hppWait");
|
||||
@endcode
|
||||
We use [hppiConvert](http://software.intel.com/en-us/node/501746) because
|
||||
[hppiSobel](http://software.intel.com/en-us/node/474701) returns destination matrix with
|
||||
HPP_DATA_TYPE_16S data type for source matrix with HPP_DATA_TYPE_8U type. You should check
|
||||
hppStatus after each call IPP Async function.
|
||||
|
||||
-# Create windows and show the images, the usual way.
|
||||
@code{.cpp}
|
||||
imshow("image", image);
|
||||
imshow("rez", result);
|
||||
|
||||
waitKey(15);
|
||||
@endcode
|
||||
-# Delete hpp matrices.
|
||||
@code{.cpp}
|
||||
sts = hppiFreeMatrix(src);
|
||||
CHECK_DEL_STATUS(sts,"hppiFreeMatrix");
|
||||
|
||||
sts = hppiFreeMatrix(dst);
|
||||
CHECK_DEL_STATUS(sts,"hppiFreeMatrix");
|
||||
@endcode
|
||||
-# Delete virtual matrices and accelerator instance.
|
||||
@code{.cpp}
|
||||
if (virtMatrix)
|
||||
{
|
||||
sts = hppiDeleteVirtualMatrices(accel, virtMatrix);
|
||||
CHECK_DEL_STATUS(sts,"hppiDeleteVirtualMatrices");
|
||||
}
|
||||
|
||||
if (accel)
|
||||
{
|
||||
sts = hppDeleteInstance(accel);
|
||||
CHECK_DEL_STATUS(sts, "hppDeleteInstance");
|
||||
}
|
||||
@endcode
|
||||
|
||||
Result
|
||||
------
|
||||
|
||||
After compiling the code above we can execute it giving an image or video path and accelerator type
|
||||
as an argument. For this tutorial we use baboon.png image as input. The result is below.
|
||||
|
||||

|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.8 KiB |
+3
@@ -1,6 +1,9 @@
|
||||
Interoperability with OpenCV 1 {#tutorial_interoperability_with_OpenCV_1}
|
||||
==============================
|
||||
|
||||
@prev_tutorial{tutorial_file_input_output_with_xml_yml}
|
||||
@next_tutorial{tutorial_how_to_use_OpenCV_parallel_for_}
|
||||
|
||||
Goal
|
||||
----
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
Operations with images {#tutorial_mat_operations}
|
||||
======================
|
||||
|
||||
@prev_tutorial{tutorial_mat_mask_operations}
|
||||
@next_tutorial{tutorial_adding_images}
|
||||
|
||||
Input/Output
|
||||
------------
|
||||
|
||||
|
||||
+2
@@ -1,6 +1,8 @@
|
||||
Mat - The Basic Image Container {#tutorial_mat_the_basic_image_container}
|
||||
===============================
|
||||
|
||||
@next_tutorial{tutorial_how_to_scan_images}
|
||||
|
||||
Goal
|
||||
----
|
||||
|
||||
|
||||
@@ -62,24 +62,6 @@ understanding how to manipulate the images on a pixel level.
|
||||
|
||||
We will learn how to change our image appearance!
|
||||
|
||||
- @subpage tutorial_basic_geometric_drawing
|
||||
|
||||
*Languages:* C++, Java, Python
|
||||
|
||||
*Compatibility:* \> OpenCV 2.0
|
||||
|
||||
*Author:* Ana Huamán
|
||||
|
||||
We will learn how to draw simple geometry with OpenCV!
|
||||
|
||||
- @subpage tutorial_random_generator_and_text
|
||||
|
||||
*Compatibility:* \> OpenCV 2.0
|
||||
|
||||
*Author:* Ana Huamán
|
||||
|
||||
We will draw some *fancy-looking* stuff using OpenCV!
|
||||
|
||||
- @subpage tutorial_discrete_fourier_transform
|
||||
|
||||
*Languages:* C++, Java, Python
|
||||
@@ -111,15 +93,6 @@ understanding how to manipulate the images on a pixel level.
|
||||
Look here to shed light on all this questions.
|
||||
|
||||
|
||||
- @subpage tutorial_how_to_use_ippa_conversion
|
||||
|
||||
*Compatibility:* \> OpenCV 2.0
|
||||
|
||||
*Author:* Elena Gvozdeva
|
||||
|
||||
You will see how to use the IPP Async with OpenCV.
|
||||
|
||||
|
||||
- @subpage tutorial_how_to_use_OpenCV_parallel_for_
|
||||
|
||||
*Compatibility:* \>= OpenCV 2.4.3
|
||||
|
||||
@@ -12,7 +12,7 @@ Tutorial was written for the following versions of corresponding software:
|
||||
|
||||
- Download and install Android Studio from https://developer.android.com/studio.
|
||||
|
||||
- Get the latest pre-built OpenCV for Android release from https://github.com/opencv/opencv/releases and unpack it (for example, `opencv-3.4.3-android-sdk.zip`).
|
||||
- Get the latest pre-built OpenCV for Android release from https://github.com/opencv/opencv/releases and unpack it (for example, `opencv-3.4.5-android-sdk.zip`).
|
||||
|
||||
- Download MobileNet object detection model from https://github.com/chuanqi305/MobileNet-SSD. We need a configuration file `MobileNetSSD_deploy.prototxt` and weights `MobileNetSSD_deploy.caffemodel`.
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user