opencv/modules/imgcodecs/src
StefanBruens 8d78400052
Merge pull request #16494 from StefanBruens:jpeg2000_openjpeg_port
Jpeg2000 OpenJPEG port

* OpenJPEG based JPEG2000 decoder implementation

Currently, the following input color spaces and depth conversions are
supported:

- 8 bit -> 8 bit
- 16 bit -> 16 bit (IMREAD_UNCHANGED, IMREAD_ANYDEPTH)

- RGB(a) -> BGR
- RGBA -> BGRA (IMREAD_UNCHANGED)
- Y(a) -> Y(a) (IMREAD_ANYCOLOR, IMREAD_GRAY, IMREAD_UNCHANGED))
- YCC -> Y (IMREAD_GRAY)

* Check for OpenJPEG availability

This enables OpenJPEG based JPEG2000 imread support by default, which
can be disabled by -DWITH_OPENJPEG=OFF. In case OpenJPEG is enabled
and found, any checks for Jasper are skipped.

* Implement precision downscaling for precision > 8 without IMREAD_UNCHANGED

With IMREAD_UNCHANGED, values are kept from the input image, without it
components are downscaled to CV_8U range.

* Enable Jpeg2K tests when OpenJPEG is available

* Add support for some more color conversions

Support IMREAD_GRAY when input color space is RGB or unspecified.
Support YUV input color space for BGR output.

* fix: problems with unmanaged memory

* fix: CMake warning - HAVE_OPENJPEG is undefined

Removed trailing whitespaces

* fix: CMake find_package OpenJPEG add minimal version

* Basic JPEG2K encoder

Images with depth CV_8U and CV_16U are supported, with 1 to 4 channels.

* feature: Improved code for OpenJPEG2000 encoder/decoder

 - Removed code duplication
 - Added error handlers
 - Extracted functions

* feature: Update conversion openjpeg array from/to Mat

* feature: Extend ChannelsIterator to fulfill RandomAccessIterator named requirements

 - Removed channels split in copyFromMatImpl. With ChannelsIterator no allocations are performed.
 - Split whole loop into 2 parts in copyToMat -> where std::copy and std::transforms are called.

* fix: Applied review comments.

 - Changed `nullptr` in CV_LOG* functions to `NULL`
 - Added `falls through` comment in decoder color space `switch`
 - Added warning about unsupported parameters for the encoder

* feature: Added decode from in-memory buffers.

Co-authored-by: Vadim Levin <vadim.levin@xperience.ai>
2020-03-27 07:18:58 +00:00
..
bitstrm.cpp imgcodecs: fix RBaseStream::setPos() outside of current block 2019-03-31 12:55:32 +00:00
bitstrm.hpp imgcodecs: refactoring, improve code quality 2017-08-16 18:56:41 +03:00
exif.cpp fix exif bug 2019-08-05 16:41:07 +03:00
exif.hpp bug fix to Inconsistent comment for EXIF issue id #15706 stream added final 2020-02-28 15:01:17 +05:30
grfmt_base.cpp removed C API in the following modules: photo, video, imgcodecs, videoio (#13060) 2018-11-09 00:52:09 +03:00
grfmt_base.hpp imwrite for multipage images implemented 2018-02-20 19:08:45 +03:00
grfmt_bmp.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-15 11:23:46 +00:00
grfmt_bmp.hpp removed C API in the following modules: photo, video, imgcodecs, videoio (#13060) 2018-11-09 00:52:09 +03:00
grfmt_exr.cpp opencv: Use cv::AutoBuffer<>::data() 2018-07-04 19:11:29 +03:00
grfmt_exr.hpp imgcodecs: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
grfmt_gdal.cpp refactor: don't use CV_ErrorNoReturn() internally 2018-04-24 15:38:42 +03:00
grfmt_gdal.hpp imgcodecs: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
grfmt_gdcm.cpp GDCM: several improvements 2016-07-08 16:08:55 +03:00
grfmt_gdcm.hpp imgcodecs: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
grfmt_hdr.cpp Merge pull request #11417 from Turim:imgcodecs_cmake_decoders_customize_formats 2018-05-22 15:10:15 +00:00
grfmt_hdr.hpp Merge pull request #11417 from Turim:imgcodecs_cmake_decoders_customize_formats 2018-05-22 15:10:15 +00:00
grfmt_jpeg2000_openjpeg.cpp Merge pull request #16494 from StefanBruens:jpeg2000_openjpeg_port 2020-03-27 07:18:58 +00:00
grfmt_jpeg2000_openjpeg.hpp Merge pull request #16494 from StefanBruens:jpeg2000_openjpeg_port 2020-03-27 07:18:58 +00:00
grfmt_jpeg2000.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-03-15 22:42:57 +00:00
grfmt_jpeg2000.hpp imgcodecs: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
grfmt_jpeg.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-06 20:41:30 +00:00
grfmt_jpeg.hpp imgcodecs: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
grfmt_pam.cpp Fix modules/ typos 2019-08-16 17:34:29 +03:00
grfmt_pam.hpp Merge pull request #11417 from Turim:imgcodecs_cmake_decoders_customize_formats 2018-05-22 15:10:15 +00:00
grfmt_pfm.cpp Fix modules/ typos 2019-08-15 18:02:09 -04:00
grfmt_pfm.hpp Merge pull request #12192 from pasbi:pfm 2018-08-13 13:14:12 +03:00
grfmt_png.cpp Fix modules/ typos 2019-08-16 17:34:29 +03:00
grfmt_png.hpp imgcodecs: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
grfmt_pxm.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-10 20:50:26 +00:00
grfmt_pxm.hpp Merge pull request #11417 from Turim:imgcodecs_cmake_decoders_customize_formats 2018-05-22 15:10:15 +00:00
grfmt_sunras.cpp imgcodecs(sunras): avoid undefined shift 2019-04-02 18:38:01 +03:00
grfmt_sunras.hpp Merge pull request #11417 from Turim:imgcodecs_cmake_decoders_customize_formats 2018-05-22 15:10:15 +00:00
grfmt_tiff.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-25 18:32:44 +00:00
grfmt_tiff.hpp imgcodecs(tiff): sanitize tiff decoder 2019-04-04 14:16:53 +03:00
grfmt_webp.cpp Merge pull request #12971 from sturkmen72:upd_imgproc_hpp 2018-10-31 18:08:24 +03:00
grfmt_webp.hpp imgcodecs(webp): multiple fixes 2018-08-30 20:42:33 +00:00
grfmts.hpp Merge pull request #16494 from StefanBruens:jpeg2000_openjpeg_port 2020-03-27 07:18:58 +00:00
ios_conversions.mm Add export macro for ios conversion functions 2018-08-20 14:10:54 -07:00
loadsave.cpp Merge pull request #16494 from StefanBruens:jpeg2000_openjpeg_port 2020-03-27 07:18:58 +00:00
precomp.hpp move legacy C-API constants into separate files 2018-11-17 23:47:51 +00:00
rgbe.cpp Change program type in hdr format files to modern value: RADIANCE so 2019-12-17 20:17:32 -08:00
rgbe.hpp Extract imgcodecs module from highgui 2014-07-07 16:28:08 +04:00
utils.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-01-12 09:35:39 +00:00
utils.hpp imgcodecs(tiff): sanitize tiff decoder 2019-04-04 14:16:53 +03:00