├── .appveyor.yml ├── .ci ├── blacklist.supp └── get-boost.sh ├── .clang-tidy ├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── actions │ ├── docs-prerequisites │ │ └── action.yml │ ├── generate-doc │ │ ├── action.yml │ │ └── docs-config.sh │ └── setup-boost │ │ └── action.yml ├── labels.json └── workflows │ ├── ci.yml │ ├── coverage.yml │ └── docs.yaml ├── .gitignore ├── .markdownlint.json ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── RELEASES.md ├── build.jam ├── codecov.yml ├── conanfile.txt ├── doc ├── Jamfile ├── Makefile ├── README.md ├── _static │ ├── boost-gil.png │ ├── boost-gil.svg │ ├── boost.css │ ├── boost.png │ ├── doxygen.css │ ├── gil.png │ ├── gil.svg │ ├── home.png │ ├── logo.png │ ├── next.png │ ├── prev.png │ ├── style.css │ └── up.png ├── _templates │ └── layout.html ├── conf.py ├── design │ ├── basics.rst │ ├── channel.rst │ ├── color_base.rst │ ├── color_space.rst │ ├── concepts.rst │ ├── conclusions.rst │ ├── dynamic_image.rst │ ├── examples.rst │ ├── extending.rst │ ├── image.rst │ ├── image_view.rst │ ├── index.rst │ ├── metafunctions.rst │ ├── pixel.rst │ ├── pixel_iterator.rst │ ├── pixel_locator.rst │ ├── point.rst │ └── technicalities.rst ├── doxyfile ├── doxygen-boost.css ├── footer.html ├── header.html ├── histogram │ ├── create.rst │ ├── cumulative.rst │ ├── extend.rst │ ├── extension │ │ ├── index.rst │ │ ├── overview.rst │ │ └── std.rst │ ├── fill.rst │ ├── index.rst │ ├── limitations.rst │ ├── overview.rst │ ├── stl_compatibility.rst │ ├── subhistogram.rst │ └── utilities.rst ├── image_processing │ ├── Moravec-window-corner.png │ ├── Moravec-window-edge.png │ ├── affine-region-detectors.rst │ ├── basics.rst │ ├── contrast_enhancement │ │ ├── histogram_equalization.rst │ │ ├── histogram_matching.rst │ │ ├── index.rst │ │ └── overview.rst │ ├── index.rst │ └── overview.rst ├── images │ ├── gil.png │ ├── interleaved.jpg │ ├── mandel.jpg │ ├── monkey_steps.jpg │ ├── pixel_locator.gif │ └── planar.jpg ├── index.html ├── index.rst ├── installation.rst ├── io.rst ├── naming.rst ├── numeric.rst ├── reference.dox ├── requirements.txt ├── toolbox.rst └── tutorial │ ├── gradient.rst │ ├── histogram.rst │ └── video.rst ├── example ├── CMakeLists.txt ├── Jamfile ├── README.md ├── adaptive_histogram_equalization.cpp ├── adaptive_histogram_equalization.md ├── adaptive_threshold.cpp ├── adaptive_threshold.md ├── affine.cpp ├── affine.md ├── anisotropic_diffusion.cpp ├── anisotropic_diffusion.md ├── b2 │ ├── README.md │ └── user-config-windows-vcpkg.jam ├── clang-format │ ├── .clang-format │ └── README.md ├── cmake │ ├── CMakeSettings.json │ ├── README.md │ └── cmake-variants.yaml ├── convolution.cpp ├── convolution.md ├── convolve2d.cpp ├── convolve2d.md ├── dynamic_image.cpp ├── dynamic_image.md ├── harris.cpp ├── harris.md ├── hessian.cpp ├── hessian.md ├── histogram.cpp ├── histogram.md ├── histogram_equalization.cpp ├── histogram_equalization.md ├── histogram_matching.cpp ├── histogram_matching.md ├── hough_transform_circle.cpp ├── hough_transform_circle.md ├── hough_transform_line.cpp ├── hough_transform_line.md ├── hvstack.hpp ├── interleaved_ptr.cpp ├── interleaved_ptr.hpp ├── interleaved_ptr.md ├── interleaved_ref.hpp ├── mandelbrot.cpp ├── mandelbrot.md ├── morphology.cpp ├── morphology.md ├── morphology_original.png ├── packed_pixel.cpp ├── packed_pixel.md ├── rasterizer_circle.cpp ├── rasterizer_circle.md ├── rasterizer_ellipse.cpp ├── rasterizer_ellipse.md ├── rasterizer_line.cpp ├── rasterizer_line.md ├── resize.cpp ├── resize.md ├── sobel_scharr.cpp ├── sobel_scharr.md ├── test.jpg ├── test_adaptive.png ├── threshold.cpp ├── threshold.md ├── tutorial_histogram.cpp ├── tutorial_histogram.md ├── x_gradient.cpp └── x_gradient.md ├── include └── boost │ ├── gil.hpp │ └── gil │ ├── algorithm.hpp │ ├── bit_aligned_pixel_iterator.hpp │ ├── bit_aligned_pixel_reference.hpp │ ├── channel.hpp │ ├── channel_algorithm.hpp │ ├── channel_numeric_operations.hpp │ ├── cmyk.hpp │ ├── color_base.hpp │ ├── color_base_algorithm.hpp │ ├── color_convert.hpp │ ├── concepts.hpp │ ├── concepts │ ├── basic.hpp │ ├── channel.hpp │ ├── color.hpp │ ├── color_base.hpp │ ├── concept_check.hpp │ ├── detail │ │ ├── type_traits.hpp │ │ └── utility.hpp │ ├── dynamic_step.hpp │ ├── fwd.hpp │ ├── image.hpp │ ├── image_view.hpp │ ├── pixel.hpp │ ├── pixel_based.hpp │ ├── pixel_dereference.hpp │ ├── pixel_iterator.hpp │ ├── pixel_locator.hpp │ └── point.hpp │ ├── detail │ ├── is_channel_integral.hpp │ ├── math.hpp │ ├── mp11.hpp │ ├── std_common_type.hpp │ └── type_traits.hpp │ ├── device_n.hpp │ ├── dynamic_step.hpp │ ├── extension │ ├── dynamic_image │ │ ├── algorithm.hpp │ │ ├── any_image.hpp │ │ ├── any_image_view.hpp │ │ ├── apply_operation.hpp │ │ ├── dynamic_at_c.hpp │ │ ├── dynamic_image_all.hpp │ │ └── image_view_factory.hpp │ ├── histogram │ │ └── std.hpp │ ├── image_processing │ │ ├── diffusion.hpp │ │ ├── hough_parameter.hpp │ │ └── hough_transform.hpp │ ├── io │ │ ├── bmp.hpp │ │ ├── bmp │ │ │ ├── detail │ │ │ │ ├── is_allowed.hpp │ │ │ │ ├── read.hpp │ │ │ │ ├── reader_backend.hpp │ │ │ │ ├── scanline_read.hpp │ │ │ │ ├── supported_types.hpp │ │ │ │ ├── write.hpp │ │ │ │ └── writer_backend.hpp │ │ │ ├── old.hpp │ │ │ ├── read.hpp │ │ │ ├── tags.hpp │ │ │ └── write.hpp │ │ ├── jpeg.hpp │ │ ├── jpeg │ │ │ ├── detail │ │ │ │ ├── base.hpp │ │ │ │ ├── is_allowed.hpp │ │ │ │ ├── read.hpp │ │ │ │ ├── reader_backend.hpp │ │ │ │ ├── scanline_read.hpp │ │ │ │ ├── supported_types.hpp │ │ │ │ ├── write.hpp │ │ │ │ └── writer_backend.hpp │ │ │ ├── old.hpp │ │ │ ├── read.hpp │ │ │ ├── tags.hpp │ │ │ └── write.hpp │ │ ├── png.hpp │ │ ├── png │ │ │ ├── detail │ │ │ │ ├── base.hpp │ │ │ │ ├── is_allowed.hpp │ │ │ │ ├── read.hpp │ │ │ │ ├── reader_backend.hpp │ │ │ │ ├── scanline_read.hpp │ │ │ │ ├── supported_types.hpp │ │ │ │ ├── write.hpp │ │ │ │ └── writer_backend.hpp │ │ │ ├── old.hpp │ │ │ ├── read.hpp │ │ │ ├── tags.hpp │ │ │ └── write.hpp │ │ ├── pnm.hpp │ │ ├── pnm │ │ │ ├── detail │ │ │ │ ├── is_allowed.hpp │ │ │ │ ├── read.hpp │ │ │ │ ├── reader_backend.hpp │ │ │ │ ├── scanline_read.hpp │ │ │ │ ├── supported_types.hpp │ │ │ │ ├── write.hpp │ │ │ │ └── writer_backend.hpp │ │ │ ├── old.hpp │ │ │ ├── read.hpp │ │ │ ├── tags.hpp │ │ │ └── write.hpp │ │ ├── raw.hpp │ │ ├── raw │ │ │ ├── detail │ │ │ │ ├── device.hpp │ │ │ │ ├── is_allowed.hpp │ │ │ │ ├── read.hpp │ │ │ │ ├── reader_backend.hpp │ │ │ │ └── supported_types.hpp │ │ │ ├── read.hpp │ │ │ └── tags.hpp │ │ ├── targa.hpp │ │ ├── targa │ │ │ ├── detail │ │ │ │ ├── is_allowed.hpp │ │ │ │ ├── read.hpp │ │ │ │ ├── reader_backend.hpp │ │ │ │ ├── scanline_read.hpp │ │ │ │ ├── supported_types.hpp │ │ │ │ ├── write.hpp │ │ │ │ └── writer_backend.hpp │ │ │ ├── old.hpp │ │ │ ├── read.hpp │ │ │ ├── tags.hpp │ │ │ └── write.hpp │ │ ├── tiff.hpp │ │ └── tiff │ │ │ ├── detail │ │ │ ├── device.hpp │ │ │ ├── is_allowed.hpp │ │ │ ├── log.hpp │ │ │ ├── read.hpp │ │ │ ├── reader_backend.hpp │ │ │ ├── scanline_read.hpp │ │ │ ├── supported_types.hpp │ │ │ ├── write.hpp │ │ │ └── writer_backend.hpp │ │ │ ├── old.hpp │ │ │ ├── read.hpp │ │ │ ├── tags.hpp │ │ │ └── write.hpp │ ├── numeric │ │ ├── affine.hpp │ │ ├── algorithm.hpp │ │ ├── channel_numeric_operations.hpp │ │ ├── convolve.hpp │ │ ├── kernel.hpp │ │ ├── pixel_numeric_operations.hpp │ │ ├── resample.hpp │ │ └── sampler.hpp │ ├── rasterization │ │ ├── apply_rasterizer.hpp │ │ ├── circle.hpp │ │ ├── ellipse.hpp │ │ └── line.hpp │ └── toolbox │ │ ├── color_converters.hpp │ │ ├── color_converters │ │ ├── gray_to_rgba.hpp │ │ └── rgb_to_luminance.hpp │ │ ├── color_spaces.hpp │ │ ├── color_spaces │ │ ├── cmyka.hpp │ │ ├── gray_alpha.hpp │ │ ├── hsl.hpp │ │ ├── hsv.hpp │ │ ├── lab.hpp │ │ ├── xyz.hpp │ │ └── ycbcr.hpp │ │ ├── dynamic_images.hpp │ │ ├── image_types.hpp │ │ ├── image_types │ │ ├── indexed_image.hpp │ │ └── subchroma_image.hpp │ │ ├── metafunctions.hpp │ │ ├── metafunctions │ │ ├── channel_type.hpp │ │ ├── channel_view.hpp │ │ ├── get_num_bits.hpp │ │ ├── get_pixel_type.hpp │ │ ├── is_bit_aligned.hpp │ │ ├── is_homogeneous.hpp │ │ ├── is_similar.hpp │ │ └── pixel_bit_size.hpp │ │ └── toolbox.hpp │ ├── gray.hpp │ ├── histogram.hpp │ ├── image.hpp │ ├── image_processing │ ├── adaptive_histogram_equalization.hpp │ ├── convolve.hpp │ ├── filter.hpp │ ├── harris.hpp │ ├── hessian.hpp │ ├── histogram_equalization.hpp │ ├── histogram_matching.hpp │ ├── kernel.hpp │ ├── morphology.hpp │ ├── numeric.hpp │ ├── scaling.hpp │ └── threshold.hpp │ ├── image_view.hpp │ ├── image_view_factory.hpp │ ├── io │ ├── base.hpp │ ├── bit_operations.hpp │ ├── conversion_policies.hpp │ ├── detail │ │ ├── dynamic.hpp │ │ └── filesystem.hpp │ ├── device.hpp │ ├── error.hpp │ ├── get_read_device.hpp │ ├── get_reader.hpp │ ├── get_write_device.hpp │ ├── get_writer.hpp │ ├── io.hpp │ ├── make_backend.hpp │ ├── make_dynamic_image_reader.hpp │ ├── make_dynamic_image_writer.hpp │ ├── make_reader.hpp │ ├── make_scanline_reader.hpp │ ├── make_writer.hpp │ ├── path_spec.hpp │ ├── read_and_convert_image.hpp │ ├── read_and_convert_view.hpp │ ├── read_image.hpp │ ├── read_image_info.hpp │ ├── read_view.hpp │ ├── reader_base.hpp │ ├── row_buffer_helper.hpp │ ├── scanline_read_iterator.hpp │ ├── typedefs.hpp │ └── write_view.hpp │ ├── iterator_from_2d.hpp │ ├── locator.hpp │ ├── metafunctions.hpp │ ├── packed_pixel.hpp │ ├── pixel.hpp │ ├── pixel_iterator.hpp │ ├── pixel_iterator_adaptor.hpp │ ├── pixel_numeric_operations.hpp │ ├── planar_pixel_iterator.hpp │ ├── planar_pixel_reference.hpp │ ├── point.hpp │ ├── position_iterator.hpp │ ├── premultiply.hpp │ ├── promote_integral.hpp │ ├── rgb.hpp │ ├── rgba.hpp │ ├── step_iterator.hpp │ ├── typedefs.hpp │ ├── utilities.hpp │ └── virtual_locator.hpp ├── index.html ├── meta └── libraries.json ├── sublibs └── test ├── CMakeLists.txt ├── Jamfile ├── core ├── CMakeLists.txt ├── Jamfile ├── algorithm │ ├── CMakeLists.txt │ ├── Jamfile │ ├── extend_boundary.cpp │ ├── for_each_pixel.cpp │ ├── std_fill.cpp │ └── std_uninitialized_fill.cpp ├── channel │ ├── CMakeLists.txt │ ├── Jamfile │ ├── TODO.md │ ├── algorithm_channel_arithmetic.cpp │ ├── algorithm_channel_convert.cpp │ ├── algorithm_channel_invert.cpp │ ├── algorithm_channel_multiply.cpp │ ├── algorithm_channel_relation.cpp │ ├── channel_numeric_operations.cpp │ ├── channel_traits.cpp │ ├── concepts.cpp │ ├── is_channel_integral.cpp │ ├── packed_channel_value.cpp │ ├── scoped_channel_value.cpp │ ├── test_fixture.cpp │ └── test_fixture.hpp ├── color │ ├── CMakeLists.txt │ ├── Jamfile │ ├── color_spaces_are_compatible.cpp │ ├── concepts.cpp │ ├── default_color_converter_impl.cpp │ ├── default_color_converter_impl_fail.cpp │ └── default_color_converter_rgb_to_cmyk.cpp ├── color_base │ ├── CMakeLists.txt │ ├── Jamfile │ ├── concepts.cpp │ ├── homogeneous_color_base.cpp │ ├── static_transform.cpp │ ├── static_transform_gray_to_rgb_fail.cpp │ └── static_transform_rgb_to_cmyk_fail.cpp ├── histogram │ ├── CMakeLists.txt │ ├── Jamfile │ ├── access.cpp │ ├── constructor.cpp │ ├── cumulative.cpp │ ├── dimension.cpp │ ├── fill.cpp │ ├── hash_tuple.cpp │ ├── helpers.cpp │ ├── is_compatible.cpp │ ├── key.cpp │ ├── sub_histogram.cpp │ └── utilities.cpp ├── image │ ├── CMakeLists.txt │ ├── Jamfile │ ├── alignment.cpp │ ├── concepts.cpp │ ├── empty_dimensions.cpp │ ├── image.cpp │ └── test_fixture.hpp ├── image_processing │ ├── CMakeLists.txt │ ├── Jamfile │ ├── adaptive_he.cpp │ ├── box_filter.cpp │ ├── convolve.cpp │ ├── convolve_2d.cpp │ ├── convolve_cols.cpp │ ├── convolve_rows.cpp │ ├── harris.cpp │ ├── hessian.cpp │ ├── histogram_equalization.cpp │ ├── histogram_matching.cpp │ ├── kernel.cpp │ ├── kernel_1d_fixed_even_size_fail.cpp │ ├── kernel_fixed.cpp │ ├── lanczos_scaling.cpp │ ├── median_filter.cpp │ ├── morphology.cpp │ ├── simple_kernels.cpp │ ├── sobel_scharr.cpp │ ├── test_fixture.hpp │ ├── threshold_binary.cpp │ ├── threshold_color_spaces_not_compatible_fail.cpp │ ├── threshold_otsu.cpp │ └── threshold_truncate.cpp ├── image_view │ ├── CMakeLists.txt │ ├── Jamfile │ ├── axis_iterator.cpp │ ├── collection.cpp │ ├── concepts.cpp │ ├── derived_view_type.cpp │ ├── dynamic_step.cpp │ ├── is_1d_traversable.cpp │ ├── is_planar.cpp │ ├── iterator.cpp │ ├── planar_rgba_view.cpp │ ├── reverse_iterator.cpp │ ├── subimage_view.cpp │ ├── test_fixture.hpp │ ├── view_is_basic.cpp │ ├── view_is_mutable.cpp │ ├── view_is_step.cpp │ ├── view_type.cpp │ ├── view_type_from_pixel.cpp │ ├── x_iterator.cpp │ ├── xy_locator.cpp │ └── y_iterator.cpp ├── io │ ├── CMakeLists.txt │ ├── Jamfile │ └── path_spec.cpp ├── iterator │ ├── CMakeLists.txt │ ├── Jamfile │ ├── concepts.cpp │ ├── dynamic_step.cpp │ └── is_planar.cpp ├── locator │ ├── CMakeLists.txt │ ├── Jamfile │ ├── concepts.cpp │ └── dynamic_step.cpp ├── pixel │ ├── CMakeLists.txt │ ├── Jamfile │ ├── bit_aligned_pixel_reference.cpp │ ├── color_convert_cmyk.cpp │ ├── concepts.cpp │ ├── is_pixel.cpp │ ├── is_planar.cpp │ ├── num_channels.cpp │ ├── packed_pixel.cpp │ ├── pixel_numeric_operations.cpp │ ├── pixel_numeric_operations_float.cpp │ ├── pixel_reference_is_mutable.cpp │ ├── pixels_are_compatible.cpp │ ├── test_fixture.cpp │ └── test_fixture.hpp ├── point │ ├── CMakeLists.txt │ ├── Jamfile │ ├── concepts.cpp │ ├── multiply_by_non_arithmetic_fail.cpp │ ├── point.cpp │ └── test_fixture.hpp ├── promote_integral.cpp ├── test_fixture.cpp ├── test_fixture.hpp └── virtual_2d_locator │ ├── CMakeLists.txt │ ├── Jamfile │ ├── is_2d_traversable.cpp │ └── test_fixture.hpp ├── extension ├── CMakeLists.txt ├── Jamfile ├── dynamic_image │ ├── CMakeLists.txt │ ├── Jamfile │ ├── algorithm │ │ ├── Jamfile │ │ ├── copy_and_convert_pixels.cpp │ │ ├── copy_pixels.cpp │ │ ├── equal_pixels.cpp │ │ ├── fill_pixels.cpp │ │ └── for_each_pixel.cpp │ ├── any_image.cpp │ ├── any_image_view.cpp │ ├── image_view_factory.cpp │ ├── subimage_view.cpp │ └── test_fixture.hpp ├── histogram │ ├── CMakeLists.txt │ ├── Jamfile │ └── histogram.cpp ├── image_processing │ ├── CMakeLists.txt │ ├── Jamfile │ ├── anisotropic_diffusion.cpp │ ├── hough_circle_transform.cpp │ ├── hough_line_transform.cpp │ └── hough_parameter.cpp ├── io │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Jamfile │ ├── bmp │ │ ├── Jamfile │ │ ├── bmp_make.cpp │ │ ├── bmp_old_test.cpp │ │ ├── bmp_read_test.cpp │ │ ├── bmp_test.cpp │ │ └── bmp_write_test.cpp │ ├── cmp_view.hpp │ ├── color_space_write_test.hpp │ ├── images │ │ ├── bmp │ │ │ ├── g01bg.bmp │ │ │ ├── g01bw.bmp │ │ │ ├── g01p1.bmp │ │ │ ├── g01wb.bmp │ │ │ ├── g04.bmp │ │ │ ├── g04p4.bmp │ │ │ ├── g04rle.bmp │ │ │ ├── g08.bmp │ │ │ ├── g08offs.bmp │ │ │ ├── g08os2.bmp │ │ │ ├── g08p256.bmp │ │ │ ├── g08p64.bmp │ │ │ ├── g08pi256.bmp │ │ │ ├── g08pi64.bmp │ │ │ ├── g08res11.bmp │ │ │ ├── g08res21.bmp │ │ │ ├── g08res22.bmp │ │ │ ├── g08rle.bmp │ │ │ ├── g08s0.bmp │ │ │ ├── g08w124.bmp │ │ │ ├── g08w125.bmp │ │ │ ├── g08w126.bmp │ │ │ ├── g16bf555.bmp │ │ │ ├── g16bf565.bmp │ │ │ ├── g16def555.bmp │ │ │ ├── g24.bmp │ │ │ ├── g32bf.bmp │ │ │ ├── g32def.bmp │ │ │ ├── readme.txt │ │ │ └── test.bmp │ │ ├── jpeg │ │ │ ├── EddDawson │ │ │ │ └── 36dpi.jpg │ │ │ └── test.jpg │ │ ├── png │ │ │ ├── EddDawson │ │ │ │ └── 36dpi.png │ │ │ ├── PngSuite │ │ │ │ ├── readme.txt │ │ │ │ ├── tbbn0g04.png │ │ │ │ ├── tbbn2c16.png │ │ │ │ ├── tbbn3p08.png │ │ │ │ ├── tbgn2c16.png │ │ │ │ ├── tbgn3p08.png │ │ │ │ ├── tbrn2c08.png │ │ │ │ ├── tbwn0g16.png │ │ │ │ ├── tm3n3p02.png │ │ │ │ └── tp1n3p08.png │ │ │ ├── grayscale-with-tRNS-chunk.png │ │ │ └── test.png │ │ ├── pnm │ │ │ ├── p1.pnm │ │ │ ├── p2.pnm │ │ │ ├── p3.pnm │ │ │ ├── p4.pnm │ │ │ ├── p5.pnm │ │ │ ├── p6.pnm │ │ │ └── rgb.pnm │ │ ├── raw │ │ │ ├── RAW_CANON_D30_SRGB.CRW │ │ │ └── readme.txt │ │ ├── readme.md │ │ ├── targa │ │ │ ├── 24BPP_compressed.tga │ │ │ ├── 24BPP_compressed_ul_origin.tga │ │ │ ├── 24BPP_uncompressed.tga │ │ │ ├── 24BPP_uncompressed_ul_origin.tga │ │ │ ├── 32BPP_compressed.tga │ │ │ ├── 32BPP_compressed_ul_origin.tga │ │ │ ├── 32BPP_uncompressed.tga │ │ │ ├── 32BPP_uncompressed_ul_origin.tga │ │ │ └── fileformat_info │ │ │ │ └── readme.txt │ │ └── tiff │ │ │ ├── graphicmagick │ │ │ └── readme.txt │ │ │ ├── libtiffpic │ │ │ └── readme.txt │ │ │ └── test.tif │ ├── jpeg │ │ ├── Jamfile │ │ ├── jpeg_old_test.cpp │ │ ├── jpeg_read_test.cpp │ │ ├── jpeg_test.cpp │ │ └── jpeg_write_test.cpp │ ├── mandel_view.hpp │ ├── output │ │ └── .keep │ ├── paths.hpp │ ├── png │ │ ├── Jamfile │ │ ├── png_file_format_test.cpp │ │ ├── png_old_test.cpp │ │ ├── png_read_test.cpp │ │ ├── png_test.cpp │ │ └── png_write_test.cpp │ ├── pnm │ │ ├── Jamfile │ │ ├── pnm_old_test.cpp │ │ ├── pnm_read_test.cpp │ │ ├── pnm_test.cpp │ │ └── pnm_write_test.cpp │ ├── raw │ │ ├── Jamfile │ │ └── raw_test.cpp │ ├── scanline_read_test.hpp │ ├── simple_all_formats.cpp │ ├── subimage_test.hpp │ ├── targa │ │ ├── Jamfile │ │ ├── targa_old_test.cpp │ │ ├── targa_read_test.cpp │ │ ├── targa_test.cpp │ │ └── targa_write_test.cpp │ └── tiff │ │ ├── Jamfile │ │ ├── tiff_file_format_test.cpp │ │ ├── tiff_old_test.cpp │ │ ├── tiff_subimage_test.cpp │ │ ├── tiff_test.cpp │ │ ├── tiff_tiled_float_test.cpp │ │ ├── tiff_tiled_minisblack_test_1-10.cpp │ │ ├── tiff_tiled_minisblack_test_11-20.cpp │ │ ├── tiff_tiled_minisblack_test_21-31_32-64.cpp │ │ ├── tiff_tiled_minisblack_write_test_1-10.cpp │ │ ├── tiff_tiled_minisblack_write_test_11-20.cpp │ │ ├── tiff_tiled_minisblack_write_test_21-31_32-64.cpp │ │ ├── tiff_tiled_palette_test_1-8.cpp │ │ ├── tiff_tiled_palette_test_8-16.cpp │ │ ├── tiff_tiled_palette_write_test_1-8.cpp │ │ ├── tiff_tiled_palette_write_test_8-16.cpp │ │ ├── tiff_tiled_read_macros.hpp │ │ ├── tiff_tiled_rgb_contig_test_1-10.cpp │ │ ├── tiff_tiled_rgb_contig_test_11-20.cpp │ │ ├── tiff_tiled_rgb_contig_test_21-31_32_64.cpp │ │ ├── tiff_tiled_rgb_contig_write_test_1-10.cpp │ │ ├── tiff_tiled_rgb_contig_write_test_11-20.cpp │ │ ├── tiff_tiled_rgb_contig_write_test_21-31_32_64.cpp │ │ ├── tiff_tiled_rgb_planar_test_1-10.cpp │ │ ├── tiff_tiled_rgb_planar_test_11-20.cpp │ │ ├── tiff_tiled_rgb_planar_test_21-31_32_64.cpp │ │ ├── tiff_tiled_test.cpp │ │ ├── tiff_tiled_write_macros.hpp │ │ └── tiff_write_test.cpp ├── numeric │ ├── CMakeLists.txt │ ├── Jamfile │ ├── matrix3x2.cpp │ └── resample.cpp ├── rasterization │ ├── CMakeLists.txt │ ├── Jamfile │ ├── apply_rasterizer.cpp │ ├── circle.cpp │ ├── ellipse.cpp │ └── line.cpp └── toolbox │ ├── CMakeLists.txt │ ├── Jamfile │ ├── channel_type.cpp │ ├── channel_view.cpp │ ├── color_convert_cmyka.cpp │ ├── color_convert_gray.cpp │ ├── color_convert_gray_alpha.cpp │ ├── color_convert_hsl.cpp │ ├── color_convert_hsv.cpp │ ├── color_convert_lab.cpp │ ├── color_convert_luminance.cpp │ ├── color_convert_rgb.cpp │ ├── color_convert_xyz.cpp │ ├── get_num_bits.cpp │ ├── get_pixel_type.cpp │ ├── indexed_image.cpp │ ├── is_bit_aligned.cpp │ ├── is_homogeneous.cpp │ ├── pixel_bit_size.cpp │ └── subchroma_image.cpp ├── header ├── CMakeLists.txt └── main.cpp ├── legacy ├── CMakeLists.txt ├── Jamfile ├── README.md ├── channel.cpp ├── error_if.cpp ├── gil_reference_checksums.txt ├── image.cpp ├── performance.cpp ├── pixel.cpp ├── pixel_iterator.cpp ├── recreate_image.cpp └── sample_image.cpp ├── test_utility_output_stream.cpp ├── test_utility_output_stream.hpp └── test_utility_with_tolerance.hpp /.clang-tidy: -------------------------------------------------------------------------------- 1 | --- 2 | Checks: '-*,modernize-use-nullptr,modernize-use-override,modernize-use-using' 3 | WarningsAsErrors: '' 4 | HeaderFilterRegex: 'boost\/gil\/.*' 5 | AnalyzeTemporaryDtors: false 6 | FormatStyle: mozilla 7 | User: gil-developers 8 | CheckOptions: 9 | - key: modernize-use-nullptr.NullMacros 10 | value: 'NULL' 11 | ... 12 | 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | # 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | guidelines = 100 8 | indent_size = 4 9 | indent_style = space 10 | max_line_length = 100 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | 14 | [*.{cpp,hpp}] 15 | guidelines = 100 16 | indent_size = 4 17 | indent_style = space 18 | max_line_length = 100 19 | trim_trailing_whitespace = true 20 | insert_final_newline = true 21 | 22 | [*.{md,rst}] 23 | guidelines = 78 24 | indent_size = 2 25 | indent_style = space 26 | max_line_length = 79 27 | trim_trailing_whitespace = false 28 | insert_final_newline = true 29 | 30 | [{Jamfile*,CMakeLists.txt,CMakeSettings.json,*.cmake}] 31 | guidelines = 100 32 | indent_size = 2 33 | indent_style = space 34 | max_line_length = 100 35 | trim_trailing_whitespace = true 36 | insert_final_newline = true 37 | 38 | [*.yml] 39 | guidelines = 100 40 | indent_size = 2 41 | indent_style = space 42 | insert_final_newline = true 43 | max_line_length = 100 44 | trim_trailing_whitespace = true 45 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Actual behavior 11 | 12 | 13 | 14 | 15 | ### Expected behavior 16 | 17 | 18 | 19 | ### C++ Minimal Working Example 20 | 21 | 22 | 23 | ```cpp 24 | #include 25 | namespace gil = boost::gil; 26 | int main 27 | { 28 | // your code 29 | } 30 | ``` 31 | 32 | ### Environment 33 | 34 | 35 | 36 | - Compiler version: 37 | - Build settings: 38 | - Version (Git ref or ``): 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Is your feature request related to a problem? Please describe. 11 | 12 | 13 | 14 | ### Describe the solution you'd like 15 | 16 | 17 | 18 | #### C++ Example 19 | 20 | 21 | 22 | ```cpp 23 | #include 24 | namespace gil = boost::gil; 25 | int main 26 | { 27 | // your code 28 | } 29 | ``` 30 | 31 | ### Describe alternatives you've considered 32 | 33 | 34 | 35 | ### Additional context 36 | 37 | 38 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Description 4 | 5 | 6 | 7 | ### References 8 | 9 | 10 | 11 | ### Tasklist 12 | 13 | 14 | 15 | - [ ] Add test case(s) 16 | - [ ] Ensure all CI builds pass 17 | - [ ] Review and approve 18 | -------------------------------------------------------------------------------- /.github/actions/docs-prerequisites/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Get Docs Prerequisites' 2 | description: 'Downloads all the necessary packages for building documentation' 3 | runs: 4 | using: composite 5 | steps: 6 | - run: sudo apt-get install doxygen python3 python3-pip python3-setuptools python3-sphinx 7 | shell: bash 8 | -------------------------------------------------------------------------------- /.github/actions/generate-doc/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Generate Doc' 2 | description: 'Runs b2 on lib/gil/doc to generate documentation' 3 | runs: 4 | using: composite 5 | steps: 6 | - run: | 7 | echo "using doxygen ;" > ~/user-config.jam 8 | cd ../boost-root/libs 9 | ../b2 gil/doc 10 | cd gil 11 | chmod +x $GITHUB_WORKSPACE/.github/actions/generate-doc/docs-config.sh 12 | $GITHUB_WORKSPACE/.github/actions/generate-doc/docs-config.sh 13 | shell: bash 14 | -------------------------------------------------------------------------------- /.github/actions/generate-doc/docs-config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e # Exit with Non Zero exit Code 3 | 4 | mkdir temp-doc 5 | cd temp-doc 6 | 7 | git init 8 | 9 | 10 | git remote add upstream "https://github.com/boostorg/gil.git" 11 | 12 | git fetch upstream 13 | git switch gh-pages 14 | 15 | 16 | if [ "${GITHUB_REF##*/}" = develop ]; then 17 | # Only updates develop directory and keeps others intact 18 | rm -r develop 19 | mkdir -p develop/doc 20 | cp ../index.html develop/ 21 | cp ../doc/index.html develop/doc 22 | cp -a ../doc/html develop/doc/ 23 | else 24 | # main branch 25 | rm index.html 26 | rm -r html 27 | cp ../doc/index.html . 28 | cp -r ../doc/html . 29 | fi 30 | 31 | # Remove version control 32 | rm -rf .git -------------------------------------------------------------------------------- /.github/actions/setup-boost/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Setup-Boost' 2 | description: 'Downloads and sets up the necessary dependencies of Boost' 3 | runs: 4 | using: composite 5 | steps: 6 | - run: | 7 | REF=${GITHUB_BASE_REF:-$GITHUB_REF} 8 | BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true 9 | cd .. 10 | git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root 11 | cd boost-root 12 | cp -r $GITHUB_WORKSPACE/* libs/gil 13 | git submodule update --init tools/boostdep 14 | python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" gil 15 | ./bootstrap.sh 16 | ./b2 -d0 headers 17 | shell: bash 18 | -------------------------------------------------------------------------------- /.github/workflows/docs.yaml: -------------------------------------------------------------------------------- 1 | name: Docs-Build 2 | on: 3 | push: 4 | branches: 5 | - master 6 | - develop 7 | 8 | jobs: 9 | build-docs: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: ./.github/actions/docs-prerequisites 14 | - uses: ./.github/actions/setup-boost 15 | - uses: ./.github/actions/generate-doc 16 | - name: Deploy 17 | uses: peaceiris/actions-gh-pages@v3 18 | with: 19 | github_token: ${{ secrets.GITHUB_TOKEN }} 20 | publish_dir: ../boost-root/libs/gil/temp-doc 21 | user_name: 'github-actions[bot]' 22 | user_email: 'github-actions[bot]@users.noreply.github.com' 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | *.log 4 | 5 | # Boost.Build 6 | stdcerr 7 | /doc/*build* 8 | /io/output 9 | 10 | # Documentation and Sphinx 11 | doc/html 12 | doc/warnings.txt 13 | 14 | # Visual Studio (Code) 15 | /.vs 16 | .vscode 17 | *.code-workspace 18 | out 19 | 20 | # Clang/LLVM 21 | /.clang-format 22 | 23 | # CMake 24 | /*build* 25 | /cmake-build-debug/ 26 | /cmake-build-release/ 27 | /CMakeSettings.json 28 | /cmake-variants.yaml 29 | 30 | # JetBrains 31 | /.idea 32 | 33 | # Python 34 | .venv* 35 | .env* 36 | 37 | # Conan 38 | conaninfo.txt 39 | graph_info.json 40 | 41 | # clangd 42 | compile_commands.json 43 | .clangd/ 44 | 45 | !build.jam 46 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "MD013": false, 4 | "MD026": false, 5 | "MD024": false, 6 | "MD029": {"style": "ordered"}, 7 | "MD041": false 8 | } 9 | -------------------------------------------------------------------------------- /build.jam: -------------------------------------------------------------------------------- 1 | # Copyright René Ferdinand Rivera Morell 2023-2024 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # (See accompanying file LICENSE_1_0.txt or copy at 4 | # http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | require-b2 5.2 ; 7 | 8 | constant boost_dependencies : 9 | /boost/assert//boost_assert 10 | /boost/concept_check//boost_concept_check 11 | /boost/config//boost_config 12 | /boost/container_hash//boost_container_hash 13 | /boost/core//boost_core 14 | /boost/filesystem//boost_filesystem 15 | /boost/integer//boost_integer 16 | /boost/iterator//boost_iterator 17 | /boost/mp11//boost_mp11 18 | /boost/preprocessor//boost_preprocessor 19 | /boost/type_traits//boost_type_traits 20 | /boost/variant2//boost_variant2 ; 21 | 22 | project /boost/gil 23 | : common-requirements 24 | include 25 | ; 26 | 27 | explicit 28 | [ alias boost_gil : : : : $(boost_dependencies) ] 29 | [ alias all : boost_gil example test ] 30 | ; 31 | 32 | call-if : boost-library gil 33 | ; 34 | 35 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: 2 | layout: "diff" 3 | behavior: default 4 | branches: 5 | - master 6 | - develop 7 | require_changes: true 8 | -------------------------------------------------------------------------------- /conanfile.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018-2022 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | [requires] 9 | libjpeg/9d 10 | libpng/1.6.37 11 | libtiff/4.1.0 12 | 13 | [generators] 14 | CMakeDeps 15 | CMakeToolchain 16 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | # Boost.GIL Documentation 2 | 3 | A simple guide about writing and building documentation for Boost.GIL. 4 | 5 | ## Prerequisites 6 | 7 | - Python 3 8 | - Install [Sphinx](https://www.sphinx-doc.org/en/master/index.html) (see `requirements.txt`) 9 | - Install [Doxygen](http://www.doxygen.org) 10 | 11 | 12 | ## Installation 13 | 14 | Create Python virtual environment: 15 | 16 | ```console 17 | $ python3 -m venv .venv 18 | $ source ~/.venv/bin/activate 19 | ``` 20 | 21 | Install Sphinx and Sphinx extensions: 22 | 23 | ```console 24 | (.venv)$ cd boost-root 25 | (.venv)$ pip install -r libs/gil/doc/requirements.txt 26 | ``` 27 | 28 | ## Build 29 | 30 | ```console 31 | $ echo "using doxygen ;" > ~/user-config.jam 32 | $ cd boost-root 33 | $ b2 libs/gil/doc 34 | ``` 35 | -------------------------------------------------------------------------------- /doc/_static/boost-gil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/_static/boost-gil.png -------------------------------------------------------------------------------- /doc/_static/boost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/_static/boost.png -------------------------------------------------------------------------------- /doc/_static/doxygen.css: -------------------------------------------------------------------------------- 1 | .headertitle 2 | { 3 | color: #00507f; 4 | font-size: 200%; 5 | } 6 | -------------------------------------------------------------------------------- /doc/_static/gil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/_static/gil.png -------------------------------------------------------------------------------- /doc/_static/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/_static/home.png -------------------------------------------------------------------------------- /doc/_static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/_static/logo.png -------------------------------------------------------------------------------- /doc/_static/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/_static/next.png -------------------------------------------------------------------------------- /doc/_static/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/_static/prev.png -------------------------------------------------------------------------------- /doc/_static/style.css: -------------------------------------------------------------------------------- 1 | @import url(boost.css); 2 | 3 | .header h1 a 4 | { 5 | color: #00507f; 6 | font-size: 200%; 7 | font-style: italic; 8 | } 9 | .header h3 { margin: 1px;} 10 | #contents 11 | { 12 | /* border-bottom: solid thin black;*/ 13 | } 14 | 15 | .highlight 16 | { 17 | border: 1px solid #dcdcdc; 18 | background-color: inherit; 19 | padding: 0 1em; 20 | margin: 0 5em; 21 | } 22 | #searchbox 23 | { 24 | float: right; 25 | width: auto; 26 | margin: 0 2em; 27 | } 28 | 29 | .admonition-title { font-weight: bold;} 30 | .toctree-wrapper 31 | { 32 | display: inline-block; 33 | border: 1px solid #dcdcdc; 34 | padding: 1em; 35 | margin: 0 2em; 36 | } 37 | .toctree-wrapper .caption, 38 | .toctree-wrapper .topic-title { font-weight: bold;} 39 | 40 | .footer 41 | { 42 | text-align: left; 43 | font-size: 80%; 44 | } 45 | -------------------------------------------------------------------------------- /doc/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/_static/up.png -------------------------------------------------------------------------------- /doc/design/index.rst: -------------------------------------------------------------------------------- 1 | Design Guide 2 | ============ 3 | 4 | The sections listed below are dedicated to describe the design, 5 | structure and basic elements of the Generic Image Library (GIL). 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | :caption: Table of Contents 10 | 11 | basics 12 | concepts 13 | point 14 | channel 15 | color_space 16 | color_base 17 | pixel 18 | pixel_iterator 19 | pixel_locator 20 | image_view 21 | image 22 | dynamic_image 23 | metafunctions 24 | examples 25 | technicalities 26 | extending 27 | conclusions 28 | -------------------------------------------------------------------------------- /doc/doxygen-boost.css: -------------------------------------------------------------------------------- 1 | @import url('../_static/style.css'); 2 | 3 | address.footer { text-align: center; } 4 | -------------------------------------------------------------------------------- /doc/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/histogram/create.rst: -------------------------------------------------------------------------------- 1 | .. _create_histogram: 2 | 3 | Create a histogram 4 | ================== 5 | 6 | **Method 1** - Using the histogram constructor 7 | 8 | Syntax:: 9 | 10 | histogram 11 | 12 | ``Type1`` .. ``TypeN`` correspond to the axis type of the N axes in the histogram 13 | 14 | Example: If we want a 3D histogram of Axis1 of type ``int``, Axis2 of type ``float`` and Axis3 of type ``std::string`` 15 | we would do it this way:: 16 | 17 | histogram h; 18 | 19 | And done. 20 | 21 | 22 | **Method 2** (TODO) - Using make_histogram() 23 | 24 | There is an alternative to create the histogram directly from 25 | a GIL image view. 26 | 27 | This should be the preferred over method-1 when creating 28 | histogram with GIL images, since it creates a histogram with axes configured 29 | to match the GIL image. 30 | 31 | Also it is easier than method-1. 32 | 33 | Syntax:: 34 | 35 | auto h = make_histogram(view(image)); 36 | 37 | where ``image`` could be a ``gray8_image_t``/``rgb8_image_t`` object read from source. 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /doc/histogram/cumulative.rst: -------------------------------------------------------------------------------- 1 | .. _cumulative_histogram: 2 | 3 | Making a cumulative histogram 4 | ============================= 5 | 6 | Overview 7 | -------- 8 | 9 | A cumulative histogram is a histogram in which each bin stores the count / frequency of itself 10 | as well as all the bins with keys 'smaller' than the particular bin. 11 | As such, a notion of ordering among its keys should be existent in the histogram. 12 | 13 | The GIL histogram class has the ability to convert itself into its cumulative version. 14 | 15 | Since the container needs to first get an ordering 16 | over the keys a key sorting takes place before calculating the cumulative histogram. 17 | 18 | Example: 19 | 20 | .. code-block:: cpp 21 | 22 | histogram h; 23 | /* 24 | Fill histogram ... 25 | */ 26 | auto h1 = cumulative_histogram(h); 27 | 28 | Tip: *In case you need to store the cumulative histogram elsewhere, consider creating a copy of the histogram 29 | and then call the function*. -------------------------------------------------------------------------------- /doc/histogram/extension/index.rst: -------------------------------------------------------------------------------- 1 | Extensions 2 | ========== 3 | 4 | The GIL documentation sections listed below are dedicated to describe the 5 | usage of external containers as histograms for GIL images. 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | :caption: Table of Contents 10 | 11 | overview 12 | std 13 | -------------------------------------------------------------------------------- /doc/histogram/extension/overview.rst: -------------------------------------------------------------------------------- 1 | Overview 2 | ======== 3 | 4 | .. contents:: 5 | :local: 6 | :depth: 1 7 | 8 | Description 9 | ----------- 10 | Apart from the default class supplied by Boost.GIL, there are also provisions to 11 | use external containers like from std::vector, std::map, boost::histogram etc. These 12 | are provided as extensions. 13 | 14 | 15 | Extensions 16 | ---------- 17 | Currently the following are available: 18 | #. std::vector (1D histogram support) 19 | #. std::map (1D histogram support) 20 | #. std::array (1D histogram support) 21 | #. std::unordered_map (1D histogram support) 22 | #. boost::histogram 23 | 24 | 25 | Adding an external container 26 | ---------------------------- 27 | The workflow should be: 28 | #. Provide overloads for fill_histogram(must), make_histogram(optional) etc. in a new file preferably named after the container type in extensions/histogram/. 29 | #. Add tests to test/extensions/histogram. 30 | #. Add docs to docs/histogram/extensions. 31 | #. Other cmake, Jamfile, config etc. file changes. 32 | 33 | -------------------------------------------------------------------------------- /doc/histogram/extension/std.rst: -------------------------------------------------------------------------------- 1 | .. _std: 2 | 3 | STD extension 4 | ============= 5 | 6 | Supported Types: 7 | ---------------- 8 | 9 | #. std\:\:vector (1D) 10 | #. std\:\:map (1D) 11 | #. std\:\:unordered_map (1D) 12 | #. std\:\:array (1D) 13 | 14 | 15 | Usage 16 | ----- 17 | 18 | #. **fill_histogram()** 19 | 20 | .. code-block:: cpp 21 | 22 | // Demo for std::vector 23 | std::vector v; 24 | gil::gray8_image_t img; 25 | /* 26 | Fill image ... 27 | */ 28 | gil::fill_histogram(view(img), v, false); 29 | 30 | #. **cumulative_histogram()** 31 | 32 | .. code-block:: cpp 33 | 34 | // Demo for std::vector 35 | std::vector v; 36 | /* 37 | Fill vector... 38 | */ 39 | gil::cumulative_histogram(v); 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /doc/histogram/index.rst: -------------------------------------------------------------------------------- 1 | Histogram 2 | ========= 3 | 4 | The GIL documentation sections listed below are dedicated to describe the 5 | histogram class and functions used in many image processing algorithms. 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | :caption: Table of Contents 10 | 11 | overview 12 | create 13 | fill 14 | subhistogram 15 | cumulative 16 | stl_compatibility 17 | utilities 18 | extend 19 | limitations 20 | extension/index 21 | -------------------------------------------------------------------------------- /doc/histogram/limitations.rst: -------------------------------------------------------------------------------- 1 | .. _limitations: 2 | 3 | Limitations 4 | =========== 5 | 6 | *TODO* -------------------------------------------------------------------------------- /doc/histogram/overview.rst: -------------------------------------------------------------------------------- 1 | Overview 2 | ======== 3 | 4 | .. contents:: 5 | :local: 6 | :depth: 1 7 | 8 | Description 9 | ----------- 10 | 11 | The histogram class is built on top of std::unordered_map to keep it compatible with other 12 | STL algorithms. It can support any number of axes (known at compile time i.e. during class 13 | instantiation). Suitable conversion routines from GIL image constructs to the histogram bin 14 | key are shipped with the class itself. 15 | 16 | 17 | Tutorials 18 | --------- 19 | The following flow is recommended: 20 | #. :ref:`create_histogram` 21 | #. :ref:`fill_it` 22 | #. :ref:`sub_histogram` 23 | #. :ref:`cumulative_histogram` 24 | #. :ref:`stl_compatibility` 25 | #. :ref:`extend_support` 26 | #. :ref:`limitations` 27 | 28 | .. note:: To try out these tutorials you need to get a clone of the repository, since it is not yet released. 29 | -------------------------------------------------------------------------------- /doc/histogram/stl_compatibility.rst: -------------------------------------------------------------------------------- 1 | .. _stl_compatibility: 2 | 3 | STL compatibility 4 | ================= 5 | 6 | *TODO* -------------------------------------------------------------------------------- /doc/histogram/utilities.rst: -------------------------------------------------------------------------------- 1 | .. _utilities: 2 | 3 | Utilities 4 | ========= 5 | 6 | *TODO* -------------------------------------------------------------------------------- /doc/image_processing/Moravec-window-corner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/image_processing/Moravec-window-corner.png -------------------------------------------------------------------------------- /doc/image_processing/Moravec-window-edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/image_processing/Moravec-window-edge.png -------------------------------------------------------------------------------- /doc/image_processing/contrast_enhancement/index.rst: -------------------------------------------------------------------------------- 1 | Contrast Enhancement 2 | ==================== 3 | 4 | The GIL documentation sections listed below are dedicated to describe image 5 | processing algorithms used for contrast enhancement. 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | :caption: Table of Contents 10 | 11 | overview -------------------------------------------------------------------------------- /doc/image_processing/contrast_enhancement/overview.rst: -------------------------------------------------------------------------------- 1 | Overview 2 | ======== 3 | 4 | Contrast Enhancement is a significant part of image processing algorithms. Too dark or too 5 | light images don't look good to the human eyes. Hence while the primary focus of these 6 | algorithms is to enhance visual beauty, some applications of this in medical research is also 7 | prevalent. 8 | 9 | We have a few contrast enhancement algorithms in the GIL image processing suite as well. 10 | These include : 11 | #. :ref:`he` 12 | #. :ref:`hm` 13 | #. :ref:`ahe` 14 | #. Linear and Non-Linear Contrast stretching 15 | 16 | -------------------------------------------------------------------------------- /doc/image_processing/index.rst: -------------------------------------------------------------------------------- 1 | Image Processing 2 | ================ 3 | 4 | The GIL documentation sections listed below are dedicated to describe the library 5 | features, structures and algorithms, for image processing and analysis. 6 | 7 | .. toctree:: 8 | :maxdepth: 2 9 | :caption: Table of Contents 10 | 11 | overview 12 | basics 13 | affine-region-detectors 14 | contrast_enhancement/index 15 | 16 | -------------------------------------------------------------------------------- /doc/image_processing/overview.rst: -------------------------------------------------------------------------------- 1 | Overview 2 | ======== 3 | 4 | Development of the image processing features was initiated during two Boost 5 | projects run in frame of the Google Summer of Code 2019: 6 | 7 | - `Image Processing Algorithms `_ 8 | - `Fundamentals of epipolar geometry `_ 9 | 10 | The image processing features were first released with Boost 1.72. 11 | -------------------------------------------------------------------------------- /doc/images/gil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/images/gil.png -------------------------------------------------------------------------------- /doc/images/interleaved.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/images/interleaved.jpg -------------------------------------------------------------------------------- /doc/images/mandel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/images/mandel.jpg -------------------------------------------------------------------------------- /doc/images/monkey_steps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/images/monkey_steps.jpg -------------------------------------------------------------------------------- /doc/images/pixel_locator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/images/pixel_locator.gif -------------------------------------------------------------------------------- /doc/images/planar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/doc/images/planar.jpg -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Automatic redirection failed, please go to 7 | html/index.html 8 | 9 | 10 | -------------------------------------------------------------------------------- /doc/installation.rst: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | The latest version of Boost.GIL can be downloaded from https://github.com/boostorg/gil. 5 | 6 | The Boost.GIL is a header-only library. Meaning, it consists of header files only, 7 | it does not require Boost to be built and it does not require any libraries 8 | to link against. 9 | 10 | .. note:: 11 | 12 | The exception to dependencies-free rule of GIL is the I/O extension 13 | which requires client libraries implementing popular image formats 14 | like libpng, libjpeg, etc. 15 | 16 | In order to use Boost.GIL, including ``boost/gil.hpp`` and telling your compiler 17 | where to find Boost and GIL headers should be sufficient for most projects. 18 | 19 | Compiling 20 | --------- 21 | 22 | The Boost.GIL library source code should successfully compile with any 23 | compiler with complete C++14 support. 24 | 25 | .. note:: 26 | 27 | Boost.GIL requires C++14 compiler since ince Boost 1.80. 28 | 29 | For the actual list of currently tested compilers, check results of the library CI 30 | builds linked from the `README.md `_ 31 | or inspect the CI services configuration files in the `develop branch `_ 32 | of the library repository. 33 | -------------------------------------------------------------------------------- /doc/numeric.rst: -------------------------------------------------------------------------------- 1 | Numeric extension 2 | ================= 3 | 4 | Overview 5 | -------- 6 | 7 | *TODO* 8 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx>=2.1 2 | -------------------------------------------------------------------------------- /doc/toolbox.rst: -------------------------------------------------------------------------------- 1 | ToolBox extension 2 | ================= 3 | 4 | .. _Reference: reference.html 5 | 6 | Overview 7 | -------- 8 | 9 | ToolBox provides collection of Boost.GIL extensions which are too 10 | small to be maintained as standalone extensions. 11 | 12 | Content: 13 | 14 | * Color converters: Gray to RGBA 15 | 16 | * Color spaces: CMYKA, Gray with Alpha, HSL, HSV, Lab, XYZ 17 | 18 | * Metafunctions: 19 | 20 | * ``channel_type`` 21 | * ``channel_type_to_index`` 22 | * ``get_num_bits`` 23 | * ``get_pixel_type`` 24 | * ``is_bit_aligned`` 25 | * ``is_homogeneous`` 26 | * ``is_similar`` 27 | * ``pixel_bit_size`` 28 | 29 | * Image types: 30 | 31 | * ``indexed_image`` 32 | 33 | This extension will hopefully be added on by the community. 34 | 35 | Since the extension is header-only, user just needs to include 36 | its main header ``#include ``. 37 | 38 | All definitions of the toolbox belong to the ``boost::gil`` namespace. 39 | 40 | Folder Structure 41 | ---------------- 42 | 43 | The toolbox structured in the following sub-directories: 44 | 45 | * color_converters 46 | * color_spaces 47 | * metafunctions 48 | * image_types 49 | 50 | Acknowledgements 51 | ---------------- 52 | 53 | Thanks to all the people who have reviewed this library and 54 | made suggestions for improvements. 55 | 56 | Reference 57 | --------- 58 | 59 | The Reference_ section. 60 | -------------------------------------------------------------------------------- /doc/tutorial/video.rst: -------------------------------------------------------------------------------- 1 | Tutorial: Video Lecture 2 | ======================= 3 | 4 | This is original video lecture about GIL presented by Lubomir Bourdev. 5 | 6 | .. raw:: html 7 | 8 |
9 | 10 |
11 | 12 | Source link: https://www.youtube.com/watch?v=sR8Wjg0pceE 13 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Boost.GIL Examples 2 | 3 | This directory contains 4 | 5 | - examples of C++ programs using GIL 6 | - a documentation file describing the synopsis, build and execution requirements for each example 7 | - configuration files for Boost.Build command line and CMake integration for popular IDEs. 8 | 9 | We provide Boost.Build (`Jamfile`) and CMake (`CMakeLists.txt`) 10 | configurations to build the examples. 11 | See the [CONTRIBUTING.md](../CONTRIBUTING.md) 12 | for details on how to run `b2` and `cmake` for Boost.GIL. 13 | 14 | Each example is built as a separate executable. 15 | -------------------------------------------------------------------------------- /example/adaptive_histogram_equalization.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Debabrata Mandal 3 | // Copyright 2021 Pranam Lashkari 4 | // 5 | // Use, modification and distribution are subject to the Boost Software License, 6 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | using namespace boost::gil; 16 | 17 | // Demonstrates Adaptive Histogram Equalization (AHE) 18 | 19 | // See also: 20 | // histogram.cpp - General use of histograms in GIL 21 | // histogram_equalization.cpp - Regular Histogram Equalization 22 | // histogram_matching.cpp - Reference-based histogram computation 23 | 24 | int main() 25 | { 26 | gray8_image_t img; 27 | read_image("test_adaptive.png", img, png_tag{}); 28 | gray8_image_t img_out(img.dimensions()); 29 | 30 | boost::gil::non_overlapping_interpolated_clahe(view(img), view(img_out)); 31 | write_view("out-adaptive.png", view(img_out), png_tag{}); 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /example/adaptive_histogram_equalization.md: -------------------------------------------------------------------------------- 1 | # Adaptive Histogram Equalization 2 | 3 | Adaptive Histogram Equalization (AHE) capabilities in GIL are demonstrated by the program `adaptive_histogram_equalization`, compiled from the sources `example/adaptive_histogram_equalization.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `adaptive_histogram_equalization` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `adaptive_histogram_equalization` expects to find an image called `test_adaptive.png` in the current directory, and produces the image `out-adaptive.png` in return. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The PNG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | - `adaptive_histogram_equalization` expects to find an image called `test_adaptive.png` in the current directory. 23 | 24 | -------------------------------------------------------------------------------- /example/adaptive_threshold.md: -------------------------------------------------------------------------------- 1 | # Adaptive Thresholding 2 | 3 | Adaptive Thresholding capabilities in GIL are demonstrated by the program `adaptive_threshold`, compiled from the sources `example/adaptive_threshold.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `adaptive_threshold` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `adaptive_threshold` expects to find an image called `test_adaptive.png` in the current directory, and produces one image for each thresholding method: 12 | - `out-threshold-adaptive-mean.png` 13 | - `out-threshold-adaptive-mean-inv.png` 14 | - `out-threshold-adaptive-gaussian.png` 15 | - `out-threshold-adaptive-gaussian-inv.png`. 16 | 17 | ## Specific requirements 18 | 19 | ### Build requirements 20 | 21 | - A C++ compiler compliant with C++14 or above 22 | - The PNG library installed and configured. 23 | 24 | ### Execution requirements 25 | 26 | - `adaptive_threshold` expects to find an image called `test_adaptive.png` in the current directory. 27 | -------------------------------------------------------------------------------- /example/affine.md: -------------------------------------------------------------------------------- 1 | # Affine transformation 2 | 3 | Affine transformation capabilities in GIL are demonstrated by the program `affine`, compiled from the sources `example/affine.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `affine` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `affine` expects to find an image called `test.jpg` in the current directory, and produces an image in return, where the transformations have been applied: `out-affine.jpg` 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | - `affine` expects to find an image called `test.jpg` in the current directory. 23 | -------------------------------------------------------------------------------- /example/anisotropic_diffusion.md: -------------------------------------------------------------------------------- 1 | # Anisotropic diffusion 2 | 3 | Anisotropic diffusion capabilities in GIL are demonstrated by the program `anisotropic_diffusion`, compiled from the sources `example/anisotropic_diffusion.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `anisoptropic_diffusion input.png output.png gray|rgb iterations kappa` 8 | - The first parameter must be the full path to an existing image in the JPEG format for `anisoptropic_diffusion` to process 9 | - The second parameter is the full path to the output image of `anisotropic_diffusion`. The directory will *not* be created and must exist. 10 | - The third parameter is the colour space: either `gray` or `rgb` 11 | - The fourth parameter is the number of iterations, which *must* be a positive integer 12 | - The fifth and last parameter is the value of the kappa constant 13 | 14 | Note that both the input and the output images must be in the PNG format. 15 | 16 | ## Specific requirements 17 | 18 | ### Build requirements 19 | 20 | - A C++ compiler compliant with C++14 or above 21 | - The PNG library installed and configured. 22 | 23 | ### Execution requirements 24 | 25 | `anisotropic_diffusion` has no specific execution requirements. 26 | -------------------------------------------------------------------------------- /example/clang-format/README.md: -------------------------------------------------------------------------------- 1 | # Boost.GIL Clang-Format 2 | 3 | This is an _example_ of `.clang-format` file which offers _good enough_ 4 | configuration and may be _useful_ when writing code for GIL, not required though. 5 | 6 | This is **not** a complete configuration! 7 | 8 | It does not cover all the recommended or preferred ways of formatting the code for GIL. 9 | It may be necessary to manually tweak the formatting generated by this `.clang-format` file. 10 | For example, there is a bug in clang-format that does not allow spacing and breaking 11 | trailing return types properly. More in details can be found in the 12 | [brainstorm of .clang-format proposal](https://github.com/boostorg/gil/pull/87). 13 | 14 | It has been successfully used with clang-format 8 or later. 15 | 16 | If you wish to use this file with `clang-format`, copy it to the root directory of GIL 17 | sources, to `libs/gil/.clang-format`. 18 | -------------------------------------------------------------------------------- /example/convolution.md: -------------------------------------------------------------------------------- 1 | # Convolution 2 | 3 | Convolution capabilities in GIL are demonstrated by the program `convolution`, compiled from the sources `example/convolution.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `convolution` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `convolution` expects to find an image called `test.jpg` in the current directory, and produces two images in return, where the filters have been applied: `out-convolution.jpg` and `out-convolution2.jpg` 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | - `convolution` expects to find an image called `test.jpg` in the current directory. 23 | -------------------------------------------------------------------------------- /example/convolve2d.md: -------------------------------------------------------------------------------- 1 | # Convolution (2d kernel) 2 | 3 | 2d kernel convolution capabilities in GIL are demonstrated by the program `convolve2d`, compiled from the sources `example/convolve2d.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `convolve2d` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `convolve2d` expects to find an image called `src_view.png` in the current directory, and produces two images in return, where the filters have been applied: `out-convolve2d.png` and `out-convolve_option_extend_zero.png` 12 | 13 | Note that the user is expected to press a key to end the program. 14 | 15 | ## Specific requirements 16 | 17 | ### Build requirements 18 | 19 | - A C++ compiler compliant with C++14 or above 20 | - The JPEG library installed and configured 21 | - The PNG library installed and configured. 22 | 23 | ### Execution requirements 24 | 25 | - `convolve2d` expects to find an image called `src_view.png` in the current directory. 26 | -------------------------------------------------------------------------------- /example/dynamic_image.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // Demonstrates how to use images whose type is instantiated at run time. 15 | 16 | int main() 17 | { 18 | namespace gil = boost::gil; 19 | 20 | gil::any_image dynamic_image; 21 | gil::read_image("test.jpg", dynamic_image, gil::jpeg_tag()); 22 | 23 | // Save the image upside down, preserving its native color space and channel depth 24 | auto view = gil::flipped_up_down_view(gil::const_view(dynamic_image)); 25 | 26 | gil::write_view("out-dynamic_image.jpg", view, gil::jpeg_tag()); 27 | } 28 | -------------------------------------------------------------------------------- /example/dynamic_image.md: -------------------------------------------------------------------------------- 1 | # Dynamic Image 2 | 3 | Dynamic image manipulation capabilities in GIL are demonstrated by the program `dynamic_image`, compiled from the sources `example/dynamic_image.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `dynamic_image` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `dynamic_image` expects to find an image called `test.jpg` in the current directory, and produces an image in return, where the a flip has been applied: `out-dynamic_image.jpg`. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured 19 | 20 | ### Execution requirements 21 | 22 | - `dynamic_image` expects to find an image called `test.jpg` in the current directory. 23 | -------------------------------------------------------------------------------- /example/harris.md: -------------------------------------------------------------------------------- 1 | # Harris Corner Detection 2 | 3 | Harris corner detection capabilities in GIL are demonstrated by the program `harris`, compiled from the sources `example/harris.cpp` and `hvstack.hpp`. 4 | 5 | ## Synopsis 6 | 7 | `harris input.png window-size discriminant harris-threshold output.png` 8 | 9 | - The first parameter must be the full path to an existing image in the PNG format for `harris` to process 10 | - The second parameter is the size of the window containing the pixels to analyse and must be an odd number (e.g. 9 for a 3x3 matrix) 11 | - The third parameter is the empirically-defined discriminant constant, usually between 0.04 and 0.06 12 | - The fourth parameter is the harris threshold used to identify the optimal values 13 | - The fifth and last parameter is the full path to the output image of `harris`. The directory will *not* be created and must exist. 14 | 15 | ## Specific requirements 16 | 17 | ### Build requirements 18 | 19 | - A C++ compiler compliant with C++14 or above 20 | - The PNG library installed and configured 21 | 22 | ### Execution requirements 23 | 24 | - `harris` has no specific execution requirements. 25 | -------------------------------------------------------------------------------- /example/hessian.md: -------------------------------------------------------------------------------- 1 | # Hessian Feature Detection 2 | 3 | Hessian feature detection capabilities in GIL are demonstrated by the program `hessian`, compiled from the sources `example/hessian.cpp`. 4 | 5 | ## Synopsis 6 | `hessian input.png window-size hessian-threshold output.png` 7 | 8 | - The first parameter must be the full path to an existing image in the PNG format for `hessian` to process 9 | - The second parameter is the size of the window containing the pixels to analyse and must be an odd number (e.g. 9 for a 3x3 matrix) 10 | - The third parameter is the hessian threshold used to identify the optimal values 11 | - The fourth and last parameter is the full path to the output image of `hessian`. The directory will *not* be created and must exist. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | - A C++ compiler compliant with C++14 or above 17 | - The PNG library installed and configured 18 | 19 | ### Execution requirements 20 | - `hessian` has no specific execution requirements. 21 | -------------------------------------------------------------------------------- /example/histogram.md: -------------------------------------------------------------------------------- 1 | # Histogram 2 | 3 | Histogram capabilities in GIL are demonstrated by the program `histogram`, compiled from the sources `example/histogram.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `histogram` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `histogram` expects to find an image called `test_adaptive.png` in the current directory. 12 | The program doesn't produce any output. 13 | 14 | ## Specific requirements 15 | 16 | ### Build requirements 17 | 18 | - A C++ compiler compliant with C++14 or above 19 | - The PNG library installed and configured. 20 | 21 | ### Execution requirements 22 | 23 | - `histogram` expects to find an image called `test_adaptive.png` in the current directory. 24 | -------------------------------------------------------------------------------- /example/histogram_equalization.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Debabrata Mandal 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | using namespace boost::gil; 14 | 15 | // Demonstrates Histogram Equalization 16 | 17 | // See also: 18 | // histogram.cpp - General use of histograms in GIL 19 | // adaptive_histogram_equalization.cpp - Adaptive Histogram Equalization 20 | // histogram_matching.cpp - Reference-based histogram computation 21 | 22 | int main() 23 | { 24 | gray8_image_t img; 25 | 26 | read_image("test_adaptive.png", img, png_tag{}); 27 | gray8_image_t img_out(img.dimensions()); 28 | 29 | // Consider changing image to independent color space, e.g. cmyk 30 | boost::gil::histogram_equalization(view(img),view(img_out)); 31 | 32 | write_view("histogram_gray_equalized.png", view(img_out), png_tag{}); 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /example/histogram_matching.md: -------------------------------------------------------------------------------- 1 | # Histogram Matching 2 | 3 | Histogram matching capabilities in GIL are demonstrated by the program `histogram_matching`, compiled from the sources `example/histogram_matching.cpp`. 4 | 5 | ## Synopsis 6 | `histogram_matching` 7 | 8 | The program doesn't take any argument on the command line. 9 | 10 | `histogram_matching` expects to find an image called `test_adaptive.png` in the current directory, and produces an image in return, where the equalization have been applied: `histogram_gray_matching.png`. 11 | 12 | ## Specific requirements 13 | 14 | ### Build requirements 15 | - A C++ compiler compliant with C++14 or above 16 | - The PNG library installed and configured. 17 | 18 | ### Execution requirements 19 | - `histogram_matching` expects to find an image called `test_adaptive.png` in the current directory. 20 | -------------------------------------------------------------------------------- /example/hough_transform_circle.md: -------------------------------------------------------------------------------- 1 | # Hough Circle Transform 2 | 3 | Hough circle transform capabilities in GIL are demonstrated by the program `hough_transform_circle`, compiled from the sources `example/hough_transform_circle.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `hough_transform_circle` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | The program outputs the voting cell of the centre of a circle drawn programmatically. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above. 18 | 19 | ### Execution requirements 20 | 21 | `hough_transform_circle` doesn't have any specific execution requirements. 22 | -------------------------------------------------------------------------------- /example/hough_transform_line.md: -------------------------------------------------------------------------------- 1 | # Hough Line Transform 2 | 3 | Hough line transform capabilities in GIL are demonstrated by the program `hough_transform_line`, compiled from the sources `example/hough_transform_line.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `hough_transform_line` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | The program outputs the expected theta and radius, followed by every step of the search. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above. 18 | 19 | ### Execution requirements 20 | 21 | `hough_transform_line` doesn't have any specific execution requirements. 22 | -------------------------------------------------------------------------------- /example/interleaved_ptr.md: -------------------------------------------------------------------------------- 1 | # Custom pixel reference and iteraror: Interleaved Pointer 2 | 3 | Definition of custom pixel reference and iterator capabilities in GIL are demonstrated by the program `interleaved_ptr`, compiled from the sources `example/interleaved_ptr.cpp`, `interleaved_ptr.hpp` and `interleaved_ref.hpp`. 4 | 5 | ## Synopsis 6 | 7 | `interleaved_ptr` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | The program expects to find an image, `test.jpg` in the current directory, and produces the image `out-interleaved_ptr.jpg` in return, that has been generated using the custom pixel reference and iterator objects. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | `interleaved_ptr` expects to find an image, `test.jpg` in the current directory. 23 | -------------------------------------------------------------------------------- /example/mandelbrot.md: -------------------------------------------------------------------------------- 1 | # Mandelbrot 2 | 3 | Pixel iteration using `virtual_2d_locators` capabilities in GIL are demonstrated by the program `mandelbrot`, compiled from the sources `example/mandelbrot.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `mandelbrot` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | The program produces the image `out-mandelbrot.jpg` that has been generated using the `virtual_2d_locator` object. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | `mandelbrot` has no specific execution requirements. 23 | -------------------------------------------------------------------------------- /example/morphology_original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/example/morphology_original.png -------------------------------------------------------------------------------- /example/packed_pixel.md: -------------------------------------------------------------------------------- 1 | # Packed Pixel 2 | 3 | Packed pixel formats capabilities in GIL are demonstrated by the program `packed_pixel`, compiled from the sources `example/packed_pixel.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `packed_pixel` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `packed_pixel` expects to find an image called `input.jpg` in the current directory in JPEG format, and produces two images in the current directory in return, `out-packed_pixel_bgr772.jpg` and `out-packed_pixel_gray1.jpg`. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | `packed_pixel` expects to find an image called `input.jpg` in the current directory in JPEG format. 23 | -------------------------------------------------------------------------------- /example/rasterizer_circle.md: -------------------------------------------------------------------------------- 1 | # Circle rasterizeration 2 | 3 | Circle rasterization capabilities in GIL are demonstrated by the program `rasterizer_circle`, compiled from the sources `example/rasterizer_circle.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `rasterizer_circle` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `rasterizer_circle` produces an image in the current directory called `circle.png`, in the PNG format. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The PNG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | `rasterizer_circle` doesn't have any specific execution requirements. 23 | -------------------------------------------------------------------------------- /example/rasterizer_ellipse.md: -------------------------------------------------------------------------------- 1 | # Ellipse rasterizeration 2 | 3 | Ellipse rasterization capabilities in GIL are demonstrated by the program `rasterizer_ellipse`, compiled from the sources `example/rasterizer_ellipse.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `rasterizer_ellipse` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `rasterizer_ellipse` produces three images in the current directory: 12 | - `rasterized_ellipse_gray.jpg`, in the JPEG format, which is a greyscale image of an ellipse 13 | - `rasterized_ellipse_rgb.jpg`, in the JPEG format, which is an RGB image of an ellipse 14 | - `rasterized_ellipse_rgb_out_of_bound.jpg`, in the JPEG format, which is an RGB image of an ellipse bigger than the containinig view. 15 | 16 | ## Specific requirements 17 | 18 | ### Build requirements 19 | 20 | - A C++ compiler compliant with C++14 or above 21 | - The JPEG library installed and configured. 22 | 23 | ### Execution requirements 24 | 25 | `rasterizer_ellipse` doesn't have any specific execution requirements. 26 | -------------------------------------------------------------------------------- /example/rasterizer_line.md: -------------------------------------------------------------------------------- 1 | # Line rasterizeration 2 | 3 | Line rasterization capabilities in GIL are demonstrated by the program `rasterizer_line`, compiled from the sources `example/rasterizer_line.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `rasterizer_line` 8 | 9 | The program doesn't take any argument on the command line. 10 | 11 | `rasterizer_line` produces four images of different lines in the current directory: 12 | - `line-bresenham-256-256.png`, in the PNG format 13 | - `line-bresenham-256-128.png`, in the PNG format 14 | - `line-bresenham-256-1.png`, in the PNG format 15 | - `line-bresenham-1-256.png`, in the PNG format. 16 | 17 | ## Specific requirements 18 | 19 | ### Build requirements 20 | 21 | - A C++ compiler compliant with C++14 or above 22 | - The PNG library installed and configured. 23 | 24 | ### Execution requirements 25 | 26 | `rasterizer_line` doesn't have any specific execution requirements. 27 | -------------------------------------------------------------------------------- /example/resize.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // Demonstrates how to scale an image using bilinear sampling 15 | // This example relies on the function resize_view(), available in include/boost/gil/extension/numeric/resample.hpp, 16 | // to apply the resampling. 17 | // This example demonstrates bilinear sampling; include/boost/gil/extension/numeric/sample.hpp also offers nearest-neighbour sampling. 18 | 19 | int main() 20 | { 21 | namespace bg = boost::gil; 22 | 23 | bg::rgb8_image_t img; 24 | bg::read_image("test.jpg", img, bg::jpeg_tag{}); 25 | 26 | // test resize_view 27 | // Scale the image to 100x100 pixels using bilinear resampling 28 | bg::rgb8_image_t square100x100(100, 100); 29 | bg::resize_view(bg::const_view(img), bg::view(square100x100), bg::bilinear_sampler{}); 30 | bg::write_view("out-resize.jpg", bg::const_view(square100x100), bg::jpeg_tag{}); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /example/resize.md: -------------------------------------------------------------------------------- 1 | # Resize 2 | 3 | Resizing capabilities in GIL are demonstrated by the program `resize`, compiled from the sources `example/resize.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `resize` 8 | 9 | This program expects to find an image called `test.jpg`, in JPEG format, in the current directory, and produces a scaled down version of this image, called `out-resize.jpg`, in JPEG format in the current directory. 10 | 11 | The program doesn't take any argument on the command line. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | `resize` expects to find an image called `test.jpg`, in JPEG format, in the current directory. 23 | -------------------------------------------------------------------------------- /example/sobel_scharr.md: -------------------------------------------------------------------------------- 1 | # Sobel and Scharr filters for edge detection 2 | 3 | Edge detection via Sobel and Scharr filters capabilities in GIL are demonstrated by the program `sobel_scharr`, compiled from the sources `example/sobel_scharr.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `sobel_scharr input.png sobel|scharr output-x.png output-y.png` 8 | 9 | - The first argument must be the full path to an existing image in PNG format 10 | - The second argument is the type of the filter to apply, either `sobel` or `scharr` 11 | - The third argument is the full path to an image of the result of applying the filter in the x direction. The directory will *not* be created and must exist 12 | - The fourth and last argument is the full path to an image of the result of applying the filter in the y direction. The directory will *not* be created and must exist. 13 | 14 | ## Specific requirements 15 | 16 | ### Build requirements 17 | 18 | - A C++ compiler compliant with C++14 or above 19 | - The PNG library installed and configured. 20 | 21 | ### Execution requirements 22 | 23 | `sobek_scharr` doesn't have any specific execution requirements. 24 | -------------------------------------------------------------------------------- /example/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/example/test.jpg -------------------------------------------------------------------------------- /example/test_adaptive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/example/test_adaptive.png -------------------------------------------------------------------------------- /example/threshold.md: -------------------------------------------------------------------------------- 1 | # Thresholding 2 | 3 | Thresholding capabilities in GIL are demonstrated by the program `threshold`, compiled from the sources `example/threshold.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `threshold` 8 | 9 | The program expects to find an image in the JPEG format in the current directory named `input.jpg`, and produces two images in JPEG format in the current directory in return, named `out-threshold-binary.jpg` and `out-threshold-binary-inv.jpg`, where a thresholding and an inverse thresholding, respectively, has been applied. 10 | 11 | The program doesn't take any command line arguments. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | `threshold` expects to find an image in the JPEG format in the current directory. 23 | -------------------------------------------------------------------------------- /example/tutorial_histogram.md: -------------------------------------------------------------------------------- 1 | # Histogram computation 2 | 3 | Histogram computation capabilities in GIL are demonstrated by the program `tutorial_histogram`, compiled from the sources `example/tutorial_histogram.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `tutorial_histogram` 8 | 9 | The program expects to find an image in the JPEG format in the current directory named `input.jpg`, and produces a text file named `out-histogram.txt`, in the current direction, where the histogram has been calculated.. 10 | 11 | The program doesn't take any command line arguments. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | `tutorial_histogram` expects to find an image in the JPEG format in the current directory. 23 | -------------------------------------------------------------------------------- /example/x_gradient.md: -------------------------------------------------------------------------------- 1 | # Gradients calculations 2 | 3 | Gradients calculations capabilities in GIL are demonstrated by the program `x_gradient`, compiled from the sources `example/x_gradient.cpp`. 4 | 5 | ## Synopsis 6 | 7 | `x_gradient` 8 | 9 | The program expects to find an image in the JPEG format in the current directory named `input.jpg`, and produces an image in JPEG format in the current directory in return, named `out-x_gradient.jpg`, where the gradients have been captured. 10 | 11 | The program doesn't take any command line arguments. 12 | 13 | ## Specific requirements 14 | 15 | ### Build requirements 16 | 17 | - A C++ compiler compliant with C++14 or above 18 | - The JPEG library installed and configured. 19 | 20 | ### Execution requirements 21 | 22 | `x_gradient` expects to find an image in the JPEG format in the current directory. 23 | -------------------------------------------------------------------------------- /include/boost/gil/concepts.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_CONCEPTS_HPP 9 | #define BOOST_GIL_CONCEPTS_HPP 10 | 11 | // TODO: Remove and prefer individual includes from boost/gil/concepts/*.hpp? 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /include/boost/gil/concepts/detail/type_traits.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_CONCEPTS_DETAIL_TYPE_TRAITS_HPP 9 | #define BOOST_GIL_CONCEPTS_DETAIL_TYPE_TRAITS_HPP 10 | 11 | #include 12 | 13 | namespace boost { namespace gil { namespace detail { 14 | 15 | // TODO: C++20: deprecate and replace with std::std_remove_cvref 16 | template 17 | struct remove_const_and_reference 18 | : std::remove_const::type> 19 | { 20 | }; 21 | 22 | }}} // namespace boost::gil::detail 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /include/boost/gil/concepts/detail/utility.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_CONCEPTS_DETAIL_UTILITY_HPP 9 | #define BOOST_GIL_CONCEPTS_DETAIL_UTILITY_HPP 10 | 11 | namespace boost { namespace gil { namespace detail { 12 | 13 | // TODO: Remove, replace with ignore_unised? 14 | template 15 | void initialize_it(T&) {} 16 | 17 | }}} // namespace boost::gil::detail 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/boost/gil/detail/math.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2019 Olzhas Zhumabek 3 | // 4 | // Use, modification and distribution are subject to the Boost Software License, 5 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP 9 | #define BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP 10 | 11 | #include 12 | #include 13 | 14 | namespace boost { namespace gil { namespace detail { 15 | 16 | static constexpr double pi = 3.14159265358979323846; 17 | 18 | static constexpr std::array dx_sobel = {{1, 0, -1, 2, 0, -2, 1, 0, -1}}; 19 | static constexpr std::array dx_scharr = {{-1, 0, 1, -1, 0, 1, -1, 0, 1}}; 20 | static constexpr std::array dy_sobel = {{1, 2, 1, 0, 0, 0, -1, -2, -1}}; 21 | static constexpr std::array dy_scharr = {{1, 1, 1, 0, 0, 0, -1, -1, -1}}; 22 | 23 | template 24 | inline auto get_identity_kernel() -> detail::kernel_2d 25 | { 26 | detail::kernel_2d kernel(1, 0, 0); 27 | kernel[0] = 1; 28 | return kernel; 29 | } 30 | 31 | }}} // namespace boost::gil::detail 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/boost/gil/detail/mp11.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2017 Peter Dimov. 3 | // Copyright 2019 Mateusz Loskot 4 | // 5 | // Distributed under the Boost Software License, Version 1.0 6 | // See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | // 9 | #ifndef BOOST_GIL_DETAIL_MP11_HPP 10 | #define BOOST_GIL_DETAIL_MP11_HPP 11 | 12 | #include 13 | 14 | namespace boost { namespace gil { namespace detail { 15 | 16 | template 17 | using mp_back = ::boost::mp11::mp_at_c::value - 1>; 18 | 19 | template 20 | using mp_pop_back = ::boost::mp11::mp_take_c::value - 1>; 21 | 22 | 23 | }}} // namespace boost::gil::detail 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/boost/gil/detail/std_common_type.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright Louis Dionne 2013-2017 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. 5 | //(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) 6 | // 7 | #ifndef BOOST_GIL_DETAIL_STD_COMMON_TYPE_HPP 8 | #define BOOST_GIL_DETAIL_STD_COMMON_TYPE_HPP 9 | 10 | #include 11 | #include 12 | 13 | namespace boost { namespace gil { namespace detail { 14 | 15 | // Defines a SFINAE-friendly version of `std::common_type`. 16 | // 17 | // Based on boost/hana/detail/std_common_type.hpp 18 | // Equivalent to `std::common_type`, except it is SFINAE-friendly and 19 | // does not support custom specializations. 20 | 21 | template 22 | struct std_common_type {}; 23 | 24 | template 25 | struct std_common_type 26 | < 27 | T, U, 28 | decltype((void)(true ? std::declval() : std::declval())) 29 | > 30 | { 31 | using type = typename std::decay 32 | < 33 | decltype(true ? std::declval() : std::declval()) 34 | >::type; 35 | }; 36 | 37 | }}} // namespace boost::gil::detail 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/boost/gil/detail/type_traits.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2017-2019 Peter Dimov. 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_DETAIL_TYPE_TRAITS_HPP 9 | #define BOOST_GIL_DETAIL_TYPE_TRAITS_HPP 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace boost { namespace gil { namespace detail { 16 | 17 | #if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50100 18 | 19 | template 20 | struct is_trivially_default_constructible 21 | : std::integral_constant 22 | < 23 | bool, 24 | std::is_default_constructible::value && 25 | std::has_trivial_default_constructor::value 26 | > 27 | {}; 28 | 29 | #else 30 | 31 | using std::is_trivially_default_constructible; 32 | 33 | #endif 34 | 35 | using std::is_trivially_destructible; 36 | 37 | }}} //namespace boost::gil::detail 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/boost/gil/dynamic_step.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_DYNAMIC_STEP_HPP 9 | #define BOOST_GIL_DYNAMIC_STEP_HPP 10 | 11 | #include 12 | 13 | namespace boost { namespace gil { 14 | 15 | /// Base template for types that model HasDynamicXStepTypeConcept. 16 | template 17 | struct dynamic_x_step_type; 18 | 19 | /// Base template for types that model HasDynamicYStepTypeConcept. 20 | template 21 | struct dynamic_y_step_type; 22 | 23 | /// Base template for types that model both, HasDynamicXStepTypeConcept and HasDynamicYStepTypeConcept. 24 | /// 25 | /// \todo TODO: Is Locator allowed or practical to occur? 26 | template 27 | struct dynamic_xy_step_type; 28 | 29 | }} // namespace boost::gil 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/boost/gil/extension/dynamic_image/dynamic_image_all.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_IMAGE_ALL_HPP 9 | #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_IMAGE_ALL_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/bmp.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_BMP_HPP 9 | #define BOOST_GIL_EXTENSION_IO_BMP_HPP 10 | 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/bmp/read.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_BMP_READ_HPP 9 | #define BOOST_GIL_EXTENSION_IO_BMP_READ_HPP 10 | 11 | #define BOOST_GIL_EXTENSION_IO_BMP_READ_ENABLED // TODO: Document, explain, review 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/bmp/write.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_BMP_WRITE_HPP 9 | #define BOOST_GIL_EXTENSION_IO_BMP_WRITE_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/jpeg.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_JPEG_HPP 9 | #define BOOST_GIL_EXTENSION_IO_JPEG_HPP 10 | 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/jpeg/detail/base.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_BASE_HPP 9 | #define BOOST_GIL_EXTENSION_IO_JPEG_DETAIL_BASE_HPP 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace boost { namespace gil { 16 | 17 | #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) 18 | #pragma warning(push) 19 | #pragma warning(disable:4324) //structure was padded due to __declspec(align()) 20 | #endif 21 | 22 | class jpeg_io_base 23 | { 24 | 25 | protected: 26 | 27 | jpeg_error_mgr _jerr; 28 | jmp_buf _mark; 29 | }; 30 | 31 | #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) 32 | #pragma warning(pop) 33 | #endif 34 | 35 | } // namespace gil 36 | } // namespace boost 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/jpeg/read.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_JPEG_READ_HPP 9 | #define BOOST_GIL_EXTENSION_IO_JPEG_READ_HPP 10 | 11 | #define BOOST_GIL_EXTENSION_IO_JPEG_READ_ENABLED // TODO: Document, explain, review 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/jpeg/write.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_JPEG_WRITE_HPP 9 | #define BOOST_GIL_EXTENSION_IO_JPEG_WRITE_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/png.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_PNG_HPP 9 | #define BOOST_GIL_EXTENSION_IO_PNG_HPP 10 | 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/png/read.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_PNG_READ_HPP 9 | #define BOOST_GIL_EXTENSION_IO_PNG_READ_HPP 10 | 11 | #define BOOST_GIL_EXTENSION_IO_PNG_READ_ENABLED // TODO: Document, explain, review 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/png/write.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_PNG_WRITE_HPP 9 | #define BOOST_GIL_EXTENSION_IO_PNG_WRITE_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/pnm.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_PNM_HPP 9 | #define BOOST_GIL_EXTENSION_IO_PNM_HPP 10 | 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/pnm/read.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_PNM_READ_HPP 9 | #define BOOST_GIL_EXTENSION_IO_PNM_READ_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/pnm/write.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_PNM_WRITE_HPP 9 | #define BOOST_GIL_EXTENSION_IO_PNM_WRITE_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/raw.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_RAW_HPP 9 | #define BOOST_GIL_EXTENSION_IO_RAW_HPP 10 | 11 | #include 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/raw/read.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // Copyright 2012 Olivier Tournaire 4 | // 5 | // Distributed under the Boost Software License, Version 1.0 6 | // See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | // 9 | #ifndef BOOST_GIL_EXTENSION_IO_RAW_READ_HPP 10 | #define BOOST_GIL_EXTENSION_IO_RAW_READ_HPP 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/targa.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010 Kenneth Riddile 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_TARGA_HPP 9 | #define BOOST_GIL_EXTENSION_IO_TARGA_HPP 10 | 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/targa/read.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010-2012 Kenneth Riddile, Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_TARGA_READ_HPP 9 | #define BOOST_GIL_EXTENSION_IO_TARGA_READ_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/targa/write.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010 Kenneth Riddile 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_TARGA_WRITE_HPP 9 | #define BOOST_GIL_EXTENSION_IO_TARGA_WRITE_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/tiff.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_TIFF_HPP 9 | #define BOOST_GIL_EXTENSION_IO_TIFF_HPP 10 | 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/tiff/detail/supported_types.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_SUPPORTED_TYPES_HPP 9 | #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_SUPPORTED_TYPES_HPP 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | namespace boost{ namespace gil { 20 | 21 | namespace detail { 22 | 23 | // Read support 24 | 25 | // TIFF virtually supports everything 26 | struct tiff_read_support : read_support_true 27 | {}; 28 | 29 | 30 | // Write support 31 | 32 | struct tiff_write_support : write_support_true 33 | {}; 34 | 35 | } // namespace detail 36 | 37 | template 38 | struct is_read_supported 39 | : std::integral_constant 40 | {}; 41 | 42 | template 43 | struct is_write_supported 44 | : std::integral_constant 45 | {}; 46 | 47 | }} // namespace boost::gil 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/tiff/read.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_TIFF_READ_HPP 9 | #define BOOST_GIL_EXTENSION_IO_TIFF_READ_HPP 10 | 11 | #define BOOST_GIL_EXTENSION_IO_TIFF_READ_ENABLED // TODO: Document, explain, review 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/boost/gil/extension/io/tiff/write.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_IO_TIFF_WRITE_HPP 9 | #define BOOST_GIL_EXTENSION_IO_TIFF_WRITE_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/boost/gil/extension/numeric/algorithm.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // Copyright 2019-2021 Pranam Lashkari 4 | // 5 | // Distributed under the Boost Software License, Version 1.0 6 | // See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | // 9 | #ifndef BOOST_GIL_EXTENSION_NUMERIC_ALGORITHM_HPP 10 | #define BOOST_GIL_EXTENSION_NUMERIC_ALGORITHM_HPP 11 | 12 | #include 13 | 14 | BOOST_HEADER_DEPRECATED("") 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /include/boost/gil/extension/numeric/channel_numeric_operations.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // Copyright 2021 Pranam Lashkari 4 | // 5 | // Distributed under the Boost Software License, Version 1.0 6 | // See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | // 9 | #ifndef BOOST_GIL_EXTENSION_NUMERIC_CHANNEL_NUMERIC_OPERATIONS_HPP 10 | #define BOOST_GIL_EXTENSION_NUMERIC_CHANNEL_NUMERIC_OPERATIONS_HPP 11 | 12 | #include 13 | 14 | BOOST_HEADER_DEPRECATED("") 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /include/boost/gil/extension/numeric/convolve.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // Copyright 2019 Miral Shah 4 | // Copyright 2019-2021 Pranam Lashkari 5 | // 6 | // Distributed under the Boost Software License, Version 1.0 7 | // See accompanying file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt 9 | // 10 | #ifndef BOOST_GIL_EXTENSION_NUMERIC_CONVOLVE_HPP 11 | #define BOOST_GIL_EXTENSION_NUMERIC_CONVOLVE_HPP 12 | 13 | #include 14 | 15 | BOOST_HEADER_DEPRECATED("") 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /include/boost/gil/extension/numeric/kernel.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // Copyright 2019 Miral Shah 4 | // Copyright 2022 Pranam Lashkari 5 | // 6 | // Distributed under the Boost Software License, Version 1.0 7 | // See accompanying file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt 9 | // 10 | 11 | #ifndef BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP 12 | #define BOOST_GIL_EXTENSION_NUMERIC_KERNEL_HPP 13 | 14 | #include 15 | 16 | BOOST_HEADER_DEPRECATED("") 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/boost/gil/extension/numeric/pixel_numeric_operations.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // Copyright 2021 Pranam Lashkari 4 | // 5 | // Distributed under the Boost Software License, Version 1.0 6 | // See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | // 9 | #ifndef BOOST_GIL_EXTENSION_NUMERIC_PIXEL_NUMERIC_OPERATIONS_HPP 10 | #define BOOST_GIL_EXTENSION_NUMERIC_PIXEL_NUMERIC_OPERATIONS_HPP 11 | 12 | #include 13 | 14 | BOOST_HEADER_DEPRECATED("") 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /include/boost/gil/extension/rasterization/apply_rasterizer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_GIL_EXTENSION_RASTERIZATION_APPLY_RASTERIZER 2 | #define BOOST_GIL_EXTENSION_RASTERIZATION_APPLY_RASTERIZER 3 | 4 | namespace boost { namespace gil { 5 | 6 | namespace detail { 7 | 8 | template 9 | struct apply_rasterizer_op 10 | { 11 | void operator()( 12 | View const& view, Rasterizer const& rasterizer, Pixel const& pixel); 13 | }; 14 | 15 | } // namespace detail 16 | 17 | template 18 | void apply_rasterizer( 19 | View const& view, Rasterizer const& rasterizer, Pixel const& pixel) 20 | { 21 | using tag_t = typename Rasterizer::type; 22 | detail::apply_rasterizer_op{}( 23 | view, rasterizer, pixel); 24 | } 25 | 26 | }} // namespace boost::gil 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/boost/gil/extension/toolbox/color_converters.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_HPP 9 | #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_HPP 10 | 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_RGB_TO_LUMINANCE_HPP 9 | #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_RGB_TO_LUMINANCE_HPP 10 | 11 | #include 12 | 13 | namespace boost{ namespace gil { namespace detail { 14 | 15 | /// - performance specialization double 16 | /// - to eliminate compiler warning 4244 17 | template 18 | struct rgb_to_luminance_fn< double, double, double, GrayChannelValue > 19 | { 20 | GrayChannelValue operator()( const double& red 21 | , const double& green 22 | , const double& blue ) const 23 | { 24 | return channel_convert( red * 0.30 + green * 0.59 + blue * 0.11 ); 25 | } 26 | }; 27 | 28 | } // namespace detail 29 | } // namespace gil 30 | } // namespace boost 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /include/boost/gil/extension/toolbox/color_spaces.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HPP 9 | #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_SPACES_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/boost/gil/extension/toolbox/dynamic_images.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP 9 | #define BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP 10 | 11 | #include 12 | 13 | namespace boost { namespace gil { 14 | 15 | // need this for various meta functions. 16 | struct any_image_pixel_t {}; 17 | struct any_image_channel_t {}; 18 | struct any_image_color_space_t {}; 19 | 20 | template<> 21 | struct color_space_type< any_image_pixel_t > 22 | { 23 | using type = any_image_color_space_t; 24 | }; 25 | 26 | }} // namespace boost::gil 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/boost/gil/extension/toolbox/image_types.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IMAGE_TYPES_HPP 9 | #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IMAGE_TYPES_HPP 10 | 11 | #include 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /include/boost/gil/extension/toolbox/metafunctions.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_HPP 9 | #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /include/boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_PIXEL_TYPE_HPP 9 | #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_PIXEL_TYPE_HPP 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | namespace boost{ namespace gil { 17 | 18 | /// get_pixel_type metafunction 19 | /// \brief Depending on Image this function generates either 20 | /// the pixel type or the reference type in case 21 | /// the image is bit_aligned. 22 | template 23 | struct get_pixel_type 24 | { 25 | using type = mp11::mp_if 26 | < 27 | is_bit_aligned, 28 | typename View::reference, 29 | typename View::value_type 30 | >; 31 | }; 32 | 33 | template 34 | struct get_pixel_type> 35 | { 36 | using type = any_image_pixel_t; 37 | }; 38 | 39 | }} // namespace boost::gil 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/boost/gil/extension/toolbox/metafunctions/is_similar.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP 9 | #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace boost{ namespace gil { 16 | 17 | /// is_similar metafunctions 18 | /// \brief Determines if two pixel types are similar. 19 | 20 | template 21 | struct is_similar : std::false_type {}; 22 | 23 | template 24 | struct is_similar : std::true_type {}; 25 | 26 | template 27 | struct is_similar 28 | < 29 | packed_channel_reference, 30 | packed_channel_reference 31 | > : std::true_type {}; 32 | 33 | }} // namespace boost::gil 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/boost/gil/extension/toolbox/toolbox.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_EXTENSION_TOOLBOX_TOOLBOX_HPP 9 | #define BOOST_GIL_EXTENSION_TOOLBOX_TOOLBOX_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /include/boost/gil/gray.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2005-2007 Adobe Systems Incorporated 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_GRAY_HPP 9 | #define BOOST_GIL_GRAY_HPP 10 | 11 | #include 12 | #include 13 | 14 | namespace boost { namespace gil { 15 | 16 | /// \ingroup ColorNameModel 17 | /// \brief Gray 18 | struct gray_color_t {}; 19 | 20 | /// \ingroup ColorSpaceModel 21 | using gray_t = mp11::mp_list; 22 | 23 | /// \ingroup LayoutModel 24 | using gray_layout_t = layout; 25 | 26 | }} // namespace boost::gil 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /include/boost/gil/io/error.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_IO_ERROR_HPP 9 | #define BOOST_GIL_IO_ERROR_HPP 10 | 11 | #include 12 | 13 | namespace boost { namespace gil { 14 | 15 | inline void io_error(const char* descr) 16 | { 17 | throw std::ios_base::failure(descr); 18 | } 19 | 20 | inline void io_error_if(bool expr, const char* descr) 21 | { 22 | if (expr) 23 | io_error(descr); 24 | } 25 | 26 | } // namespace gil 27 | } // namespace boost 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Automatic redirection failed, please go to 7 | doc/index.html 8 | 9 | 10 | -------------------------------------------------------------------------------- /meta/libraries.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "gil", 3 | "name": "GIL", 4 | "authors": [ 5 | "Lubomir Bourdev", 6 | "Hailin Jin", 7 | "Christian Henning" 8 | ], 9 | "description": "(C++14) Generic Image Library", 10 | "category": [ 11 | "Algorithms", 12 | "Containers", 13 | "Generic", 14 | "Image-processing", 15 | "Iterators" 16 | ], 17 | "maintainers": [ 18 | "Stefan Seefeld ", 19 | "Mateusz Loskot ", 20 | "Pranam Lashkari " 21 | ], 22 | "cxxstd": "14" 23 | } 24 | -------------------------------------------------------------------------------- /sublibs: -------------------------------------------------------------------------------- 1 | The existance of this file tells the regression reporting programs that the directory contains sub-directories which are libraries. 2 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | 9 | foreach(_name 10 | test_utility_output_stream) 11 | set(_test t_utility_${_name}) 12 | set(_target test_utility_${_name}) 13 | 14 | add_executable(${_target} "") 15 | target_sources(${_target} PRIVATE ${_name}.cpp) 16 | target_link_libraries(${_target} 17 | PRIVATE 18 | gil_compile_options 19 | gil_include_directories 20 | gil_dependencies) 21 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 22 | add_test(NAME ${_test} COMMAND ${_target}) 23 | 24 | unset(_name) 25 | unset(_target) 26 | unset(_test) 27 | endforeach() 28 | 29 | add_subdirectory(core) 30 | 31 | add_subdirectory(legacy) 32 | 33 | add_subdirectory(extension) 34 | 35 | # TODO: Split headers tests into core and extensions, see Jamfile-s 36 | if(BOOST_GIL_BUILD_HEADER_TESTS) 37 | add_subdirectory(header) 38 | endif() 39 | -------------------------------------------------------------------------------- /test/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017-2019 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | message(STATUS "Boost.GIL: Configuring tests in test/core") 9 | 10 | foreach(_name 11 | promote_integral 12 | test_fixture) 13 | set(_test t_utility_${_name}) 14 | set(_target test_utility_${_name}) 15 | 16 | add_executable(${_target} "") 17 | target_sources(${_target} PRIVATE ${_name}.cpp) 18 | target_link_libraries(${_target} 19 | PRIVATE 20 | gil_compile_options 21 | gil_include_directories 22 | gil_dependencies) 23 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 24 | add_test(NAME ${_test} COMMAND ${_target}) 25 | 26 | unset(_name) 27 | unset(_target) 28 | unset(_test) 29 | endforeach() 30 | 31 | add_subdirectory(point) 32 | add_subdirectory(channel) 33 | add_subdirectory(color) 34 | add_subdirectory(color_base) 35 | add_subdirectory(pixel) 36 | add_subdirectory(iterator) 37 | add_subdirectory(locator) 38 | add_subdirectory(virtual_2d_locator) 39 | add_subdirectory(image) 40 | add_subdirectory(image_view) 41 | add_subdirectory(algorithm) 42 | add_subdirectory(image_processing) 43 | add_subdirectory(histogram) 44 | add_subdirectory(io) 45 | -------------------------------------------------------------------------------- /test/core/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - core tests 2 | # 3 | # Copyright (c) 2008 Lubomir Bourdev, Hailin Jin 4 | # Copyright (c) 2018-2019 Mateusz Loskot 5 | # 6 | # Distributed under the Boost Software License, Version 1.0. 7 | # (See accompanying file LICENSE_1_0.txt or 8 | # copy at http://www.boost.org/LICENSE_1_0.txt) 9 | 10 | import testing ; 11 | 12 | project 13 | : 14 | requirements 15 | BOOST_GIL_USE_CONCEPT_CHECK=1 16 | ; 17 | 18 | alias headers_concepts : [ generate_self_contained_headers concepts ] ; 19 | alias headers : [ generate_self_contained_headers : concepts extension ] ; 20 | 21 | run promote_integral.cpp ; 22 | run test_fixture.cpp ; 23 | 24 | build-project point ; 25 | build-project channel ; 26 | build-project color ; 27 | build-project color_base ; 28 | build-project pixel ; 29 | build-project iterator ; 30 | build-project locator ; 31 | build-project image ; 32 | build-project image_view ; 33 | build-project algorithm ; 34 | build-project image_processing ; 35 | build-project histogram ; 36 | build-project io ; 37 | -------------------------------------------------------------------------------- /test/core/algorithm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018 Mateusz Loskot 3 | # Copyright (c) 2021 Pranam Lashkari 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt) 8 | # 9 | foreach(_name 10 | for_each_pixel 11 | std_fill 12 | std_uninitialized_fill 13 | extend_boundary) 14 | set(_test t_core_algorithm_${_name}) 15 | set(_target test_core_algorithm_${_name}) 16 | 17 | add_executable(${_target} "") 18 | target_sources(${_target} PRIVATE ${_name}.cpp) 19 | target_link_libraries(${_target} 20 | PRIVATE 21 | gil_compile_options 22 | gil_include_directories 23 | gil_dependencies) 24 | add_test(NAME ${_test} COMMAND ${_target}) 25 | 26 | unset(_name) 27 | unset(_target) 28 | unset(_test) 29 | endforeach() 30 | -------------------------------------------------------------------------------- /test/core/algorithm/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2018-2019 Mateusz Loskot 4 | # Copyright (c) 2021 Pranam Lashkari 5 | # 6 | # Distributed under the Boost Software License, Version 1.0. 7 | # (See accompanying file LICENSE_1_0.txt or 8 | # copy at http://www.boost.org/LICENSE_1_0.txt) 9 | 10 | import testing ; 11 | 12 | run for_each_pixel.cpp ; 13 | run std_fill.cpp : : : /boost/array//boost_array ; 14 | run std_uninitialized_fill.cpp ; 15 | run extend_boundary.cpp ; 16 | -------------------------------------------------------------------------------- /test/core/channel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018 Mateusz Loskot 3 | # Copyright (c) 2021 Pranam Lashkari 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt) 8 | # 9 | foreach(_name 10 | algorithm_channel_arithmetic 11 | algorithm_channel_convert 12 | algorithm_channel_invert 13 | algorithm_channel_multiply 14 | algorithm_channel_relation 15 | channel_traits 16 | concepts 17 | is_channel_integral 18 | packed_channel_value 19 | scoped_channel_value 20 | test_fixture 21 | channel_numeric_operations) 22 | set(_test t_core_channel_${_name}) 23 | set(_target test_core_channel_${_name}) 24 | 25 | add_executable(${_target} "") 26 | target_sources(${_target} PRIVATE ${_name}.cpp) 27 | target_link_libraries(${_target} 28 | PRIVATE 29 | gil_compile_options 30 | gil_include_directories 31 | gil_dependencies) 32 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 33 | add_test(NAME ${_test} COMMAND ${_target}) 34 | 35 | unset(_name) 36 | unset(_target) 37 | endforeach() 38 | -------------------------------------------------------------------------------- /test/core/channel/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2018-2020 Mateusz Loskot 4 | # Copyright (c) 2021 Pranam Lashkari 5 | # 6 | # Distributed under the Boost Software License, Version 1.0. 7 | # (See accompanying file LICENSE_1_0.txt or 8 | # copy at http://www.boost.org/LICENSE_1_0.txt) 9 | 10 | import testing ; 11 | 12 | compile is_channel_integral.cpp ; 13 | 14 | run concepts.cpp ; 15 | run channel_traits.cpp ; 16 | run test_fixture.cpp ; 17 | run packed_channel_value.cpp ; 18 | run scoped_channel_value.cpp ; 19 | run channel_numeric_operations.cpp ; 20 | 21 | run algorithm_channel_arithmetic.cpp ; 22 | run algorithm_channel_convert.cpp ; 23 | run algorithm_channel_invert.cpp ; 24 | run algorithm_channel_multiply.cpp ; 25 | run algorithm_channel_relation.cpp ; 26 | -------------------------------------------------------------------------------- /test/core/channel/TODO.md: -------------------------------------------------------------------------------- 1 | # Channel TODO 2 | 3 | Issues and questions related to implementation, testing, etc. of channel: 4 | 5 | - Provide algorithm performance overloads for scoped channel and packed channels 6 | - Update concepts and documentation 7 | - What to do about pointer types?! 8 | - Performance!! 9 | - Is channel_convert the same as native? 10 | - Is operator++ on float32_t the same as native? How about if operator++ is defined in scoped_channel to do _value++? 11 | -------------------------------------------------------------------------------- /test/core/color/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | foreach(_name 9 | concepts 10 | color_spaces_are_compatible 11 | default_color_converter_impl 12 | default_color_converter_rgb_to_cmyk) 13 | set(_test t_core_color_${_name}) 14 | set(_target test_core_color_${_name}) 15 | 16 | add_executable(${_target} "") 17 | target_sources(${_target} PRIVATE ${_name}.cpp) 18 | target_link_libraries(${_target} 19 | PRIVATE 20 | gil_compile_options 21 | gil_include_directories 22 | gil_dependencies) 23 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 24 | add_test(NAME ${_test} COMMAND ${_target}) 25 | 26 | unset(_name) 27 | unset(_target) 28 | unset(_test) 29 | endforeach() 30 | -------------------------------------------------------------------------------- /test/core/color/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2019 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | compile concepts.cpp ; 12 | compile color_spaces_are_compatible.cpp ; 13 | compile-fail default_color_converter_impl_fail.cpp ; 14 | 15 | run default_color_converter_impl.cpp ; 16 | run default_color_converter_rgb_to_cmyk.cpp ; 17 | -------------------------------------------------------------------------------- /test/core/color/color_spaces_are_compatible.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2019 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | #include 19 | 20 | namespace gil = boost::gil; 21 | using namespace boost::mp11; 22 | 23 | template 24 | using test_self_compatible = gil::color_spaces_are_compatible; 25 | 26 | int main() 27 | { 28 | using color_spaces = mp_list 29 | < 30 | gil::devicen_t<2>, 31 | gil::devicen_t<3>, 32 | gil::devicen_t<4>, 33 | gil::devicen_t<5>, 34 | gil::gray_t, 35 | gil::cmyk_t, 36 | gil::rgb_t, 37 | gil::rgba_t 38 | >; 39 | 40 | static_assert(std::is_same 41 | < 42 | mp_all_of, 43 | std::true_type 44 | >::value, 45 | "color_spaces_are_compatible should yield true for the same types"); 46 | } 47 | -------------------------------------------------------------------------------- /test/core/color/default_color_converter_impl_fail.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | namespace gil = boost::gil; 20 | 21 | struct unknown_color_space {}; 22 | 23 | int main() 24 | { 25 | { 26 | gil::default_color_converter_impl c; 27 | boost::ignore_unused(c); 28 | } 29 | { 30 | gil::default_color_converter_impl c; 31 | boost::ignore_unused(c); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/core/color_base/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | foreach(_name 9 | concepts 10 | homogeneous_color_base 11 | static_transform) 12 | set(_test t_core_color_base_${_name}) 13 | set(_target test_core_color_base_${_name}) 14 | 15 | add_executable(${_target} "") 16 | target_sources(${_target} PRIVATE ${_name}.cpp) 17 | target_link_libraries(${_target} 18 | PRIVATE 19 | gil_compile_options 20 | gil_include_directories 21 | gil_dependencies) 22 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 23 | add_test(NAME ${_test} COMMAND ${_target}) 24 | 25 | unset(_name) 26 | unset(_target) 27 | unset(_test) 28 | endforeach() 29 | -------------------------------------------------------------------------------- /test/core/color_base/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2019 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | compile concepts.cpp ; 12 | compile-fail static_transform_gray_to_rgb_fail.cpp ; 13 | compile-fail static_transform_rgb_to_cmyk_fail.cpp ; 14 | 15 | run homogeneous_color_base.cpp ; 16 | run static_transform.cpp ; 17 | -------------------------------------------------------------------------------- /test/core/color_base/static_transform_gray_to_rgb_fail.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2019 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | namespace gil = boost::gil; 16 | 17 | int main() 18 | { 19 | // K-element index must be less than size of channel_mapping_t sequence 20 | // of the *destination* color base. 21 | 22 | // RGB (wider space) transformation to Gray (narrower space) takes only R channel value 23 | { 24 | gil::rgb8_pixel_t src{ 32, 64, 128 }; 25 | gil::gray8_pixel_t dst{ 0 }; 26 | gil::static_transform(src, dst, [](std::uint8_t src_channel) { 27 | return src_channel; // copy 28 | }); 29 | assert(gil::at_c<0>(dst) == std::uint16_t{32}); 30 | } 31 | 32 | // Gray (narrower space) to RGB (wider space) transformation FAILS to compile 33 | { 34 | gil::gray8_pixel_t src{32}; 35 | gil::rgb8_pixel_t dst{0, 0, 0}; 36 | gil::static_transform(src, dst, [](std::uint8_t src_channel) { 37 | return src_channel; // copy 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/core/histogram/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Debabrata Mandal 3 | # 4 | # Distributed under the Boost Software License, Version 1.0 5 | # See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt 7 | # 8 | 9 | foreach(_name 10 | access 11 | constructor 12 | cumulative 13 | dimension 14 | fill 15 | hash_tuple 16 | helpers 17 | is_compatible 18 | key 19 | sub_histogram 20 | utilities) 21 | set(_test t_core_histogram_${_name}) 22 | set(_target test_core_histogram_${_name}) 23 | 24 | add_executable(${_target} "") 25 | target_sources(${_target} PRIVATE ${_name}.cpp) 26 | target_link_libraries(${_target} 27 | PRIVATE 28 | gil_compile_options 29 | gil_include_directories 30 | gil_dependencies) 31 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 32 | add_test(NAME ${_test} COMMAND ${_target}) 33 | 34 | unset(_name) 35 | unset(_target) 36 | unset(_test) 37 | endforeach() 38 | -------------------------------------------------------------------------------- /test/core/histogram/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Debabrata Mandal 3 | # 4 | # Distributed under the Boost Software License, Version 1.0 5 | # See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt 7 | # 8 | 9 | import testing ; 10 | 11 | compile constructor.cpp ; 12 | compile dimension.cpp ; 13 | run access.cpp ; 14 | run cumulative.cpp ; 15 | run fill.cpp ; 16 | run hash_tuple.cpp ; 17 | run helpers.cpp ; 18 | run is_compatible.cpp ; 19 | run key.cpp ; 20 | run sub_histogram.cpp ; 21 | run utilities.cpp ; 22 | -------------------------------------------------------------------------------- /test/core/histogram/access.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Debabrata Mandal 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace gil = boost::gil; 16 | 17 | void check_indexing_operator() 18 | { 19 | gil::histogram h1; 20 | h1(1) = 3; 21 | BOOST_TEST(h1(1) == 3); 22 | BOOST_TEST(h1(3) == 0); 23 | 24 | gil::histogram h2; 25 | h2(1, 'a', "A") = 4; 26 | BOOST_TEST(h2(1, 'a', "A") == 4); 27 | BOOST_TEST(h2(1, 'a', "B") == 0); 28 | } 29 | 30 | int main() { 31 | 32 | check_indexing_operator(); 33 | 34 | return boost::report_errors(); 35 | } 36 | -------------------------------------------------------------------------------- /test/core/histogram/constructor.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Debabrata Mandal 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #include 10 | 11 | #include 12 | 13 | namespace gil = boost::gil; 14 | namespace mp11 = boost::mp11; 15 | 16 | void check_histogram_constructors() 17 | { 18 | gil::histogram h1; 19 | gil::histogram h2 = h1; 20 | gil::histogram h3; 21 | gil::histogram h4(h3); 22 | 23 | gil::histogram d1, d2 = d1, d3(d2); 24 | } 25 | 26 | int main() { 27 | 28 | check_histogram_constructors(); 29 | return 0; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /test/core/histogram/cumulative.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Debabrata Mandal 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #include 10 | 11 | #include 12 | 13 | namespace gil = boost::gil; 14 | 15 | void check_cumulative() 16 | { 17 | gil::histogram h1; 18 | for (int i = 0; i < 8; i++) 19 | { 20 | h1(i) = 1; 21 | } 22 | auto h2 = cumulative_histogram(h1); 23 | bool check1 = true; 24 | for (int i = 0; i < 8; i++) 25 | { 26 | if(h2(i) != i+1) 27 | check1 = false; 28 | } 29 | BOOST_TEST(check1); 30 | 31 | gil::histogram h3; 32 | h3(1, 3) = 1; 33 | h3(1, 4) = 2; 34 | h3(2, 1) = 3; 35 | h3(2, 2) = 1; 36 | h3(2, 5) = 2; 37 | h3(3, 2) = 3; 38 | h3(3, 9) = 1; 39 | auto h4 = cumulative_histogram(h3); 40 | BOOST_TEST(h4(1, 3) == 1); 41 | BOOST_TEST(h4(1, 4) == 3); 42 | BOOST_TEST(h4(2, 1) == 3); 43 | BOOST_TEST(h4(2, 2) == 4); 44 | BOOST_TEST(h4(2, 5) == 9); 45 | BOOST_TEST(h4(3, 2) == 7); 46 | BOOST_TEST(h4(3, 9) == 13); 47 | } 48 | 49 | int main() { 50 | 51 | check_cumulative(); 52 | 53 | return boost::report_errors(); 54 | } 55 | -------------------------------------------------------------------------------- /test/core/histogram/dimension.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Debabrata Mandal 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #include 10 | 11 | namespace gil = boost::gil; 12 | namespace mp11 = boost::mp11; 13 | 14 | void check_histogram_constructors() 15 | { 16 | gil::histogram h1; 17 | gil::histogram h2 = h1; 18 | gil::histogram h3; 19 | gil::histogram h4(h3); 20 | 21 | static_assert(h1.dimension() == h2.dimension(),"Dimension mismatch"); 22 | static_assert(h1.dimension() != h3.dimension(),"Dimension mismatch"); 23 | static_assert(h3.dimension() == h4.dimension(),"Dimension mismatch"); 24 | } 25 | 26 | int main() { 27 | 28 | check_histogram_constructors(); 29 | return 0; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /test/core/histogram/hash_tuple.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Debabrata Mandal 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | namespace gil = boost::gil; 17 | namespace mp11 = boost::mp11; 18 | 19 | void check_detail_hash_tuple () 20 | { 21 | std::tuple t(1, 1); 22 | std::size_t seed1 = 0; 23 | boost::hash_combine(seed1, std::get<0>(t)); 24 | boost::hash_combine(seed1, std::get<1>(t)); 25 | 26 | gil::detail::hash_tuple g; 27 | std::size_t seed2 = g(t); 28 | BOOST_TEST(seed1 == seed2); 29 | } 30 | 31 | int main() 32 | { 33 | check_detail_hash_tuple(); 34 | return boost::report_errors(); 35 | } 36 | -------------------------------------------------------------------------------- /test/core/image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | foreach(_name 9 | concepts 10 | alignment 11 | empty_dimensions 12 | image) 13 | set(_test t_core_image_${_name}) 14 | set(_target test_core_image_${_name}) 15 | 16 | add_executable(${_target} "") 17 | target_sources(${_target} PRIVATE ${_name}.cpp) 18 | target_link_libraries(${_target} 19 | PRIVATE 20 | gil_compile_options 21 | gil_include_directories 22 | gil_dependencies) 23 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 24 | add_test(NAME ${_test} COMMAND ${_target}) 25 | 26 | unset(_name) 27 | unset(_target) 28 | unset(_test) 29 | endforeach() 30 | -------------------------------------------------------------------------------- /test/core/image/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2019 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | compile concepts.cpp ; 12 | 13 | run alignment.cpp ; 14 | run empty_dimensions.cpp ; 15 | run image.cpp ; -------------------------------------------------------------------------------- /test/core/image/concepts.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2019 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // FIXME: Avoid Clang's flooding of non-disableable warnings like: 9 | // "T does not declare any constructor to initialize its non-modifiable members" 10 | // when compiling with concepts check enabled. 11 | // See https://bugs.llvm.org/show_bug.cgi?id=41759 12 | #if !defined(BOOST_GIL_USE_CONCEPT_CHECK) && !defined(__clang__) 13 | #error Compile with BOOST_GIL_USE_CONCEPT_CHECK defined 14 | #endif 15 | #include 16 | 17 | #include 18 | 19 | #include 20 | 21 | namespace gil = boost::gil; 22 | using boost::function_requires; 23 | 24 | int main() 25 | { 26 | function_requires>(); 27 | function_requires>(); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /test/core/image_processing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright 2019 Miral Shah 4 | # Copyright 2021 Pranam Lashkari 5 | # 6 | # Use, modification and distribution are subject to the Boost Software License, 7 | # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 8 | # http://www.boost.org/LICENSE_1_0.txt) 9 | # 10 | foreach(_name 11 | threshold_binary 12 | threshold_truncate 13 | threshold_otsu 14 | morphology 15 | lanczos_scaling 16 | simple_kernels 17 | harris 18 | hessian 19 | box_filter 20 | median_filter 21 | sobel_scharr 22 | convolve 23 | convolve_2d 24 | convolve_cols 25 | convolve_rows 26 | kernel 27 | kernel_fixed) 28 | set(_test t_core_image_processing_${_name}) 29 | set(_target test_core_image_processing_${_name}) 30 | 31 | add_executable(${_target} "") 32 | target_sources(${_target} PRIVATE ${_name}.cpp) 33 | target_link_libraries(${_target} 34 | PRIVATE 35 | gil_compile_options 36 | gil_include_directories 37 | gil_dependencies) 38 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 39 | add_test(NAME ${_test} COMMAND ${_target}) 40 | 41 | unset(_name) 42 | unset(_target) 43 | unset(_test) 44 | endforeach() 45 | -------------------------------------------------------------------------------- /test/core/image_processing/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright 2019 Miral Shah 4 | # Copyright 2021 Pranam Lashkari 5 | # 6 | # Use, modification and distribution are subject to the Boost Software License, 7 | # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 8 | # http://www.boost.org/LICENSE_1_0.txt) 9 | # 10 | import testing ; 11 | 12 | compile-fail threshold_color_spaces_not_compatible_fail.cpp ; 13 | compile-fail kernel_1d_fixed_even_size_fail.cpp ; 14 | run threshold_binary.cpp ; 15 | run threshold_truncate.cpp ; 16 | run threshold_otsu.cpp ; 17 | run lanczos_scaling.cpp ; 18 | run simple_kernels.cpp ; 19 | run harris.cpp ; 20 | run hessian.cpp ; 21 | run sobel_scharr.cpp ; 22 | run box_filter.cpp ; 23 | run median_filter.cpp ; 24 | run morphology.cpp ; 25 | run convolve.cpp ; 26 | run convolve_2d.cpp ; 27 | run convolve_cols.cpp ; 28 | run convolve_rows.cpp ; 29 | run kernel.cpp ; 30 | run kernel_fixed.cpp ; 31 | -------------------------------------------------------------------------------- /test/core/image_processing/kernel_1d_fixed_even_size_fail.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2019 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | 10 | namespace gil = boost::gil; 11 | 12 | int main() 13 | { 14 | gil::kernel_1d_fixed k0; 15 | gil::kernel_1d_fixed k4; 16 | } 17 | -------------------------------------------------------------------------------- /test/core/image_processing/test_fixture.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2019 Mateusz Loskot 3 | // Copyright 2021 Pranam Lashkari 4 | // 5 | // Distributed under the Boost Software License, Version 1.0 6 | // See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | // 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { namespace gil { 17 | 18 | namespace test { namespace fixture { 19 | 20 | template 21 | auto create_kernel(std::initializer_list const& values) 22 | -> gil::kernel_1d 23 | { 24 | static_assert(std::is_arithmetic::value, 25 | "kernel value type should be integral or floating-point type"); 26 | BOOST_ASSERT_MSG((values.size() - 1) % 2 == 0, "expected odd number of kernel values"); 27 | gil::kernel_1d kernel(values.begin(), values.size(), (values.size() - 1) / 2); 28 | return kernel; 29 | } 30 | 31 | }}}} // namespace boost::gil::test::fixture 32 | -------------------------------------------------------------------------------- /test/core/image_processing/threshold_color_spaces_not_compatible_fail.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2019 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | 10 | namespace gil = boost::gil; 11 | 12 | int main() 13 | { 14 | // Source and destination views must have pixels with the same (compatible) color space 15 | { 16 | gil::rgb8_image_t src; 17 | gil::gray8_image_t dst; 18 | gil::threshold_binary(const_view(src), view(dst), 0, 255); 19 | } 20 | { 21 | gil::gray8_image_t src; 22 | gil::rgb8_image_t dst; 23 | gil::threshold_binary(const_view(src), view(dst), 0, 255); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/core/image_view/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | foreach(_name 9 | axis_iterator 10 | collection 11 | concepts 12 | derived_view_type 13 | dynamic_step 14 | is_planar 15 | is_1d_traversable 16 | iterator 17 | planar_rgba_view 18 | reverse_iterator 19 | subimage_view 20 | view_is_basic 21 | view_is_mutable 22 | view_is_step 23 | view_type 24 | x_iterator 25 | xy_locator 26 | y_iterator 27 | view_type_from_pixel) 28 | set(_test t_core_image_view_${_name}) 29 | set(_target test_core_image_view_${_name}) 30 | 31 | add_executable(${_target} "") 32 | target_sources(${_target} PRIVATE ${_name}.cpp) 33 | target_link_libraries(${_target} 34 | PRIVATE 35 | gil_compile_options 36 | gil_include_directories 37 | gil_dependencies) 38 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 39 | add_test(NAME ${_test} COMMAND ${_target}) 40 | 41 | unset(_name) 42 | unset(_target) 43 | unset(_test) 44 | endforeach() 45 | -------------------------------------------------------------------------------- /test/core/image_view/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2018 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | compile concepts.cpp ; 12 | compile derived_view_type.cpp ; 13 | compile dynamic_step.cpp ; 14 | compile is_planar.cpp ; 15 | compile view_is_basic.cpp ; 16 | compile view_is_mutable.cpp ; 17 | compile view_is_step.cpp ; 18 | compile view_type.cpp ; 19 | compile view_type_from_pixel.cpp ; 20 | 21 | run axis_iterator.cpp ; 22 | run collection.cpp ; 23 | run is_1d_traversable.cpp ; 24 | run iterator.cpp ; 25 | run planar_rgba_view.cpp ; 26 | run reverse_iterator.cpp ; 27 | run subimage_view.cpp ; 28 | run x_iterator.cpp ; 29 | run xy_locator.cpp ; 30 | run y_iterator.cpp ; 31 | -------------------------------------------------------------------------------- /test/core/image_view/test_fixture.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | #include 11 | 12 | namespace boost { namespace gil { namespace test { namespace fixture { 13 | 14 | gil::gray8_pixel_t gray8_back_pixel{128}; 15 | gil::gray8_pixel_t gray8_draw_pixel{64}; 16 | gil::rgb8_pixel_t rgb8_back_pixel{255, 128, 64}; 17 | gil::rgb8_pixel_t rgb8_draw_pixel{64, 32, 16}; 18 | 19 | auto make_image_gray8() -> gil::gray8_image_t 20 | { 21 | gil::gray8_image_t image(2, 2, gray8_back_pixel); 22 | auto view = gil::view(image); 23 | view(0, 0) = gray8_draw_pixel; 24 | view(1, 1) = gray8_draw_pixel; 25 | return image; 26 | } 27 | 28 | auto make_image_rgb8() -> gil::rgb8_image_t 29 | { 30 | gil::rgb8_image_t image(2, 2, rgb8_back_pixel); 31 | auto view = gil::view(image); 32 | view(0, 0) = rgb8_draw_pixel; 33 | view(1, 1) = rgb8_draw_pixel; 34 | return image; 35 | } 36 | 37 | }}}} 38 | -------------------------------------------------------------------------------- /test/core/io/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Dirk Stolle 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | foreach(_name 9 | path_spec) 10 | set(_test t_core_io_${_name}) 11 | set(_target test_core_io_${_name}) 12 | 13 | add_executable(${_target} "") 14 | target_sources(${_target} PRIVATE ${_name}.cpp) 15 | target_link_libraries(${_target} 16 | PRIVATE 17 | gil_compile_options 18 | gil_include_directories 19 | gil_dependencies) 20 | add_test(NAME ${_test} COMMAND ${_target}) 21 | 22 | unset(_name) 23 | unset(_target) 24 | unset(_test) 25 | endforeach() 26 | -------------------------------------------------------------------------------- /test/core/io/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2024 Dirk Stolle 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | compile path_spec.cpp ; 12 | 13 | run path_spec.cpp ; 14 | -------------------------------------------------------------------------------- /test/core/iterator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | foreach(_name 9 | concepts 10 | dynamic_step 11 | is_planar) 12 | set(_test t_core_iterator_${_name}) 13 | set(_target test_core_iterator_${_name}) 14 | 15 | add_executable(${_target} "") 16 | target_sources(${_target} PRIVATE ${_name}.cpp) 17 | target_link_libraries(${_target} 18 | PRIVATE 19 | gil_compile_options 20 | gil_include_directories 21 | gil_dependencies) 22 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 23 | add_test(NAME ${_test} COMMAND ${_target}) 24 | 25 | unset(_name) 26 | unset(_target) 27 | unset(_test) 28 | endforeach() 29 | -------------------------------------------------------------------------------- /test/core/iterator/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2019 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | compile concepts.cpp ; 12 | compile dynamic_step.cpp ; 13 | compile is_planar.cpp ; 14 | -------------------------------------------------------------------------------- /test/core/locator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | foreach(_name 9 | concepts 10 | dynamic_step) 11 | set(_test t_core_locator_${_name}) 12 | set(_target test_core_locator_${_name}) 13 | 14 | add_executable(${_target} "") 15 | target_sources(${_target} PRIVATE ${_name}.cpp) 16 | target_link_libraries(${_target} 17 | PRIVATE 18 | gil_compile_options 19 | gil_include_directories 20 | gil_dependencies) 21 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 22 | add_test(NAME ${_test} COMMAND ${_target}) 23 | 24 | unset(_name) 25 | unset(_target) 26 | unset(_test) 27 | endforeach() 28 | -------------------------------------------------------------------------------- /test/core/locator/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2019 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | compile concepts.cpp ; 12 | compile dynamic_step.cpp ; 13 | -------------------------------------------------------------------------------- /test/core/pixel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Mateusz Loskot 3 | # Copyright (c) 2021 Pranam Lashkari 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt) 8 | # 9 | foreach(_name 10 | bit_aligned_pixel_reference 11 | color_convert_cmyk 12 | concepts 13 | is_pixel 14 | is_planar 15 | num_channels 16 | packed_pixel 17 | pixel_reference_is_mutable 18 | pixels_are_compatible 19 | test_fixture 20 | pixel_numeric_operations 21 | pixel_numeric_operations_float) 22 | set(_test t_core_pixel_${_name}) 23 | set(_target test_core_pixel_${_name}) 24 | 25 | add_executable(${_target} "") 26 | target_sources(${_target} PRIVATE ${_name}.cpp) 27 | target_link_libraries(${_target} 28 | PRIVATE 29 | gil_compile_options 30 | gil_include_directories 31 | gil_dependencies) 32 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 33 | add_test(NAME ${_test} COMMAND ${_target}) 34 | 35 | unset(_name) 36 | unset(_target) 37 | unset(_test) 38 | endforeach() 39 | -------------------------------------------------------------------------------- /test/core/pixel/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2019 Mateusz Loskot 4 | # Copyright (c) 2021 Pranam Lashkari 5 | # 6 | # Distributed under the Boost Software License, Version 1.0. 7 | # (See accompanying file LICENSE_1_0.txt or 8 | # copy at http://www.boost.org/LICENSE_1_0.txt) 9 | 10 | import testing ; 11 | 12 | compile bit_aligned_pixel_reference.cpp ; 13 | compile concepts.cpp ; 14 | compile is_pixel.cpp ; 15 | compile is_planar.cpp ; 16 | compile num_channels.cpp ; 17 | compile pixel_reference_is_mutable.cpp ; 18 | compile pixels_are_compatible.cpp ; 19 | 20 | run color_convert_cmyk.cpp ; 21 | run packed_pixel.cpp ; 22 | run test_fixture.cpp ; 23 | run pixel_numeric_operations.cpp ; 24 | run pixel_numeric_operations_float.cpp ; 25 | -------------------------------------------------------------------------------- /test/core/pixel/pixel_reference_is_mutable.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2019 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | 11 | #include "test_fixture.hpp" 12 | 13 | namespace gil = boost::gil; 14 | using namespace boost::mp11; 15 | 16 | int main() 17 | { 18 | static_assert(mp_all_of 19 | < 20 | gil::test::fixture::pixel_typedefs, 21 | gil::pixel_reference_is_mutable 22 | >::value, 23 | "pixel_reference_is_mutable should yield true for all core pixel typedefs"); 24 | 25 | static_assert(!mp_all_of 26 | < 27 | mp_transform 28 | < 29 | gil::test::fixture::nested_type, 30 | gil::test::fixture::representative_pixel_types 31 | >, 32 | gil::pixel_reference_is_mutable 33 | >::value, 34 | "pixel_reference_is_mutable should yield true for some representative core pixel types"); 35 | } 36 | -------------------------------------------------------------------------------- /test/core/point/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | foreach(_name 9 | concepts 10 | point) 11 | set(_test t_core_point_${_name}) 12 | set(_target test_core_point_${_name}) 13 | 14 | add_executable(${_target} "") 15 | target_sources(${_target} PRIVATE ${_name}.cpp) 16 | target_link_libraries(${_target} 17 | PRIVATE 18 | gil_compile_options 19 | gil_include_directories 20 | gil_dependencies) 21 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 22 | add_test(NAME ${_test} COMMAND ${_target}) 23 | 24 | unset(_name) 25 | unset(_target) 26 | unset(_test) 27 | endforeach() 28 | -------------------------------------------------------------------------------- /test/core/point/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2018 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | compile concepts.cpp ; 12 | compile-fail multiply_by_non_arithmetic_fail.cpp ; 13 | 14 | run point.cpp ; 15 | -------------------------------------------------------------------------------- /test/core/point/multiply_by_non_arithmetic_fail.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2018 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | 10 | #include 11 | 12 | namespace gil = boost::gil; 13 | 14 | struct FakeMatrix {}; 15 | 16 | int main() 17 | { 18 | gil::point p1{2, 4}; 19 | 20 | FakeMatrix m1; 21 | auto r1 = p1 * m1; 22 | auto r2 = m1 * p1; 23 | } 24 | -------------------------------------------------------------------------------- /test/core/point/test_fixture.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2022 Marco Langer 3 | // 4 | // Use, modification and distribution are subject to the Boost Software License, 5 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | #include 10 | 11 | #include 12 | 13 | namespace boost { namespace gil { 14 | 15 | // necessary to use point directly with boost test macros 16 | template 17 | auto operator<<(std::ostream& os, point const& p) -> std::ostream& 18 | { 19 | return os << "{x=" << p.x << ", y=" << p.y << "}"; 20 | } 21 | 22 | }} // namespace boost::gil 23 | -------------------------------------------------------------------------------- /test/core/virtual_2d_locator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2022 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | foreach(_name 9 | is_2d_traversable) 10 | set(_test t_core_virtual_2d_locator_${_name}) 11 | set(_target test_core_virtual_2d_locator_${_name}) 12 | 13 | add_executable(${_target} "") 14 | target_sources(${_target} PRIVATE ${_name}.cpp) 15 | target_link_libraries(${_target} 16 | PRIVATE 17 | gil_compile_options 18 | gil_include_directories 19 | gil_dependencies) 20 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 21 | add_test(NAME ${_test} COMMAND ${_target}) 22 | 23 | unset(_name) 24 | unset(_target) 25 | unset(_test) 26 | endforeach() 27 | -------------------------------------------------------------------------------- /test/core/virtual_2d_locator/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright (c) 2022 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | run is_2d_traversable.cpp ; 12 | -------------------------------------------------------------------------------- /test/core/virtual_2d_locator/is_2d_traversable.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2022 Mateusz Loskot 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | 10 | #include 11 | 12 | #include "test_fixture.hpp" 13 | #include "core/pixel/test_fixture.hpp" 14 | 15 | namespace gil = boost::gil; 16 | namespace fixture = boost::gil::test::fixture; 17 | 18 | struct test_pixel_types 19 | { 20 | template 21 | void operator()(Pixel const&) 22 | { 23 | using deref_t = fixture::noop_dereference_fn; 24 | using locator_t = gil::virtual_2d_locator; 25 | using view_t = gil::image_view; 26 | 27 | view_t view; 28 | BOOST_TEST(!view.is_1d_traversable()); 29 | } 30 | static void run() 31 | { 32 | boost::mp11::mp_for_each(test_pixel_types{}); 33 | } 34 | }; 35 | 36 | int main() 37 | { 38 | test_pixel_types::run(); 39 | 40 | return boost::report_errors(); 41 | } 42 | -------------------------------------------------------------------------------- /test/extension/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | if(BOOST_GIL_ENABLE_EXT_RASTERIZATION) 9 | add_subdirectory(rasterization) 10 | endif() 11 | 12 | if(BOOST_GIL_ENABLE_EXT_IMAGE_PROCESSING) 13 | add_subdirectory(image_processing) 14 | endif() 15 | 16 | if(BOOST_GIL_ENABLE_EXT_DYNAMIC_IMAGE) 17 | add_subdirectory(dynamic_image) 18 | endif() 19 | 20 | if(BOOST_GIL_ENABLE_EXT_HISTOGRAM) 21 | add_subdirectory(histogram) 22 | endif() 23 | 24 | if(BOOST_GIL_ENABLE_EXT_NUMERIC) 25 | add_subdirectory(numeric) 26 | endif() 27 | 28 | if(BOOST_GIL_ENABLE_EXT_TOOLBOX) 29 | add_subdirectory(toolbox) 30 | endif() 31 | 32 | if(BOOST_GIL_ENABLE_EXT_IO) 33 | add_subdirectory(io) 34 | endif() 35 | -------------------------------------------------------------------------------- /test/extension/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - extensions tests 2 | # 3 | # Copyright (c) 2019 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | build-project dynamic_image ; 10 | build-project histogram ; 11 | build-project numeric ; 12 | build-project toolbox ; 13 | build-project io ; 14 | build-project image_processing ; 15 | build-project rasterization ; 16 | -------------------------------------------------------------------------------- /test/extension/dynamic_image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019 Mateusz Loskot 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | message(STATUS "Boost.GIL: Configuring tests in test/extension/dynamic_image") 9 | foreach(_name 10 | any_image 11 | any_image_view 12 | subimage_view) 13 | set(_test t_ext_dynamic_image_${_name}) 14 | set(_target test_ext_dynamic_image_${_name}) 15 | 16 | add_executable(${_target} "") 17 | target_sources(${_target} PRIVATE ${_name}.cpp) 18 | target_link_libraries(${_target} 19 | PRIVATE 20 | gil_compile_options 21 | gil_include_directories 22 | gil_dependencies) 23 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 24 | add_test(NAME ${_test} COMMAND ${_target}) 25 | 26 | unset(_name) 27 | unset(_target) 28 | unset(_test) 29 | endforeach() 30 | -------------------------------------------------------------------------------- /test/extension/dynamic_image/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - dynamic_image tests 2 | # 3 | # Copyright (c) 2019 Mateusz Loskot 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | alias headers : [ generate_self_contained_headers extension/dynamic_image ] ; 12 | 13 | run any_image.cpp ; 14 | run any_image_view.cpp ; 15 | run image_view_factory.cpp ; 16 | run subimage_view.cpp ; 17 | 18 | build-project algorithm ; 19 | -------------------------------------------------------------------------------- /test/extension/dynamic_image/algorithm/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright 2022 Marco Langer 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or 7 | # copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | run copy_and_convert_pixels.cpp ; 12 | run copy_pixels.cpp ; 13 | run equal_pixels.cpp ; 14 | run fill_pixels.cpp ; 15 | run for_each_pixel.cpp ; 16 | -------------------------------------------------------------------------------- /test/extension/histogram/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Debabrata Mandal 3 | # 4 | # Distributed under the Boost Software License, Version 1.0 5 | # See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt 7 | # 8 | 9 | foreach(_name 10 | histogram) 11 | set(_test t_core_histogram_${_name}) 12 | set(_target test_core_histogram_${_name}) 13 | 14 | add_executable(${_target} "") 15 | target_sources(${_target} PRIVATE ${_name}.cpp) 16 | target_link_libraries(${_target} 17 | PRIVATE 18 | gil_compile_options 19 | gil_include_directories 20 | gil_dependencies) 21 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 22 | add_test(NAME ${_test} COMMAND ${_target}) 23 | 24 | unset(_name) 25 | unset(_target) 26 | unset(_test) 27 | endforeach() 28 | -------------------------------------------------------------------------------- /test/extension/histogram/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Debabrata Mandal 3 | # 4 | # Distributed under the Boost Software License, Version 1.0 5 | # See accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt 7 | # 8 | 9 | import testing ; 10 | 11 | run histogram.cpp ; 12 | -------------------------------------------------------------------------------- /test/extension/image_processing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | foreach(_name 2 | anisotropic_diffusion 3 | hough_circle_transform 4 | hough_line_transform 5 | hough_parameter) 6 | set(_test t_ext_image_processing_${_name}) 7 | set(_target test_ext_image_processing_${_name}) 8 | 9 | add_executable(${_target} "") 10 | target_sources(${_target} PRIVATE ${_name}.cpp) 11 | target_link_libraries(${_target} 12 | PRIVATE 13 | gil_compile_options 14 | gil_include_directories 15 | gil_dependencies) 16 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 17 | add_test(NAME ${_test} COMMAND ${_target}) 18 | 19 | unset(_name) 20 | unset(_target) 21 | unset(_test) 22 | endforeach() 23 | -------------------------------------------------------------------------------- /test/extension/image_processing/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright 2020 Olzhas Zhumabek 4 | # 5 | # Use, modification and distribution are subject to the Boost Software License, 6 | # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt) 8 | # 9 | import testing ; 10 | 11 | run anisotropic_diffusion.cpp ; 12 | run hough_circle_transform.cpp ; 13 | run hough_line_transform.cpp ; 14 | run hough_parameter.cpp ; -------------------------------------------------------------------------------- /test/extension/io/.gitignore: -------------------------------------------------------------------------------- 1 | /output/*.bmp 2 | /output/*.crw 3 | /output/*.jpg 4 | /output/*.jpeg 5 | /output/*.png 6 | /output/*.pnm 7 | /output/*.tga 8 | /output/*.tif 9 | /output/*.tiff 10 | -------------------------------------------------------------------------------- /test/extension/io/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017-2020 Mateusz Loskot 3 | # All rights reserved. 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # (See accompanying file LICENSE_1_0.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt) 8 | # 9 | message(STATUS "Boost.GIL: Configuring tests in test/extension/io") 10 | 11 | add_executable(test_ext_io_simple "simple_all_formats.cpp") 12 | target_link_libraries(test_ext_io_simple 13 | PRIVATE 14 | gil_compile_options 15 | gil_include_directories 16 | gil_dependencies) 17 | add_test(NAME t_ext_io_simple COMMAND test_ext_io_simple) 18 | 19 | # TODO: Add /CMakeLists.txt configuration for each format ~mloskot 20 | -------------------------------------------------------------------------------- /test/extension/io/bmp/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - IO tests 2 | # 3 | # Copyright (c) 2012 Christian Henning 4 | # Copyright (c) 2017 Stefan Seefeld 5 | # Copyright (c) 2012-2020 Mateusz Loskot 6 | # 7 | # Distributed under the Boost Software License, Version 1.0. 8 | # (See accompanying file LICENSE_1_0.txt or 9 | # copy at http://www.boost.org/LICENSE_1_0.txt) 10 | 11 | import testing ; 12 | 13 | # TODO: Download BMP test suite images and build with BOOST_GIL_IO_USE_BMP_TEST_SUITE_IMAGES 14 | 15 | project 16 | : requirements 17 | /boost/filesystem//boost_filesystem 18 | ; 19 | 20 | run bmp_make.cpp ; 21 | 22 | run bmp_test.cpp ; 23 | run bmp_read_test.cpp ; 24 | run bmp_write_test.cpp ; 25 | 26 | run bmp_old_test.cpp ; 27 | -------------------------------------------------------------------------------- /test/extension/io/cmp_view.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_IO_TEST_EXTENSION_IO_CMP_VIEW_HPP 9 | #define BOOST_GIL_IO_TEST_EXTENSION_IO_CMP_VIEW_HPP 10 | 11 | #include 12 | 13 | #include 14 | 15 | template 16 | void cmp_view(View1 const& v1, View2 const& v2) 17 | { 18 | if (v1.dimensions() != v2.dimensions()) 19 | throw std::runtime_error("Images are not equal."); 20 | 21 | typename View1::x_coord_t width = v1.width(); 22 | typename View1::y_coord_t height = v1.height(); 23 | 24 | for (typename View1::y_coord_t y = 0; y < height; ++y) 25 | { 26 | typename View1::x_iterator const src_it = v1.row_begin(y); 27 | typename View2::x_iterator const dst_it = v2.row_begin(y); 28 | 29 | for (typename View1::x_coord_t x = 0; x < width; ++x) 30 | { 31 | if (*src_it != *dst_it) 32 | throw std::runtime_error("Images are not equal."); 33 | } 34 | } 35 | } 36 | 37 | #endif // BOOST_GIL_IO_TEST_EXTENSION_IO_CMP_VIEW_HPP 38 | -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g01bg.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g01bg.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g01bw.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g01bw.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g01p1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g01p1.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g01wb.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g01wb.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g04.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g04.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g04p4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g04p4.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g04rle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g04rle.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08offs.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08offs.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08os2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08os2.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08p256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08p256.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08p64.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08p64.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08pi256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08pi256.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08pi64.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08pi64.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08res11.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08res11.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08res21.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08res21.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08res22.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08res22.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08rle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08rle.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08s0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08s0.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08w124.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08w124.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08w125.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08w125.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g08w126.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g08w126.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g16bf555.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g16bf555.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g16bf565.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g16bf565.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g16def555.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g16def555.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g24.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g32bf.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g32bf.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/g32def.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/g32def.bmp -------------------------------------------------------------------------------- /test/extension/io/images/bmp/readme.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Christian Henning 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # See www.boost.org/LICENSE_1_0.txt 4 | 5 | Image were found at http://entropymine.com/jason/bmpsuite/ . -------------------------------------------------------------------------------- /test/extension/io/images/bmp/test.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/bmp/test.bmp -------------------------------------------------------------------------------- /test/extension/io/images/jpeg/EddDawson/36dpi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/jpeg/EddDawson/36dpi.jpg -------------------------------------------------------------------------------- /test/extension/io/images/jpeg/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/jpeg/test.jpg -------------------------------------------------------------------------------- /test/extension/io/images/png/EddDawson/36dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/EddDawson/36dpi.png -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/readme.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Christian Henning 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # See www.boost.org/LICENSE_1_0.txt 4 | 5 | test images can be found at http://www.schaik.com/pngsuite/pngsuite.html 6 | 7 | if not available please send me an email at chhenning ** at ** gmail.com -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/tbbn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/PngSuite/tbbn0g04.png -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/tbbn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/PngSuite/tbbn2c16.png -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/tbbn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/PngSuite/tbbn3p08.png -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/tbgn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/PngSuite/tbgn2c16.png -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/tbgn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/PngSuite/tbgn3p08.png -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/tbrn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/PngSuite/tbrn2c08.png -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/tbwn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/PngSuite/tbwn0g16.png -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/tm3n3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/PngSuite/tm3n3p02.png -------------------------------------------------------------------------------- /test/extension/io/images/png/PngSuite/tp1n3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/PngSuite/tp1n3p08.png -------------------------------------------------------------------------------- /test/extension/io/images/png/grayscale-with-tRNS-chunk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/grayscale-with-tRNS-chunk.png -------------------------------------------------------------------------------- /test/extension/io/images/png/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/png/test.png -------------------------------------------------------------------------------- /test/extension/io/images/pnm/p4.pnm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/pnm/p4.pnm -------------------------------------------------------------------------------- /test/extension/io/images/pnm/p5.pnm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/pnm/p5.pnm -------------------------------------------------------------------------------- /test/extension/io/images/pnm/p6.pnm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/pnm/p6.pnm -------------------------------------------------------------------------------- /test/extension/io/images/pnm/rgb.pnm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/pnm/rgb.pnm -------------------------------------------------------------------------------- /test/extension/io/images/raw/RAW_CANON_D30_SRGB.CRW: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/raw/RAW_CANON_D30_SRGB.CRW -------------------------------------------------------------------------------- /test/extension/io/images/raw/readme.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Christian Henning 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # See www.boost.org/LICENSE_1_0.txt 4 | 5 | Images are taken from http://www.rawsamples.ch/index_en.php -------------------------------------------------------------------------------- /test/extension/io/images/readme.md: -------------------------------------------------------------------------------- 1 | For copyright reasons the complete is available here: 2 | 3 | https://github.com/chhenning/gil_io_images -------------------------------------------------------------------------------- /test/extension/io/images/targa/24BPP_compressed.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/targa/24BPP_compressed.tga -------------------------------------------------------------------------------- /test/extension/io/images/targa/24BPP_compressed_ul_origin.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/targa/24BPP_compressed_ul_origin.tga -------------------------------------------------------------------------------- /test/extension/io/images/targa/24BPP_uncompressed.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/targa/24BPP_uncompressed.tga -------------------------------------------------------------------------------- /test/extension/io/images/targa/24BPP_uncompressed_ul_origin.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/targa/24BPP_uncompressed_ul_origin.tga -------------------------------------------------------------------------------- /test/extension/io/images/targa/32BPP_compressed.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/targa/32BPP_compressed.tga -------------------------------------------------------------------------------- /test/extension/io/images/targa/32BPP_compressed_ul_origin.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/targa/32BPP_compressed_ul_origin.tga -------------------------------------------------------------------------------- /test/extension/io/images/targa/32BPP_uncompressed.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/targa/32BPP_uncompressed.tga -------------------------------------------------------------------------------- /test/extension/io/images/targa/32BPP_uncompressed_ul_origin.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/targa/32BPP_uncompressed_ul_origin.tga -------------------------------------------------------------------------------- /test/extension/io/images/targa/fileformat_info/readme.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Christian Henning 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # See www.boost.org/LICENSE_1_0.txt 4 | 5 | taken from http://www.fileformat.info/format/tga/sample/index.htm 6 | -------------------------------------------------------------------------------- /test/extension/io/images/tiff/graphicmagick/readme.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Christian Henning 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # See www.boost.org/LICENSE_1_0.txt 4 | 5 | files can be found at ftp://ftp.graphicsmagick.org/pub/tiff-samples/ 6 | 7 | if not available please ask me at chhenning **at** gmail.com -------------------------------------------------------------------------------- /test/extension/io/images/tiff/libtiffpic/readme.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Christian Henning 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # See www.boost.org/LICENSE_1_0.txt 4 | 5 | taken from http://www.remotesensing.org/libtiff/images.html 6 | 7 | if not available please ask me at chhenning **at** gmail.com -------------------------------------------------------------------------------- /test/extension/io/images/tiff/test.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/images/tiff/test.tif -------------------------------------------------------------------------------- /test/extension/io/jpeg/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - IO tests 2 | # 3 | # Copyright (c) 2012 Christian Henning 4 | # Copyright (c) 2017 Stefan Seefeld 5 | # Copyright (c) 2012-2020 Mateusz Loskot 6 | # 7 | # Distributed under the Boost Software License, Version 1.0. 8 | # (See accompanying file LICENSE_1_0.txt or 9 | # copy at http://www.boost.org/LICENSE_1_0.txt) 10 | 11 | import ac ; 12 | import testing ; 13 | 14 | using libjpeg : : : : true ; # work around bug on master 15 | 16 | project 17 | : requirements 18 | BOOST_GIL_IO_TEST_ALLOW_READING_IMAGES 19 | BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES 20 | /boost/filesystem//boost_filesystem 21 | [ ac.check-library /libjpeg//libjpeg : /libjpeg//libjpeg : no ] 22 | ; 23 | 24 | 25 | run jpeg_test.cpp ; 26 | run jpeg_read_test.cpp ; 27 | run jpeg_write_test.cpp ; 28 | 29 | run jpeg_old_test.cpp ; 30 | -------------------------------------------------------------------------------- /test/extension/io/output/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/gil/6583e8bf6e5a945e902c218193db16f9097000f4/test/extension/io/output/.keep -------------------------------------------------------------------------------- /test/extension/io/png/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - IO tests 2 | # 3 | # Copyright (c) 2012 Christian Henning 4 | # Copyright (c) 2017 Stefan Seefeld 5 | # Copyright (c) 2012-2020 Mateusz Loskot 6 | # 7 | # Distributed under the Boost Software License, Version 1.0. 8 | # (See accompanying file LICENSE_1_0.txt or 9 | # copy at http://www.boost.org/LICENSE_1_0.txt) 10 | 11 | import ac ; 12 | import testing ; 13 | 14 | using zlib ; 15 | using libpng : : : : true ; 16 | 17 | # TODO: Download PNG test suite images and build with BOOST_GIL_IO_USE_PNG_FILEFORMAT_TEST_SUITE_IMAGES 18 | 19 | project 20 | : requirements 21 | BOOST_GIL_IO_TEST_ALLOW_READING_IMAGES 22 | BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES 23 | /boost/filesystem//boost_filesystem 24 | [ ac.check-library /zlib//zlib : /zlib//zlib : no ] 25 | [ ac.check-library /libpng//libpng : /libpng//libpng : no ] 26 | ; 27 | 28 | run png_test.cpp ; 29 | run png_file_format_test.cpp ; 30 | run png_read_test.cpp ; 31 | 32 | run png_old_test.cpp ; 33 | -------------------------------------------------------------------------------- /test/extension/io/png/png_write_test.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #define BOOST_GIL_IO_ENABLE_GRAY_ALPHA 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #include "color_space_write_test.hpp" 15 | #include "paths.hpp" 16 | #include "scanline_read_test.hpp" 17 | 18 | namespace gil = boost::gil; 19 | 20 | void test_rgb_color_space_write() 21 | { 22 | color_space_write_test( 23 | png_out + "rgb_color_space_test.png", png_out + "bgr_color_space_test.png"); 24 | } 25 | 26 | int main() 27 | { 28 | test_rgb_color_space_write(); 29 | 30 | return boost::report_errors(); 31 | } 32 | -------------------------------------------------------------------------------- /test/extension/io/pnm/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - IO tests 2 | # 3 | # Copyright (c) 2012 Christian Henning 4 | # Copyright (c) 2017 Stefan Seefeld 5 | # Copyright (c) 2012-2020 Mateusz Loskot 6 | # 7 | # Distributed under the Boost Software License, Version 1.0. 8 | # (See accompanying file LICENSE_1_0.txt or 9 | # copy at http://www.boost.org/LICENSE_1_0.txt) 10 | 11 | import testing ; 12 | 13 | # TODO: Download PNM test suite images and build with BOOST_GIL_IO_USE_PNM_TEST_SUITE_IMAGES 14 | 15 | project 16 | : requirements 17 | BOOST_GIL_IO_TEST_ALLOW_READING_IMAGES 18 | BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES 19 | /boost/filesystem//boost_filesystem 20 | ; 21 | 22 | run pnm_test.cpp ; 23 | run pnm_read_test.cpp ; 24 | run pnm_write_test.cpp ; 25 | 26 | run pnm_old_test.cpp ; 27 | -------------------------------------------------------------------------------- /test/extension/io/raw/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - IO tests 2 | # 3 | # Copyright (c) 2012 Christian Henning 4 | # Copyright (c) 2017 Stefan Seefeld 5 | # Copyright (c) 2012-2020 Mateusz Loskot 6 | # 7 | # Distributed under the Boost Software License, Version 1.0. 8 | # (See accompanying file LICENSE_1_0.txt or 9 | # copy at http://www.boost.org/LICENSE_1_0.txt) 10 | 11 | import ac ; 12 | import testing ; 13 | 14 | lib libraw : : raw ; 15 | 16 | project 17 | : requirements 18 | BOOST_GIL_IO_TEST_ALLOW_READING_IMAGES 19 | BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES 20 | /boost/filesystem//boost_filesystem 21 | libraw 22 | ; 23 | 24 | run raw_test.cpp ; 25 | -------------------------------------------------------------------------------- /test/extension/io/subimage_test.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_IO_TEST_SUBIMAGE_TEST_HPP 9 | #define BOOST_GIL_IO_TEST_SUBIMAGE_TEST_HPP 10 | 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | template 18 | void run_subimage_test( 19 | std::string const& filename, boost::gil::point_t const& top_left, boost::gil::point_t const& dimension) 20 | { 21 | Image original, subimage; 22 | boost::gil::read_image(filename, original, Format{}); 23 | boost::gil::image_read_settings settings(top_left, dimension); 24 | boost::gil::read_image(filename, subimage, settings); 25 | BOOST_TEST(boost::gil::equal_pixels( 26 | boost::gil::const_view(subimage), 27 | boost::gil::subimage_view(boost::gil::const_view(original), top_left, dimension))); 28 | } 29 | 30 | #endif // BOOST_GIL_IO_TEST_SUBIMAGE_TEST_HPP 31 | -------------------------------------------------------------------------------- /test/extension/io/targa/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - IO tests 2 | # 3 | # Copyright (c) 2012 Christian Henning 4 | # Copyright (c) 2017 Stefan Seefeld 5 | # Copyright (c) 2012-2020 Mateusz Loskot 6 | # 7 | # Distributed under the Boost Software License, Version 1.0. 8 | # (See accompanying file LICENSE_1_0.txt or 9 | # copy at http://www.boost.org/LICENSE_1_0.txt) 10 | 11 | import testing ; 12 | 13 | project 14 | : requirements 15 | /boost/filesystem//boost_filesystem 16 | ; 17 | 18 | run targa_test.cpp ; 19 | run targa_read_test.cpp ; 20 | run targa_write_test.cpp ; 21 | 22 | run targa_old_test.cpp ; 23 | -------------------------------------------------------------------------------- /test/extension/io/tiff/tiff_tiled_palette_test_1-8.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "tiff_tiled_read_macros.hpp" 14 | 15 | namespace gil = boost::gil; 16 | 17 | #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES 18 | 19 | // CHH - not supported palette 20 | //BOOST_PP_REPEAT_FROM_TO(1, 9, GENERATE_TILE_STRIP_COMPARISON_PALETTE, palette ) 21 | 22 | int main() 23 | { 24 | // TODO: Make sure generated test cases are executed. See tiff_subimage_test.cpp. ~mloskot 25 | 26 | return boost::report_errors(); 27 | } 28 | 29 | #else 30 | int main() {} 31 | #endif // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES 32 | -------------------------------------------------------------------------------- /test/extension/io/tiff/tiff_tiled_palette_test_8-16.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "tiff_tiled_read_macros.hpp" 14 | 15 | namespace gil = boost::gil; 16 | 17 | #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES 18 | 19 | // CHH - not supported palette 20 | //BOOST_PP_REPEAT_FROM_TO(9, 17, GENERATE_TILE_STRIP_COMPARISON_PALETTE, palette ) 21 | 22 | int main() 23 | { 24 | // TODO: Make sure generated test cases are executed. See tiff_subimage_test.cpp. ~mloskot 25 | 26 | return boost::report_errors(); 27 | } 28 | 29 | #else 30 | int main() {} 31 | #endif // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES 32 | -------------------------------------------------------------------------------- /test/extension/io/tiff/tiff_tiled_palette_write_test_1-8.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "tiff_tiled_write_macros.hpp" 14 | 15 | namespace gil = boost::gil; 16 | 17 | #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES 18 | 19 | // CHH - not supported palette 20 | //BOOST_PP_REPEAT_FROM_TO(1, 9, GENERATE_WRITE_TILE_BIT_ALIGNED_PALETTE, palette ) 21 | 22 | int main() 23 | { 24 | // TODO: Make sure generated test cases are executed. See tiff_subimage_test.cpp. ~mloskot 25 | 26 | return boost::report_errors(); 27 | } 28 | 29 | #else 30 | int main() {} 31 | #endif // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES 32 | -------------------------------------------------------------------------------- /test/extension/io/tiff/tiff_tiled_palette_write_test_8-16.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "tiff_tiled_write_macros.hpp" 14 | 15 | namespace gil = boost::gil; 16 | 17 | #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES 18 | 19 | // CHH - not supported palette 20 | //BOOST_PP_REPEAT_FROM_TO(9, 17, GENERATE_WRITE_TILE_BIT_ALIGNED_PALETTE, palette ) 21 | 22 | int main() 23 | { 24 | // TODO: Make sure generated test cases are executed. See tiff_subimage_test.cpp. ~mloskot 25 | 26 | return boost::report_errors(); 27 | } 28 | 29 | #else 30 | int main() {} 31 | #endif // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES 32 | -------------------------------------------------------------------------------- /test/extension/io/tiff/tiff_write_test.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #include "color_space_write_test.hpp" 15 | #include "mandel_view.hpp" 16 | #include "paths.hpp" 17 | 18 | namespace gil = boost::gil; 19 | 20 | void test_rgb_color_space_write() 21 | { 22 | color_space_write_test( 23 | tiff_out + "rgb_color_space_test.tif", tiff_out + "bgr_color_space_test.tif"); 24 | } 25 | 26 | int main() 27 | { 28 | test_rgb_color_space_write(); 29 | 30 | return boost::report_errors(); 31 | } 32 | -------------------------------------------------------------------------------- /test/extension/numeric/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Mateusz Loskot 3 | # Copyright (c) 2019-2021 Pranam Lashkari 4 | # All rights reserved. 5 | # 6 | # Distributed under the Boost Software License, Version 1.0. 7 | # (See accompanying file LICENSE_1_0.txt or copy at 8 | # http://www.boost.org/LICENSE_1_0.txt) 9 | # 10 | message(STATUS "Boost.GIL: Configuring tests in test/extension/numeric") 11 | 12 | foreach(_name 13 | matrix3x2 14 | resample) 15 | set(_test t_ext_numeric_${_name}) 16 | set(_target test_ext_numeric_${_name}) 17 | 18 | add_executable(${_target} "") 19 | target_sources(${_target} PRIVATE ${_name}.cpp) 20 | target_link_libraries(${_target} 21 | PRIVATE 22 | gil_compile_options 23 | gil_include_directories 24 | gil_dependencies) 25 | add_test(NAME ${_test} COMMAND ${_target}) 26 | 27 | unset(_name) 28 | unset(_target) 29 | unset(_test) 30 | endforeach() 31 | -------------------------------------------------------------------------------- /test/extension/numeric/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - Numeric tests 2 | # 3 | # Copyright (c) 2013 Christian Henning 4 | # Copyright (c) 2019 Mateusz Loskot 5 | # Copyright (c) 2021 Pranam Lashkari 6 | # 7 | # Distributed under the Boost Software License, Version 1.0. 8 | # (See accompanying file LICENSE_1_0.txt or 9 | # copy at http://www.boost.org/LICENSE_1_0.txt) 10 | 11 | import testing ; 12 | 13 | alias headers : [ generate_self_contained_headers extension/numeric ] ; 14 | 15 | 16 | 17 | run matrix3x2.cpp ; 18 | run resample.cpp ; 19 | 20 | -------------------------------------------------------------------------------- /test/extension/rasterization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright 2020 Olzhas Zhumabek 4 | # 5 | # Use, modification and distribution are subject to the Boost Software License, 6 | # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt) 8 | # 9 | foreach(_name 10 | line 11 | circle 12 | ellipse) 13 | set(_test t_core_rasterization_${_name}) 14 | set(_target test_core_rasterization_${_name}) 15 | 16 | add_executable(${_target} "") 17 | target_sources(${_target} PRIVATE ${_name}.cpp) 18 | target_link_libraries(${_target} 19 | PRIVATE 20 | gil_compile_options 21 | gil_include_directories 22 | gil_dependencies) 23 | target_compile_definitions(${_target} PRIVATE BOOST_GIL_USE_CONCEPT_CHECK) 24 | add_test(NAME ${_test} COMMAND ${_target}) 25 | 26 | unset(_name) 27 | unset(_target) 28 | endforeach() 29 | -------------------------------------------------------------------------------- /test/extension/rasterization/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - tests 2 | # 3 | # Copyright 2020 Olzhas Zhumabek 4 | # 5 | # Use, modification and distribution are subject to the Boost Software License, 6 | # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt) 8 | # 9 | import testing ; 10 | 11 | run apply_rasterizer.cpp ; 12 | run line.cpp ; 13 | run circle.cpp ; 14 | run ellipse.cpp ; 15 | -------------------------------------------------------------------------------- /test/extension/rasterization/apply_rasterizer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2022 Marco Langer 3 | // 4 | // Use, modification and distribution are subject to the Boost Software License, 5 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | namespace gil = boost::gil; 17 | 18 | template 19 | void test_apply_rasterizers(Rasterizer const& rasterizer) 20 | { 21 | gil::rgb8_image_t image(200, 200); 22 | gil::rgb8_pixel_t pixel{255, 0, 0}; 23 | 24 | apply_rasterizer(view(image), rasterizer, pixel); 25 | } 26 | 27 | int main() 28 | { 29 | test_apply_rasterizers(gil::midpoint_circle_rasterizer{{50, 50}, 30}); 30 | test_apply_rasterizers(gil::trigonometric_circle_rasterizer{{50, 50}, 30}); 31 | test_apply_rasterizers(gil::midpoint_ellipse_rasterizer{{50, 50}, {30, 20}}); 32 | test_apply_rasterizers(gil::bresenham_line_rasterizer{{50, 50}, {30, 20}}); 33 | 34 | return boost::report_errors(); 35 | } 36 | -------------------------------------------------------------------------------- /test/extension/toolbox/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - Toolbox tests 2 | # 3 | # Copyright (c) 2012 Christian Henning 4 | # Copyright (c) 2012-2020 Mateusz Loskot 5 | # 6 | # Distributed under the Boost Software License, Version 1.0. 7 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | import testing ; 10 | 11 | alias headers : [ generate_self_contained_headers extension/toolbox ] ; 12 | 13 | compile channel_type.cpp ; 14 | compile get_num_bits.cpp ; 15 | compile get_pixel_type.cpp ; 16 | compile is_bit_aligned.cpp ; 17 | compile is_homogeneous.cpp ; 18 | compile pixel_bit_size.cpp ; 19 | 20 | run channel_view.cpp ; 21 | run color_convert_cmyka.cpp ; 22 | run color_convert_gray.cpp ; 23 | run color_convert_gray_alpha.cpp ; 24 | run color_convert_hsl.cpp ; 25 | run color_convert_hsv.cpp ; 26 | run color_convert_lab.cpp ; 27 | run color_convert_luminance.cpp ; 28 | run color_convert_rgb.cpp ; 29 | run color_convert_xyz.cpp ; 30 | run indexed_image.cpp ; 31 | 32 | # TODO: Add subchroma_image.cpp after fixing run-time failure, 33 | # for details see https://github.com/boostorg/gil/pull/164 34 | #run subchroma_image.cpp ; 35 | -------------------------------------------------------------------------------- /test/extension/toolbox/channel_view.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace gil = boost::gil; 16 | 17 | void test_channel_view() 18 | { 19 | using kth_channel_view_t 20 | = gil::kth_channel_view_type<0, gil::rgb8_view_t::const_t>::type; 21 | using channel_view_t 22 | = gil::channel_view_type::type; 23 | 24 | static_assert(std::is_same 25 | < 26 | kth_channel_view_t, 27 | channel_view_t 28 | >::value, 29 | ""); 30 | 31 | gil::rgb8_image_t img(100, 100); 32 | kth_channel_view_t const kth0 = gil::kth_channel_view<0>(gil::const_view(img)); 33 | BOOST_TEST_EQ(kth0.num_channels(), 1u); 34 | 35 | channel_view_t const red = gil::channel_view(gil::const_view(img)); 36 | BOOST_TEST_EQ(red.num_channels(), 1u); 37 | } 38 | 39 | int main() 40 | { 41 | test_channel_view(); 42 | 43 | return boost::report_errors(); 44 | } 45 | -------------------------------------------------------------------------------- /test/extension/toolbox/color_convert_cmyka.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | namespace gil = boost::gil; 14 | 15 | void test_cmyka_to_rgba() 16 | { 17 | gil::cmyka8_pixel_t a(10, 20, 30, 40, 50); 18 | gil::rgba8_pixel_t b; 19 | gil::color_convert(a, b); 20 | 21 | // TODO: no rgba to cmyka conversion implemented 22 | //gil::cmyka8_pixel_t c; 23 | //gil::color_convert( b, c ); 24 | //BOOST_ASSERT(gil::at_c<0>(a) == gil::at_c<0>(c)); 25 | } 26 | 27 | int main() 28 | { 29 | test_cmyka_to_rgba(); 30 | 31 | return boost::report_errors(); 32 | } 33 | -------------------------------------------------------------------------------- /test/extension/toolbox/color_convert_gray.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "test_utility_output_stream.hpp" 14 | 15 | namespace gil = boost::gil; 16 | 17 | void test_gray_to_rgba() 18 | { 19 | gil::gray8_pixel_t a(45); 20 | gil::rgba8_pixel_t b; 21 | gil::color_convert(a, b); 22 | BOOST_TEST_EQ(b, gil::rgba8_pixel_t(45, 45, 45, 255)); 23 | } 24 | 25 | int main() 26 | { 27 | test_gray_to_rgba(); 28 | 29 | return boost::report_errors(); 30 | } 31 | -------------------------------------------------------------------------------- /test/extension/toolbox/color_convert_gray_alpha.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // Copyright 2020 Mateusz Loskot 4 | // 5 | // Distributed under the Boost Software License, Version 1.0 6 | // See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | // 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #include "test_utility_output_stream.hpp" 15 | 16 | namespace gil = boost::gil; 17 | 18 | void test_gray_alpha_to_gray() 19 | { 20 | gil::gray_alpha8_pixel_t a(10, 20); 21 | gil::gray8_pixel_t b; 22 | gil::color_convert(a, b); 23 | BOOST_TEST_EQ(b, gil::gray8_pixel_t(1)); 24 | } 25 | 26 | void test_gray_alpha_to_rgb() 27 | { 28 | gil::gray_alpha8_pixel_t a(10, 20); 29 | gil::rgb8_pixel_t b; 30 | gil::color_convert(a, b); 31 | BOOST_TEST_EQ(b, gil::rgb8_pixel_t(1, 1, 1)); 32 | } 33 | 34 | void test_gray_alpha_to_rgba() 35 | { 36 | gil::gray_alpha8_pixel_t a(10, 20); 37 | gil::rgba8_pixel_t b; 38 | gil::color_convert(a, b); 39 | BOOST_TEST_EQ(b, gil::rgba8_pixel_t(10, 10, 10, 20)); 40 | } 41 | 42 | int main() 43 | { 44 | test_gray_alpha_to_gray(); 45 | test_gray_alpha_to_rgb(); 46 | test_gray_alpha_to_rgba(); 47 | 48 | return boost::report_errors(); 49 | } 50 | -------------------------------------------------------------------------------- /test/extension/toolbox/color_convert_luminance.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // Copyright 2013 Davide Anastasia 4 | // Copyright 2020 Mateusz Loskot 5 | // 6 | // Distributed under the Boost Software License, Version 1.0 7 | // See accompanying file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt 9 | // 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include "test_utility_output_stream.hpp" 16 | 17 | namespace gil = boost::gil; 18 | 19 | struct double_zero { static double apply() { return 0.0; } }; 20 | struct double_one { static double apply() { return 1.0; } }; 21 | 22 | using gray64f_pixel_t = gil::pixel; 23 | using rgb64f_pixel_t = gil::pixel; 24 | 25 | void test_rgb_to_luminance() 26 | { 27 | rgb64f_pixel_t a(10, 20, 30); 28 | gray64f_pixel_t b; 29 | gil::color_convert(a, b); 30 | BOOST_TEST_EQ(b, b); 31 | } 32 | 33 | int main() 34 | { 35 | test_rgb_to_luminance(); 36 | 37 | return ::boost::report_errors(); 38 | } 39 | -------------------------------------------------------------------------------- /test/extension/toolbox/get_pixel_type.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | namespace gil = boost::gil; 14 | 15 | void test_bit_aligned_image() 16 | { 17 | using image_t = gil::bit_aligned_image3_type<4, 15, 4, gil::rgb_layout_t>::type; 18 | static_assert(std::is_same 19 | < 20 | gil::get_pixel_type::type, 21 | image_t::view_t::reference 22 | >::value, ""); 23 | } 24 | 25 | void test_rgb8_image() 26 | { 27 | using image_t = gil::rgb8_image_t; 28 | static_assert(std::is_same 29 | < 30 | gil::get_pixel_type::type, 31 | image_t::view_t::value_type 32 | >::value, ""); 33 | } 34 | 35 | int main() 36 | { 37 | test_bit_aligned_image(); 38 | test_rgb8_image(); 39 | } 40 | -------------------------------------------------------------------------------- /test/extension/toolbox/is_bit_aligned.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // Copyright 2020 Mateusz Loskot 4 | // 5 | // Distributed under the Boost Software License, Version 1.0 6 | // See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | // 9 | #include 10 | #include 11 | 12 | namespace gil = boost::gil; 13 | 14 | void test_is_bit_aligned() 15 | { 16 | using image_t = gil::bit_aligned_image1_type< 4, gil::gray_layout_t>::type; 17 | static_assert(gil::is_bit_aligned::value, ""); 18 | } 19 | 20 | int main() 21 | { 22 | test_is_bit_aligned(); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /test/extension/toolbox/is_homogeneous.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // Copyright 2020 Mateusz Loskot 4 | // 5 | // Distributed under the Boost Software License, Version 1.0 6 | // See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | // 9 | #include 10 | #include 11 | 12 | namespace gil = boost::gil; 13 | 14 | void test_is_homogeneous() 15 | { 16 | static_assert(gil::is_homogeneous::value, ""); 17 | static_assert(gil::is_homogeneous::value, ""); 18 | 19 | using image_t = gil::bit_aligned_image1_type< 4, gil::gray_layout_t>::type; 20 | static_assert(gil::is_homogeneous::value, ""); 21 | } 22 | 23 | int main() 24 | { 25 | test_is_homogeneous(); 26 | } 27 | -------------------------------------------------------------------------------- /test/extension/toolbox/pixel_bit_size.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2013 Christian Henning 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #include 9 | #include 10 | #include 11 | 12 | namespace gil = boost::gil; 13 | 14 | void test_pixel_bit_size() 15 | { 16 | using image_t = gil::bit_aligned_image5_type 17 | < 18 | 16, 16, 16, 8, 8, gil::devicen_layout_t<5> 19 | >::type; 20 | static_assert(gil::pixel_bit_size::value == 64, ""); 21 | } 22 | 23 | int main() 24 | { 25 | test_pixel_bit_size(); 26 | } 27 | -------------------------------------------------------------------------------- /test/header/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Mateusz Loskot 3 | // Copyright (c) 2007-2015 Andrey Semashev 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | // This file contains a test boilerplate for checking that every public header 10 | // is self-contained and does not have any missing #include-s. 11 | 12 | #define BOOST_GIL_TEST_INCLUDE_HEADER() 13 | 14 | #include BOOST_GIL_TEST_INCLUDE_HEADER() 15 | 16 | int main() 17 | { 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/legacy/Jamfile: -------------------------------------------------------------------------------- 1 | # Boost.GIL (Generic Image Library) - legacy tests 2 | # 3 | # Copyright (c) 2007-2015 Andrey Semashev 4 | # Copyright (c) 2008 Lubomir Bourdev, Hailin Jin 5 | # 6 | # Distributed under the Boost Software License, Version 1.0. 7 | # (See accompanying file LICENSE_1_0.txt or 8 | # copy at http://www.boost.org/LICENSE_1_0.txt) 9 | # 10 | # *** IMPORTANT MAINTENANCE RULES *** 11 | # These are GIL's original, comprehensive, all-in-one test suites. 12 | # * Keep as reference. 13 | # * Do NOT extend. 14 | # * Do NOT refactor. 15 | # * Modify only if absolutely necessary (a bug found in the tests). 16 | # See the accompanying README.md 17 | 18 | import testing ; 19 | 20 | run image.cpp sample_image.cpp error_if.cpp : : gil_reference_checksums.txt : /boost/crc//boost_crc ; 21 | run channel.cpp error_if.cpp ; 22 | run pixel.cpp error_if.cpp ; 23 | run pixel_iterator.cpp error_if.cpp ; 24 | 25 | alias perf : [ run performance.cpp ] ; 26 | explicit perf ; 27 | -------------------------------------------------------------------------------- /test/legacy/README.md: -------------------------------------------------------------------------------- 1 | # Boost.GIL Legacy Tests 2 | 3 | These are GIL's original, comprehensive, all-in-one test suits. 4 | 5 | Rules of maintenance: 6 | 7 | * Run the legacy tests as part of CI builds and regression tests. 8 | * Keep as reference. 9 | * Do NOT extend. 10 | * Do NOT refactor. 11 | * Modify ONLY if absolutely necessary (a bug found in the tests). 12 | 13 | Add new test suites, with new test cases, even if their 14 | functional coverage is the same as of the legacy tests. 15 | 16 | See [CONTRIBUTING.md](../../CONTRIBUTING.md). 17 | -------------------------------------------------------------------------------- /test/legacy/error_if.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Lubomir Bourdev and Hailin Jin 2 | // 3 | // Distributed under the Boost Software License, Version 1.0. 4 | // (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | #include 8 | 9 | void error_if(bool condition) { 10 | if (condition) 11 | throw std::exception(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /test/test_utility_with_tolerance.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2020 Samuel Debionne 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | #ifndef BOOST_GIL_TEST_TEST_UTILITY_WITH_TOLERANCE_HPP 9 | #define BOOST_GIL_TEST_TEST_UTILITY_WITH_TOLERANCE_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace boost { namespace gil { 16 | 17 | namespace test { namespace utility { 18 | 19 | // Tolerance predicate for floating point comparison to use with BOOST_TEST_WITH. 20 | // See https://github.com/boostorg/core/pull/77 for details. 21 | template 22 | struct with_tolerance 23 | { 24 | with_tolerance(T tolerance) : tolerance(tolerance) 25 | { 26 | } 27 | 28 | bool operator()(T lhs, T rhs) 29 | { 30 | return (std::abs(lhs - rhs) <= tolerance); 31 | } 32 | 33 | private: 34 | T tolerance; 35 | }; 36 | 37 | }} // namespace test::utility 38 | 39 | }} // namespace boost::gil 40 | 41 | #endif 42 | --------------------------------------------------------------------------------