├── .dockerignore ├── .github └── workflows │ └── main.yaml ├── .gitignore ├── .vscode ├── keybindings.json ├── launch.json └── settings.json ├── CMakeLists.txt ├── Dockerfile ├── Dockerfile-aws ├── LICENSE ├── README.md ├── docs └── example_display │ ├── cpotree_1.6.potree │ ├── cpotree_2.0.potree │ ├── cpotree_2.0_v1.potree │ ├── display_v1.html │ ├── display_v2.html │ └── libs │ └── json5 │ ├── LICENSE.md │ ├── README.md │ └── json5.mjs ├── include ├── Area.h ├── Attributes.h ├── CPotree.h ├── CsvWriter.h ├── LasWriter.h ├── Node.h ├── PotreeLoader.h ├── PotreeWriter_v1.h ├── PotreeWriter_v2.h ├── Writer.h ├── filter.h └── pmath.h ├── libs ├── arguments │ └── Arguments.hpp ├── brotli │ ├── BUILD │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── MANIFEST.in │ ├── Makefile │ ├── Makefile.am │ ├── README │ ├── README.md │ ├── WORKSPACE │ ├── bootstrap │ ├── c │ │ ├── common │ │ │ ├── constants.c │ │ │ ├── constants.h │ │ │ ├── context.c │ │ │ ├── context.h │ │ │ ├── dictionary.c │ │ │ ├── dictionary.h │ │ │ ├── platform.c │ │ │ ├── platform.h │ │ │ ├── transform.c │ │ │ ├── transform.h │ │ │ └── version.h │ │ ├── dec │ │ │ ├── bit_reader.c │ │ │ ├── bit_reader.h │ │ │ ├── decode.c │ │ │ ├── huffman.c │ │ │ ├── huffman.h │ │ │ ├── prefix.h │ │ │ ├── state.c │ │ │ └── state.h │ │ ├── enc │ │ │ ├── backward_references.c │ │ │ ├── backward_references.h │ │ │ ├── backward_references_hq.c │ │ │ ├── backward_references_hq.h │ │ │ ├── backward_references_inc.h │ │ │ ├── bit_cost.c │ │ │ ├── bit_cost.h │ │ │ ├── bit_cost_inc.h │ │ │ ├── block_encoder_inc.h │ │ │ ├── block_splitter.c │ │ │ ├── block_splitter.h │ │ │ ├── block_splitter_inc.h │ │ │ ├── brotli_bit_stream.c │ │ │ ├── brotli_bit_stream.h │ │ │ ├── cluster.c │ │ │ ├── cluster.h │ │ │ ├── cluster_inc.h │ │ │ ├── command.c │ │ │ ├── command.h │ │ │ ├── compress_fragment.c │ │ │ ├── compress_fragment.h │ │ │ ├── compress_fragment_two_pass.c │ │ │ ├── compress_fragment_two_pass.h │ │ │ ├── dictionary_hash.c │ │ │ ├── dictionary_hash.h │ │ │ ├── encode.c │ │ │ ├── encoder_dict.c │ │ │ ├── encoder_dict.h │ │ │ ├── entropy_encode.c │ │ │ ├── entropy_encode.h │ │ │ ├── entropy_encode_static.h │ │ │ ├── fast_log.c │ │ │ ├── fast_log.h │ │ │ ├── find_match_length.h │ │ │ ├── hash.h │ │ │ ├── hash_composite_inc.h │ │ │ ├── hash_forgetful_chain_inc.h │ │ │ ├── hash_longest_match64_inc.h │ │ │ ├── hash_longest_match_inc.h │ │ │ ├── hash_longest_match_quickly_inc.h │ │ │ ├── hash_rolling_inc.h │ │ │ ├── hash_to_binary_tree_inc.h │ │ │ ├── histogram.c │ │ │ ├── histogram.h │ │ │ ├── histogram_inc.h │ │ │ ├── literal_cost.c │ │ │ ├── literal_cost.h │ │ │ ├── memory.c │ │ │ ├── memory.h │ │ │ ├── metablock.c │ │ │ ├── metablock.h │ │ │ ├── metablock_inc.h │ │ │ ├── params.h │ │ │ ├── prefix.h │ │ │ ├── quality.h │ │ │ ├── ringbuffer.h │ │ │ ├── static_dict.c │ │ │ ├── static_dict.h │ │ │ ├── static_dict_lut.h │ │ │ ├── utf8_util.c │ │ │ ├── utf8_util.h │ │ │ └── write_bits.h │ │ ├── include │ │ │ └── brotli │ │ │ │ ├── decode.h │ │ │ │ ├── encode.h │ │ │ │ ├── port.h │ │ │ │ └── types.h │ │ └── tools │ │ │ ├── brotli.c │ │ │ └── brotli.md │ ├── compiler_config_setting.bzl │ ├── configure │ ├── configure-cmake │ ├── configure.ac │ ├── premake5.lua │ ├── scripts │ │ ├── libbrotlicommon.pc.in │ │ ├── libbrotlidec.pc.in │ │ ├── libbrotlienc.pc.in │ │ └── sources.lst │ ├── setup.cfg │ └── setup.py ├── glm │ ├── .gitignore │ ├── copying.txt │ ├── glm │ │ ├── CMakeLists.txt │ │ ├── common.hpp │ │ ├── detail │ │ │ ├── _features.hpp │ │ │ ├── _fixes.hpp │ │ │ ├── _noise.hpp │ │ │ ├── _swizzle.hpp │ │ │ ├── _swizzle_func.hpp │ │ │ ├── _vectorize.hpp │ │ │ ├── dummy.cpp │ │ │ ├── func_common.hpp │ │ │ ├── func_common.inl │ │ │ ├── func_common_simd.inl │ │ │ ├── func_exponential.hpp │ │ │ ├── func_exponential.inl │ │ │ ├── func_exponential_simd.inl │ │ │ ├── func_geometric.hpp │ │ │ ├── func_geometric.inl │ │ │ ├── func_geometric_simd.inl │ │ │ ├── func_integer.hpp │ │ │ ├── func_integer.inl │ │ │ ├── func_integer_simd.inl │ │ │ ├── func_matrix.hpp │ │ │ ├── func_matrix.inl │ │ │ ├── func_matrix_simd.inl │ │ │ ├── func_packing.hpp │ │ │ ├── func_packing.inl │ │ │ ├── func_packing_simd.inl │ │ │ ├── func_trigonometric.hpp │ │ │ ├── func_trigonometric.inl │ │ │ ├── func_trigonometric_simd.inl │ │ │ ├── func_vector_relational.hpp │ │ │ ├── func_vector_relational.inl │ │ │ ├── func_vector_relational_simd.inl │ │ │ ├── glm.cpp │ │ │ ├── precision.hpp │ │ │ ├── setup.hpp │ │ │ ├── type_float.hpp │ │ │ ├── type_gentype.hpp │ │ │ ├── type_gentype.inl │ │ │ ├── type_half.hpp │ │ │ ├── type_half.inl │ │ │ ├── type_int.hpp │ │ │ ├── type_mat.hpp │ │ │ ├── type_mat.inl │ │ │ ├── type_mat2x2.hpp │ │ │ ├── type_mat2x2.inl │ │ │ ├── type_mat2x3.hpp │ │ │ ├── type_mat2x3.inl │ │ │ ├── type_mat2x4.hpp │ │ │ ├── type_mat2x4.inl │ │ │ ├── type_mat3x2.hpp │ │ │ ├── type_mat3x2.inl │ │ │ ├── type_mat3x3.hpp │ │ │ ├── type_mat3x3.inl │ │ │ ├── type_mat3x4.hpp │ │ │ ├── type_mat3x4.inl │ │ │ ├── type_mat4x2.hpp │ │ │ ├── type_mat4x2.inl │ │ │ ├── type_mat4x3.hpp │ │ │ ├── type_mat4x3.inl │ │ │ ├── type_mat4x4.hpp │ │ │ ├── type_mat4x4.inl │ │ │ ├── type_mat4x4_simd.inl │ │ │ ├── type_vec.hpp │ │ │ ├── type_vec.inl │ │ │ ├── type_vec1.hpp │ │ │ ├── type_vec1.inl │ │ │ ├── type_vec2.hpp │ │ │ ├── type_vec2.inl │ │ │ ├── type_vec3.hpp │ │ │ ├── type_vec3.inl │ │ │ ├── type_vec4.hpp │ │ │ ├── type_vec4.inl │ │ │ └── type_vec4_simd.inl │ │ ├── exponential.hpp │ │ ├── ext.hpp │ │ ├── fwd.hpp │ │ ├── geometric.hpp │ │ ├── glm.hpp │ │ ├── gtc │ │ │ ├── bitfield.hpp │ │ │ ├── bitfield.inl │ │ │ ├── color_encoding.hpp │ │ │ ├── color_encoding.inl │ │ │ ├── color_space.hpp │ │ │ ├── color_space.inl │ │ │ ├── constants.hpp │ │ │ ├── constants.inl │ │ │ ├── epsilon.hpp │ │ │ ├── epsilon.inl │ │ │ ├── functions.hpp │ │ │ ├── functions.inl │ │ │ ├── integer.hpp │ │ │ ├── integer.inl │ │ │ ├── matrix_access.hpp │ │ │ ├── matrix_access.inl │ │ │ ├── matrix_integer.hpp │ │ │ ├── matrix_inverse.hpp │ │ │ ├── matrix_inverse.inl │ │ │ ├── matrix_transform.hpp │ │ │ ├── matrix_transform.inl │ │ │ ├── noise.hpp │ │ │ ├── noise.inl │ │ │ ├── packing.hpp │ │ │ ├── packing.inl │ │ │ ├── quaternion.hpp │ │ │ ├── quaternion.inl │ │ │ ├── quaternion_simd.inl │ │ │ ├── random.hpp │ │ │ ├── random.inl │ │ │ ├── reciprocal.hpp │ │ │ ├── reciprocal.inl │ │ │ ├── round.hpp │ │ │ ├── round.inl │ │ │ ├── type_aligned.hpp │ │ │ ├── type_precision.hpp │ │ │ ├── type_precision.inl │ │ │ ├── type_ptr.hpp │ │ │ ├── type_ptr.inl │ │ │ ├── ulp.hpp │ │ │ ├── ulp.inl │ │ │ ├── vec1.hpp │ │ │ └── vec1.inl │ │ ├── gtx │ │ │ ├── associated_min_max.hpp │ │ │ ├── associated_min_max.inl │ │ │ ├── bit.hpp │ │ │ ├── bit.inl │ │ │ ├── closest_point.hpp │ │ │ ├── closest_point.inl │ │ │ ├── color_space.hpp │ │ │ ├── color_space.inl │ │ │ ├── color_space_YCoCg.hpp │ │ │ ├── color_space_YCoCg.inl │ │ │ ├── common.hpp │ │ │ ├── common.inl │ │ │ ├── compatibility.hpp │ │ │ ├── compatibility.inl │ │ │ ├── component_wise.hpp │ │ │ ├── component_wise.inl │ │ │ ├── dual_quaternion.hpp │ │ │ ├── dual_quaternion.inl │ │ │ ├── euler_angles.hpp │ │ │ ├── euler_angles.inl │ │ │ ├── extend.hpp │ │ │ ├── extend.inl │ │ │ ├── extended_min_max.hpp │ │ │ ├── extended_min_max.inl │ │ │ ├── fast_exponential.hpp │ │ │ ├── fast_exponential.inl │ │ │ ├── fast_square_root.hpp │ │ │ ├── fast_square_root.inl │ │ │ ├── fast_trigonometry.hpp │ │ │ ├── fast_trigonometry.inl │ │ │ ├── float_notmalize.inl │ │ │ ├── gradient_paint.hpp │ │ │ ├── gradient_paint.inl │ │ │ ├── handed_coordinate_space.hpp │ │ │ ├── handed_coordinate_space.inl │ │ │ ├── hash.hpp │ │ │ ├── hash.inl │ │ │ ├── integer.hpp │ │ │ ├── integer.inl │ │ │ ├── intersect.hpp │ │ │ ├── intersect.inl │ │ │ ├── io.hpp │ │ │ ├── io.inl │ │ │ ├── log_base.hpp │ │ │ ├── log_base.inl │ │ │ ├── matrix_cross_product.hpp │ │ │ ├── matrix_cross_product.inl │ │ │ ├── matrix_decompose.hpp │ │ │ ├── matrix_decompose.inl │ │ │ ├── matrix_interpolation.hpp │ │ │ ├── matrix_interpolation.inl │ │ │ ├── matrix_major_storage.hpp │ │ │ ├── matrix_major_storage.inl │ │ │ ├── matrix_operation.hpp │ │ │ ├── matrix_operation.inl │ │ │ ├── matrix_query.hpp │ │ │ ├── matrix_query.inl │ │ │ ├── matrix_transform_2d.hpp │ │ │ ├── matrix_transform_2d.inl │ │ │ ├── mixed_product.hpp │ │ │ ├── mixed_product.inl │ │ │ ├── norm.hpp │ │ │ ├── norm.inl │ │ │ ├── normal.hpp │ │ │ ├── normal.inl │ │ │ ├── normalize_dot.hpp │ │ │ ├── normalize_dot.inl │ │ │ ├── number_precision.hpp │ │ │ ├── number_precision.inl │ │ │ ├── optimum_pow.hpp │ │ │ ├── optimum_pow.inl │ │ │ ├── orthonormalize.hpp │ │ │ ├── orthonormalize.inl │ │ │ ├── perpendicular.hpp │ │ │ ├── perpendicular.inl │ │ │ ├── polar_coordinates.hpp │ │ │ ├── polar_coordinates.inl │ │ │ ├── projection.hpp │ │ │ ├── projection.inl │ │ │ ├── quaternion.hpp │ │ │ ├── quaternion.inl │ │ │ ├── range.hpp │ │ │ ├── raw_data.hpp │ │ │ ├── raw_data.inl │ │ │ ├── rotate_normalized_axis.hpp │ │ │ ├── rotate_normalized_axis.inl │ │ │ ├── rotate_vector.hpp │ │ │ ├── rotate_vector.inl │ │ │ ├── scalar_multiplication.hpp │ │ │ ├── scalar_relational.hpp │ │ │ ├── scalar_relational.inl │ │ │ ├── spline.hpp │ │ │ ├── spline.inl │ │ │ ├── std_based_type.hpp │ │ │ ├── std_based_type.inl │ │ │ ├── string_cast.hpp │ │ │ ├── string_cast.inl │ │ │ ├── transform.hpp │ │ │ ├── transform.inl │ │ │ ├── transform2.hpp │ │ │ ├── transform2.inl │ │ │ ├── type_aligned.hpp │ │ │ ├── type_aligned.inl │ │ │ ├── type_trait.hpp │ │ │ ├── type_trait.inl │ │ │ ├── vector_angle.hpp │ │ │ ├── vector_angle.inl │ │ │ ├── vector_query.hpp │ │ │ ├── vector_query.inl │ │ │ ├── wrap.hpp │ │ │ └── wrap.inl │ │ ├── integer.hpp │ │ ├── mat2x2.hpp │ │ ├── mat2x3.hpp │ │ ├── mat2x4.hpp │ │ ├── mat3x2.hpp │ │ ├── mat3x3.hpp │ │ ├── mat3x4.hpp │ │ ├── mat4x2.hpp │ │ ├── mat4x3.hpp │ │ ├── mat4x4.hpp │ │ ├── matrix.hpp │ │ ├── packing.hpp │ │ ├── simd │ │ │ ├── common.h │ │ │ ├── exponential.h │ │ │ ├── geometric.h │ │ │ ├── integer.h │ │ │ ├── matrix.h │ │ │ ├── packing.h │ │ │ ├── platform.h │ │ │ ├── trigonometric.h │ │ │ └── vector_relational.h │ │ ├── trigonometric.hpp │ │ ├── vec2.hpp │ │ ├── vec3.hpp │ │ ├── vec4.hpp │ │ └── vector_relational.hpp │ └── readme.md ├── json │ ├── LICENSE │ └── json.hpp └── laszip │ ├── CHANGES.txt │ ├── CMakeLists.txt │ ├── COPYING │ ├── README.txt │ ├── dll │ └── laszip_api.c │ ├── example │ ├── 5points_14.las │ ├── Makefile │ ├── laszipdllexample.cpp │ └── laszipdllexample.dsp │ ├── laszip_api.h │ ├── laszip_api_version.h.in │ └── src │ ├── CMakeLists.txt │ ├── arithmeticdecoder.cpp │ ├── arithmeticdecoder.hpp │ ├── arithmeticencoder.cpp │ ├── arithmeticencoder.hpp │ ├── arithmeticmodel.cpp │ ├── arithmeticmodel.hpp │ ├── bytestreamin.hpp │ ├── bytestreamin_array.hpp │ ├── bytestreamin_file.hpp │ ├── bytestreamin_istream.hpp │ ├── bytestreaminout.hpp │ ├── bytestreaminout_file.hpp │ ├── bytestreamout.hpp │ ├── bytestreamout_array.hpp │ ├── bytestreamout_file.hpp │ ├── bytestreamout_nil.hpp │ ├── bytestreamout_ostream.hpp │ ├── endian.hpp │ ├── integercompressor.cpp │ ├── integercompressor.hpp │ ├── lasattributer.hpp │ ├── lasindex.cpp │ ├── lasindex.hpp │ ├── lasinterval.cpp │ ├── lasinterval.hpp │ ├── laspoint.hpp │ ├── lasquadtree.cpp │ ├── lasquadtree.hpp │ ├── lasquantizer.hpp │ ├── lasreaditem.hpp │ ├── lasreaditemcompressed_v1.cpp │ ├── lasreaditemcompressed_v1.hpp │ ├── lasreaditemcompressed_v2.cpp │ ├── lasreaditemcompressed_v2.hpp │ ├── lasreaditemcompressed_v3.cpp │ ├── lasreaditemcompressed_v3.hpp │ ├── lasreaditemcompressed_v4.cpp │ ├── lasreaditemcompressed_v4.hpp │ ├── lasreaditemraw.hpp │ ├── lasreadpoint.cpp │ ├── lasreadpoint.hpp │ ├── lasunzipper.cpp │ ├── lasunzipper.hpp │ ├── laswriteitem.hpp │ ├── laswriteitemcompressed_v1.cpp │ ├── laswriteitemcompressed_v1.hpp │ ├── laswriteitemcompressed_v2.cpp │ ├── laswriteitemcompressed_v2.hpp │ ├── laswriteitemcompressed_v3.cpp │ ├── laswriteitemcompressed_v3.hpp │ ├── laswriteitemcompressed_v4.cpp │ ├── laswriteitemcompressed_v4.hpp │ ├── laswriteitemraw.hpp │ ├── laswritepoint.cpp │ ├── laswritepoint.hpp │ ├── laszip.cpp │ ├── laszip.hpp │ ├── laszip_common_v1.hpp │ ├── laszip_common_v2.hpp │ ├── laszip_common_v3.hpp │ ├── laszip_decompress_selective_v3.hpp │ ├── laszip_dll.cpp │ ├── laszipper.cpp │ ├── laszipper.hpp │ ├── mydefs.cpp │ └── mydefs.hpp ├── modules └── unsuck │ ├── TaskPool.hpp │ ├── unsuck.hpp │ └── unsuck_platform_specific.cpp └── src ├── executable_extract_area.cpp └── executable_extract_profile.cpp /.dockerignore: -------------------------------------------------------------------------------- 1 | /.git 2 | /build 3 | /Dockerfile* 4 | /.dockerignore 5 | /docs 6 | /README.md 7 | -------------------------------------------------------------------------------- /.github/workflows/main.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | - push 5 | 6 | jobs: 7 | main: 8 | name: Build with AWS 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | 13 | - run: docker build --file=Dockerfile --tag=test . 14 | - run: docker run test extract_profile --help && docker run test extract_area --help 15 | 16 | - run: docker build --file=Dockerfile-aws --tag=aws . 17 | - run: docker run aws extract_profile --help && docker run aws extract_area --help 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | build/ 3 | build/CPotree.sln 4 | -------------------------------------------------------------------------------- /.vscode/keybindings.json: -------------------------------------------------------------------------------- 1 | // Place your key bindings in this file to overwrite the defaults 2 | [ 3 | { 4 | "key": "ctrl+l", 5 | "command": "editor.action.deleteLines", 6 | "when": "editorTextFocus && !editorReadonly" 7 | },{ 8 | "key": "ctrl+shift+i", 9 | "command": "editor.action.toggleRenderWhitespace" 10 | },{ 11 | "key": "ctrl+d", 12 | "command": "editor.action.copyLinesDownAction" 13 | },{ 14 | "key": "alt+2", 15 | "command": "type", 16 | "args": { 17 | "text": "`" 18 | } 19 | } 20 | ] -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:23.10 2 | 3 | RUN --mount=type=cache,target=/var/lib/apt/lists \ 4 | --mount=type=cache,target=/var/cache,sharing=locked \ 5 | apt-get update \ 6 | && apt-get install --yes build-essential git cmake python3 \ 7 | zlib1g-dev libssl-dev libcurlpp-dev 8 | 9 | WORKDIR /app 10 | 11 | COPY . . 12 | 13 | WORKDIR /app/build 14 | 15 | RUN --mount=type=cache,target=/app/build \ 16 | cmake .. \ 17 | && make \ 18 | && cp extract_area extract_profile /usr/bin \ 19 | && cp liblaszip.so /usr/lib 20 | 21 | RUN extract_profile --help 22 | -------------------------------------------------------------------------------- /Dockerfile-aws: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | RUN --mount=type=cache,target=/var/lib/apt/lists \ 4 | --mount=type=cache,target=/var/cache,sharing=locked \ 5 | apt-get update \ 6 | && apt-get install --yes build-essential git cmake python3 \ 7 | zlib1g-dev libssl-dev libcurlpp-dev 8 | 9 | WORKDIR /opt/ 10 | 11 | RUN git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git \ 12 | && cd aws-sdk-cpp \ 13 | && git checkout 1.11.205 14 | 15 | WORKDIR /opt/aws-sdk-cpp/build 16 | 17 | 18 | RUN --mount=type=cache,target=/opt/aws-sdk-cpp/build \ 19 | cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchains/gcc-c++20.cmake -DBUILD_ONLY="s3" \ 20 | && cmake --build . \ 21 | && cmake --install . 22 | 23 | WORKDIR /app 24 | 25 | COPY . . 26 | 27 | WORKDIR /app/build 28 | 29 | RUN --mount=type=cache,target=/app/build \ 30 | cmake .. -DWITH_AWS_SDK=ON \ 31 | && make \ 32 | && cp extract_area extract_profile /usr/bin \ 33 | && cp liblaszip.so /usr/lib 34 | 35 | RUN extract_profile --help 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | ============= 3 | == CPOTREE == 4 | ============= 5 | 6 | http://potree.org 7 | https://github.com/potree/CPotree 8 | 9 | Copyright (c) 2011-2024, Markus Schütz 10 | All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are met: 14 | 15 | 1. Redistributions of source code must retain the above copyright notice, this 16 | list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | The views and conclusions contained in the software and documentation are those 33 | of the authors and should not be interpreted as representing official policies, 34 | either expressed or implied, of the FreeBSD Project. 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Build 3 | 4 | __Linux:__ 5 | ``` 6 | mkdir build 7 | cd build 8 | cmake ../ 9 | make 10 | ``` 11 | 12 | __Linux (manual build):__ 13 | 14 | Tested on Ubuntu 22.04 LTS 15 | 16 | Install required packages 17 | ``` 18 | apt install build-essential libbrotli-dev liblaszip-dev 19 | ``` 20 | Build binaries 21 | ``` 22 | cd src 23 | g++ -std=c++20 -I../include/ -I../modules -idirafter../libs executable_extract_area.cpp ../modules/unsuck/unsuck_platform_specific.cpp -lbrotlidec -llaszip -o extract_area 24 | g++ -std=c++20 -I../include/ -I../modules -idirafter../libs executable_extract_profile.cpp ../modules/unsuck/unsuck_platform_specific.cpp -lbrotlidec -llaszip -o extract_profile 25 | ``` 26 | 27 | __Windows:__ 28 | ``` 29 | mkdir build 30 | cd build 31 | cmake ../ 32 | ``` 33 | * Then open the generated sln file in Visual Studio. 34 | * Make sure "Release" build is selected. 35 | * Build "extract_profile". 36 | 37 | ## Build options 38 | 39 | * `WITH_AWS_SDK`: Build with s3 support. Requires AWS SDK. 40 | 41 | 42 | # Usage 43 | 44 | Extract points with the elevation profile: 45 | 46 | // minimal 47 | ./extract_profile -o --coordinates "{x0, y1}, {x1, y}, ..." --width 48 | 49 | // Extract points in certain LOD level ranges 50 | ./extract_profile -o --coordinates "{x0, y1}, {x1, y}, ..." --width --min-level --max-level 51 | 52 | * __input__: A point cloud generated with PotreeConverter 2. 53 | * __output__: Can be files ending with *.las, *.laz, *.potree or it can be "stdout". If stdout is specified, a potree format file will be printed directly to the console. 54 | * __min-level__, __max-level__: Level range including the min and max levels. Can be omitted to process all levels. 55 | 56 | 57 | With ```--get-candidates```, you'll get the number of candidate points, i.e., the number of points inside all nodes intersecting the profile. The actual number of points might be orders of magnitudes lower, especially if ```--width``` is small. 58 | 59 | ./extract_profile --coordinates "{x0, y1}, {x1, y}, ..." --width --min-level --max-level --get-candidates 60 | 61 | A practical example: 62 | 63 | ./extract_profile ~/dev/tmp/retz -o ~/dev/tmp/retz.laz --coordinates "{-37.601, -100.733, 4.940},{-22.478, 75.982, 8.287},{66.444, 54.042, 5.388},{71.294, -67.140, -2.481},{165.519, -26.288, 0.253}" --width 2 --min-level 0 --max-level 3 64 | -------------------------------------------------------------------------------- /docs/example_display/cpotree_1.6.potree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/potree/CPotree/dc13ad12cdf9cb791f59204398d427b5e3801ad4/docs/example_display/cpotree_1.6.potree -------------------------------------------------------------------------------- /docs/example_display/cpotree_2.0.potree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/potree/CPotree/dc13ad12cdf9cb791f59204398d427b5e3801ad4/docs/example_display/cpotree_2.0.potree -------------------------------------------------------------------------------- /docs/example_display/cpotree_2.0_v1.potree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/potree/CPotree/dc13ad12cdf9cb791f59204398d427b5e3801ad4/docs/example_display/cpotree_2.0_v1.potree -------------------------------------------------------------------------------- /docs/example_display/libs/json5/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2018 Aseem Kishore, and [others]. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | [others]: https://github.com/json5/json5/contributors 24 | -------------------------------------------------------------------------------- /include/CPotree.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "pmath.h" 8 | #include "PotreeLoader.h" 9 | 10 | using std::mutex; 11 | using std::lock_guard; 12 | 13 | struct Stats{ 14 | AABB aabb; 15 | dvec3 minScale = { Infinity, Infinity, Infinity }; 16 | 17 | }; 18 | 19 | 20 | Stats computeStats(vector sources){ 21 | 22 | Stats stats; 23 | mutex mtx_stats; 24 | 25 | auto parallel = std::execution::par_unseq; 26 | for_each(parallel, sources.begin(), sources.end(), [&stats, &mtx_stats](string source) { 27 | 28 | auto loader = PotreeLoader::load(source); 29 | 30 | auto metadata = loader.metadata; 31 | 32 | lock_guard lock(mtx_stats); 33 | 34 | stats.aabb.expand(metadata.aabb); 35 | 36 | stats.minScale.x = std::min(stats.minScale.x, metadata.scale.x); 37 | stats.minScale.y = std::min(stats.minScale.y, metadata.scale.y); 38 | stats.minScale.z = std::min(stats.minScale.z, metadata.scale.z); 39 | 40 | }); 41 | 42 | return stats; 43 | }; 44 | 45 | struct ScaleOffset { 46 | dvec3 scale; 47 | dvec3 offset; 48 | }; 49 | 50 | 51 | ScaleOffset computeScaleOffset(AABB aabb, dvec3 targetScale) { 52 | 53 | dvec3 offset = aabb.center(); 54 | dvec3 scale = targetScale; 55 | dvec3 size = aabb.size(); 56 | 57 | double min_scale_x = size.x / pow(2.0, 31.0); 58 | double min_scale_y = size.y / pow(2.0, 31.0); 59 | double min_scale_z = size.z / pow(2.0, 31.0); 60 | 61 | scale.x = std::max(scale.x, min_scale_x); 62 | scale.y = std::max(scale.y, min_scale_y); 63 | scale.z = std::max(scale.z, min_scale_z); 64 | 65 | ScaleOffset scaleOffset; 66 | scaleOffset.scale = scale; 67 | scaleOffset.offset = offset; 68 | 69 | return scaleOffset; 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /include/Node.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | #include 6 | 7 | #include "pmath.h" 8 | 9 | using std::string; 10 | using std::function; 11 | 12 | enum NodeType { 13 | NORMAL = 0, 14 | LEAF = 1, 15 | PROXY = 2, 16 | }; 17 | 18 | struct Node { 19 | 20 | string name = ""; 21 | AABB aabb; 22 | 23 | Node* parent = nullptr; 24 | Node* children[8] = {}; 25 | int32_t nodeType = -1; 26 | int64_t byteOffset = 0; 27 | int64_t byteSize = 0; 28 | int64_t numPoints = 0; 29 | 30 | int level() { 31 | return name.size() - 1; 32 | } 33 | 34 | void traverse(function callback) { 35 | 36 | callback(this); 37 | 38 | for (auto child : children) { 39 | if (child != nullptr) { 40 | child->traverse(callback); 41 | } 42 | } 43 | 44 | } 45 | 46 | }; 47 | 48 | struct Hierarchy { 49 | Node* root = nullptr; 50 | vector nodes; 51 | }; -------------------------------------------------------------------------------- /include/Writer.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "unsuck/unsuck.hpp" 5 | #include "Attributes.h" 6 | #include "Node.h" 7 | 8 | struct Writer{ 9 | 10 | virtual void write(Node* node, shared_ptr, int64_t numAccepted, int64_t numRejected) = 0; 11 | 12 | virtual void close() = 0; 13 | 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /libs/brotli/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Want to contribute? Great! First, read this page (including the small print at 2 | the end). 3 | 4 | ### Before you contribute 5 | Before we can use your code, you must sign the 6 | [Google Individual Contributor License Agreement] 7 | (https://cla.developers.google.com/about/google-individual) 8 | (CLA), which you can do online. The CLA is necessary mainly because you own the 9 | copyright to your changes, even after your contribution becomes part of our 10 | codebase, so we need your permission to use and distribute your code. We also 11 | need to be sure of various other things—for instance that you'll tell us if you 12 | know that your code infringes on other people's patents. You don't have to sign 13 | the CLA until after you've submitted your code for review and a member has 14 | approved it, but you must do it before we can put your code into our codebase. 15 | Before you start working on a larger contribution, you should get in touch with 16 | us first through the issue tracker with your idea so that we can help out and 17 | possibly guide you. Coordinating up front makes it much easier to avoid 18 | frustration later on. 19 | 20 | ### Code reviews 21 | All submissions, including submissions by project members, require review. We 22 | use Github pull requests for this purpose. 23 | 24 | ### The small print 25 | Contributions made by corporations are covered by a different agreement than 26 | the one above, the [Software Grant and Corporate Contributor License Agreement] 27 | (https://cla.developers.google.com/about/google-corporate). 28 | -------------------------------------------------------------------------------- /libs/brotli/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /libs/brotli/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include CONTRIBUTING.md 2 | include c/common/*.c 3 | include c/common/*.h 4 | include c/dec/*.c 5 | include c/dec/*.h 6 | include c/enc/*.c 7 | include c/enc/*.h 8 | include c/include/brotli/*.h 9 | include LICENSE 10 | include MANIFEST.in 11 | include python/_brotli.cc 12 | include python/bro.py 13 | include python/brotli.py 14 | include python/README.md 15 | include README.md 16 | include setup.py 17 | include c/tools/brotli.c 18 | -------------------------------------------------------------------------------- /libs/brotli/Makefile: -------------------------------------------------------------------------------- 1 | OS := $(shell uname) 2 | LIBSOURCES = $(wildcard c/common/*.c) $(wildcard c/dec/*.c) \ 3 | $(wildcard c/enc/*.c) 4 | SOURCES = $(LIBSOURCES) c/tools/brotli.c 5 | BINDIR = bin 6 | OBJDIR = $(BINDIR)/obj 7 | LIBOBJECTS = $(addprefix $(OBJDIR)/, $(LIBSOURCES:.c=.o)) 8 | OBJECTS = $(addprefix $(OBJDIR)/, $(SOURCES:.c=.o)) 9 | LIB_A = libbrotli.a 10 | EXECUTABLE = brotli 11 | DIRS = $(OBJDIR)/c/common $(OBJDIR)/c/dec $(OBJDIR)/c/enc \ 12 | $(OBJDIR)/c/tools $(BINDIR)/tmp 13 | CFLAGS += -O2 14 | ifeq ($(os), Darwin) 15 | CPPFLAGS += -DOS_MACOSX 16 | endif 17 | 18 | ifneq ($(strip $(CROSS_COMPILE)), ) 19 | CC=$(CROSS_COMPILE)-gcc 20 | ARCH=$(firstword $(subst -, ,$(CROSS_COMPILE))) 21 | BROTLI_WRAPPER="qemu-$(ARCH) -L /usr/$(CROSS_COMPILE)" 22 | endif 23 | 24 | # The arm-linux-gnueabi compiler defaults to Armv5. Since we only support Armv7 25 | # and beyond, we need to select Armv7 explicitly with march. 26 | ifeq ($(ARCH), arm) 27 | CFLAGS += -march=armv7-a -mfloat-abi=hard -mfpu=neon 28 | endif 29 | 30 | all: test 31 | @: 32 | 33 | .PHONY: all clean test 34 | 35 | $(DIRS): 36 | mkdir -p $@ 37 | 38 | $(EXECUTABLE): $(OBJECTS) 39 | $(CC) $(LDFLAGS) $(OBJECTS) -lm -o $(BINDIR)/$(EXECUTABLE) 40 | 41 | lib: $(LIBOBJECTS) 42 | rm -f $(LIB_A) 43 | ar -crs $(LIB_A) $(LIBOBJECTS) 44 | 45 | test: $(EXECUTABLE) 46 | tests/compatibility_test.sh $(BROTLI_WRAPPER) 47 | tests/roundtrip_test.sh $(BROTLI_WRAPPER) 48 | 49 | clean: 50 | rm -rf $(BINDIR) $(LIB_A) 51 | 52 | .SECONDEXPANSION: 53 | $(OBJECTS): $$(patsubst %.o,%.c,$$(patsubst $$(OBJDIR)/%,%,$$@)) | $(DIRS) 54 | $(CC) $(CFLAGS) $(CPPFLAGS) -Ic/include \ 55 | -c $(patsubst %.o,%.c,$(patsubst $(OBJDIR)/%,%,$@)) -o $@ 56 | -------------------------------------------------------------------------------- /libs/brotli/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign nostdinc subdir-objects 2 | 3 | ACLOCAL_AMFLAGS = -I m4 4 | 5 | # Actual ABI version is substituted by bootstrap 6 | LIBBROTLI_VERSION_INFO = -version-info 0:0:0 7 | 8 | bin_PROGRAMS = brotli 9 | lib_LTLIBRARIES = libbrotlicommon.la libbrotlidec.la libbrotlienc.la 10 | 11 | include scripts/sources.lst 12 | 13 | brotliincludedir = $(includedir)/brotli 14 | brotliinclude_HEADERS = $(BROTLI_INCLUDE) 15 | 16 | AM_CFLAGS = -I$(top_srcdir)/c/include 17 | 18 | brotli_SOURCES = $(BROTLI_CLI_C) 19 | brotli_LDADD = libbrotlidec.la libbrotlienc.la libbrotlicommon.la -lm 20 | #brotli_LDFLAGS = -static 21 | 22 | libbrotlicommon_la_SOURCES = $(BROTLI_COMMON_C) $(BROTLI_COMMON_H) 23 | libbrotlicommon_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) 24 | libbrotlidec_la_SOURCES = $(BROTLI_DEC_C) $(BROTLI_DEC_H) 25 | libbrotlidec_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) 26 | libbrotlidec_la_LIBADD = libbrotlicommon.la -lm 27 | libbrotlienc_la_SOURCES = $(BROTLI_ENC_C) $(BROTLI_ENC_H) 28 | libbrotlienc_la_LDFLAGS = $(AM_LDFLAGS) $(LIBBROTLI_VERSION_INFO) $(LDFLAGS) 29 | libbrotlienc_la_LIBADD = libbrotlicommon.la -lm 30 | 31 | pkgconfigdir = $(libdir)/pkgconfig 32 | pkgconfig_DATA = \ 33 | scripts/libbrotlicommon.pc \ 34 | scripts/libbrotlidec.pc \ 35 | scripts/libbrotlienc.pc 36 | pkgincludedir= $(brotliincludedir) 37 | 38 | dist_doc_DATA = README 39 | -------------------------------------------------------------------------------- /libs/brotli/README: -------------------------------------------------------------------------------- 1 | BROTLI DATA COMPRESSION LIBRARY 2 | 3 | Brotli is a generic-purpose lossless compression algorithm that compresses data 4 | using a combination of a modern variant of the LZ77 algorithm, Huffman coding 5 | and 2nd order context modeling, with a compression ratio comparable to the best 6 | currently available general-purpose compression methods. It is similar in speed 7 | with deflate but offers more dense compression. 8 | 9 | The specification of the Brotli Compressed Data Format is defined in RFC 7932 10 | https://tools.ietf.org/html/rfc7932 11 | 12 | Brotli is open-sourced under the MIT License, see the LICENSE file. 13 | 14 | Brotli mailing list: 15 | https://groups.google.com/forum/#!forum/brotli 16 | -------------------------------------------------------------------------------- /libs/brotli/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "org_brotli") 2 | 3 | local_repository( 4 | name = "ignore_org_brotli_go", 5 | path = "go", 6 | ) 7 | 8 | local_repository( 9 | name = "ignore_org_brotli_java", 10 | path = "java", 11 | ) 12 | 13 | local_repository( 14 | name = "ignore_org_brotli_js", 15 | path = "js", 16 | ) 17 | 18 | local_repository( 19 | name = "ignore_org_brotli_research", 20 | path = "research", 21 | ) 22 | -------------------------------------------------------------------------------- /libs/brotli/bootstrap: -------------------------------------------------------------------------------- 1 | # !/bin/sh -e 2 | 3 | if [ `uname -s` = "Darwin" ]; then 4 | echo "WARNING: OSX autogen build is not supported" 5 | fi 6 | 7 | REQUIRED='is required, but not installed.' 8 | bc -v >/dev/null 2>&1 || { echo >&2 "'bc' $REQUIRED"; exit 1; } 9 | if [ `uname -s` != "FreeBSD" ]; then 10 | sed --version >/dev/null 2>&1 || { echo >&2 "'sed' $REQUIRED"; exit 1; } 11 | fi 12 | autoreconf --version >/dev/null 2>&1 || { echo >&2 "'autoconf' $REQUIRED"; exit 1; } 13 | 14 | # If libtool is not installed -> "error: Libtool library used but 'LIBTOOL' is undefined" 15 | 16 | mkdir m4 2>/dev/null 17 | 18 | BROTLI_ABI_HEX=`sed -n 's/#define BROTLI_ABI_VERSION 0x//p' c/common/version.h` 19 | BROTLI_ABI_INT=`echo "ibase=16;$BROTLI_ABI_HEX" | bc` 20 | BROTLI_ABI_CURRENT=`expr $BROTLI_ABI_INT / 16777216` 21 | BROTLI_ABI_REVISION=`expr $BROTLI_ABI_INT / 4096 % 4096` 22 | BROTLI_ABI_AGE=`expr $BROTLI_ABI_INT % 4096` 23 | BROTLI_ABI_INFO="$BROTLI_ABI_CURRENT:$BROTLI_ABI_REVISION:$BROTLI_ABI_AGE" 24 | 25 | BROTLI_VERSION_HEX=`sed -n 's/#define BROTLI_VERSION 0x//p' c/common/version.h` 26 | BROTLI_VERSION_INT=`echo "ibase=16;$BROTLI_VERSION_HEX" | bc` 27 | BROTLI_VERSION_MAJOR=`expr $BROTLI_VERSION_INT / 16777216` 28 | BROTLI_VERSION_MINOR=`expr $BROTLI_VERSION_INT / 4096 % 4096` 29 | BROTLI_VERSION_PATCH=`expr $BROTLI_VERSION_INT % 4096` 30 | BROTLI_VERSION="$BROTLI_VERSION_MAJOR.$BROTLI_VERSION_MINOR.$BROTLI_VERSION_PATCH" 31 | 32 | sed -i.bak -r "s/[0-9]+:[0-9]+:[0-9]+/$BROTLI_ABI_INFO/" Makefile.am 33 | sed -i.bak -r "s/\[[0-9]+\.[0-9]+\.[0-9]+\]/[$BROTLI_VERSION]/" configure.ac 34 | 35 | autoreconf --install --force --symlink || exit $ 36 | -------------------------------------------------------------------------------- /libs/brotli/c/common/constants.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | #include "./constants.h" 8 | 9 | const BrotliPrefixCodeRange 10 | _kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = { 11 | {1, 2}, {5, 2}, {9, 2}, {13, 2}, {17, 3}, {25, 3}, 12 | {33, 3}, {41, 3}, {49, 4}, {65, 4}, {81, 4}, {97, 4}, 13 | {113, 5}, {145, 5}, {177, 5}, {209, 5}, {241, 6}, {305, 6}, 14 | {369, 7}, {497, 8}, {753, 9}, {1265, 10}, {2289, 11}, {4337, 12}, 15 | {8433, 13}, {16625, 24}}; 16 | -------------------------------------------------------------------------------- /libs/brotli/c/common/dictionary.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Collection of static dictionary words. */ 8 | 9 | #ifndef BROTLI_COMMON_DICTIONARY_H_ 10 | #define BROTLI_COMMON_DICTIONARY_H_ 11 | 12 | #include 13 | #include 14 | 15 | #if defined(__cplusplus) || defined(c_plusplus) 16 | extern "C" { 17 | #endif 18 | 19 | typedef struct BrotliDictionary { 20 | /** 21 | * Number of bits to encode index of dictionary word in a bucket. 22 | * 23 | * Specification: Appendix A. Static Dictionary Data 24 | * 25 | * Words in a dictionary are bucketed by length. 26 | * @c 0 means that there are no words of a given length. 27 | * Dictionary consists of words with length of [4..24] bytes. 28 | * Values at [0..3] and [25..31] indices should not be addressed. 29 | */ 30 | uint8_t size_bits_by_length[32]; 31 | 32 | /* assert(offset[i + 1] == offset[i] + (bits[i] ? (i << bits[i]) : 0)) */ 33 | uint32_t offsets_by_length[32]; 34 | 35 | /* assert(data_size == offsets_by_length[31]) */ 36 | size_t data_size; 37 | 38 | /* Data array is not bound, and should obey to size_bits_by_length values. 39 | Specified size matches default (RFC 7932) dictionary. Its size is 40 | defined by data_size */ 41 | const uint8_t* data; 42 | } BrotliDictionary; 43 | 44 | BROTLI_COMMON_API const BrotliDictionary* BrotliGetDictionary(void); 45 | 46 | /** 47 | * Sets dictionary data. 48 | * 49 | * When dictionary data is already set / present, this method is no-op. 50 | * 51 | * Dictionary data MUST be provided before BrotliGetDictionary is invoked. 52 | * This method is used ONLY in multi-client environment (e.g. C + Java), 53 | * to reduce storage by sharing single dictionary between implementations. 54 | */ 55 | BROTLI_COMMON_API void BrotliSetDictionaryData(const uint8_t* data); 56 | 57 | #define BROTLI_MIN_DICTIONARY_WORD_LENGTH 4 58 | #define BROTLI_MAX_DICTIONARY_WORD_LENGTH 24 59 | 60 | #if defined(__cplusplus) || defined(c_plusplus) 61 | } /* extern "C" */ 62 | #endif 63 | 64 | #endif /* BROTLI_COMMON_DICTIONARY_H_ */ 65 | -------------------------------------------------------------------------------- /libs/brotli/c/common/platform.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | #include 8 | 9 | #include "./platform.h" 10 | #include 11 | 12 | /* Default brotli_alloc_func */ 13 | void* BrotliDefaultAllocFunc(void* opaque, size_t size) { 14 | BROTLI_UNUSED(opaque); 15 | return malloc(size); 16 | } 17 | 18 | /* Default brotli_free_func */ 19 | void BrotliDefaultFreeFunc(void* opaque, void* address) { 20 | BROTLI_UNUSED(opaque); 21 | free(address); 22 | } 23 | -------------------------------------------------------------------------------- /libs/brotli/c/common/version.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Version definition. */ 8 | 9 | #ifndef BROTLI_COMMON_VERSION_H_ 10 | #define BROTLI_COMMON_VERSION_H_ 11 | 12 | /* This macro should only be used when library is compiled together with client. 13 | If library is dynamically linked, use BrotliDecoderVersion and 14 | BrotliEncoderVersion methods. */ 15 | 16 | /* Semantic version, calculated as (MAJOR << 24) | (MINOR << 12) | PATCH */ 17 | #define BROTLI_VERSION 0x1000009 18 | 19 | /* This macro is used by build system to produce Libtool-friendly soname. See 20 | https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html 21 | */ 22 | 23 | /* ABI version, calculated as (CURRENT << 24) | (REVISION << 12) | AGE */ 24 | #define BROTLI_ABI_VERSION 0x1009000 25 | 26 | #endif /* BROTLI_COMMON_VERSION_H_ */ 27 | -------------------------------------------------------------------------------- /libs/brotli/c/dec/bit_reader.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Bit reading helpers */ 8 | 9 | #include "./bit_reader.h" 10 | 11 | #include "../common/platform.h" 12 | #include 13 | 14 | #if defined(__cplusplus) || defined(c_plusplus) 15 | extern "C" { 16 | #endif 17 | 18 | const uint32_t kBrotliBitMask[33] = { 0x00000000, 19 | 0x00000001, 0x00000003, 0x00000007, 0x0000000F, 20 | 0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF, 21 | 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF, 22 | 0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF, 23 | 0x0001FFFF, 0x0003FFFF, 0x0007FFFF, 0x000FFFFF, 24 | 0x001FFFFF, 0x003FFFFF, 0x007FFFFF, 0x00FFFFFF, 25 | 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF, 26 | 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF 27 | }; 28 | 29 | void BrotliInitBitReader(BrotliBitReader* const br) { 30 | br->val_ = 0; 31 | br->bit_pos_ = sizeof(br->val_) << 3; 32 | } 33 | 34 | BROTLI_BOOL BrotliWarmupBitReader(BrotliBitReader* const br) { 35 | size_t aligned_read_mask = (sizeof(br->val_) >> 1) - 1; 36 | /* Fixing alignment after unaligned BrotliFillWindow would result accumulator 37 | overflow. If unalignment is caused by BrotliSafeReadBits, then there is 38 | enough space in accumulator to fix alignment. */ 39 | if (!BROTLI_ALIGNED_READ) { 40 | aligned_read_mask = 0; 41 | } 42 | if (BrotliGetAvailableBits(br) == 0) { 43 | if (!BrotliPullByte(br)) { 44 | return BROTLI_FALSE; 45 | } 46 | } 47 | 48 | while ((((size_t)br->next_in) & aligned_read_mask) != 0) { 49 | if (!BrotliPullByte(br)) { 50 | /* If we consumed all the input, we don't care about the alignment. */ 51 | return BROTLI_TRUE; 52 | } 53 | } 54 | return BROTLI_TRUE; 55 | } 56 | 57 | BROTLI_BOOL BrotliSafeReadBits32Slow(BrotliBitReader* const br, 58 | uint32_t n_bits, uint32_t* val) { 59 | uint32_t low_val; 60 | uint32_t high_val; 61 | BrotliBitReaderState memento; 62 | BROTLI_DCHECK(n_bits <= 32); 63 | BROTLI_DCHECK(n_bits > 24); 64 | BrotliBitReaderSaveState(br, &memento); 65 | if (!BrotliSafeReadBits(br, 16, &low_val) || 66 | !BrotliSafeReadBits(br, n_bits - 16, &high_val)) { 67 | BrotliBitReaderRestoreState(br, &memento); 68 | return BROTLI_FALSE; 69 | } 70 | *val = low_val | (high_val << 16); 71 | return BROTLI_TRUE; 72 | } 73 | 74 | #if defined(__cplusplus) || defined(c_plusplus) 75 | } /* extern "C" */ 76 | #endif 77 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/backward_references.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Function to find backward reference copies. */ 8 | 9 | #ifndef BROTLI_ENC_BACKWARD_REFERENCES_H_ 10 | #define BROTLI_ENC_BACKWARD_REFERENCES_H_ 11 | 12 | #include "../common/constants.h" 13 | #include "../common/context.h" 14 | #include "../common/dictionary.h" 15 | #include "../common/platform.h" 16 | #include 17 | #include "./command.h" 18 | #include "./hash.h" 19 | #include "./quality.h" 20 | 21 | #if defined(__cplusplus) || defined(c_plusplus) 22 | extern "C" { 23 | #endif 24 | 25 | /* "commands" points to the next output command to write to, "*num_commands" is 26 | initially the total amount of commands output by previous 27 | CreateBackwardReferences calls, and must be incremented by the amount written 28 | by this call. */ 29 | BROTLI_INTERNAL void BrotliCreateBackwardReferences(size_t num_bytes, 30 | size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask, 31 | ContextLut literal_context_lut, const BrotliEncoderParams* params, 32 | Hasher* hasher, int* dist_cache, size_t* last_insert_len, 33 | Command* commands, size_t* num_commands, size_t* num_literals); 34 | 35 | #if defined(__cplusplus) || defined(c_plusplus) 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /* BROTLI_ENC_BACKWARD_REFERENCES_H_ */ 40 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/bit_cost.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Functions to estimate the bit cost of Huffman trees. */ 8 | 9 | #include "./bit_cost.h" 10 | 11 | #include "../common/constants.h" 12 | #include "../common/platform.h" 13 | #include 14 | #include "./fast_log.h" 15 | #include "./histogram.h" 16 | 17 | #if defined(__cplusplus) || defined(c_plusplus) 18 | extern "C" { 19 | #endif 20 | 21 | #define FN(X) X ## Literal 22 | #include "./bit_cost_inc.h" /* NOLINT(build/include) */ 23 | #undef FN 24 | 25 | #define FN(X) X ## Command 26 | #include "./bit_cost_inc.h" /* NOLINT(build/include) */ 27 | #undef FN 28 | 29 | #define FN(X) X ## Distance 30 | #include "./bit_cost_inc.h" /* NOLINT(build/include) */ 31 | #undef FN 32 | 33 | #if defined(__cplusplus) || defined(c_plusplus) 34 | } /* extern "C" */ 35 | #endif 36 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/bit_cost.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Functions to estimate the bit cost of Huffman trees. */ 8 | 9 | #ifndef BROTLI_ENC_BIT_COST_H_ 10 | #define BROTLI_ENC_BIT_COST_H_ 11 | 12 | #include "../common/platform.h" 13 | #include 14 | #include "./fast_log.h" 15 | #include "./histogram.h" 16 | 17 | #if defined(__cplusplus) || defined(c_plusplus) 18 | extern "C" { 19 | #endif 20 | 21 | static BROTLI_INLINE double ShannonEntropy( 22 | const uint32_t* population, size_t size, size_t* total) { 23 | size_t sum = 0; 24 | double retval = 0; 25 | const uint32_t* population_end = population + size; 26 | size_t p; 27 | if (size & 1) { 28 | goto odd_number_of_elements_left; 29 | } 30 | while (population < population_end) { 31 | p = *population++; 32 | sum += p; 33 | retval -= (double)p * FastLog2(p); 34 | odd_number_of_elements_left: 35 | p = *population++; 36 | sum += p; 37 | retval -= (double)p * FastLog2(p); 38 | } 39 | if (sum) retval += (double)sum * FastLog2(sum); 40 | *total = sum; 41 | return retval; 42 | } 43 | 44 | static BROTLI_INLINE double BitsEntropy( 45 | const uint32_t* population, size_t size) { 46 | size_t sum; 47 | double retval = ShannonEntropy(population, size, &sum); 48 | if (retval < sum) { 49 | /* At least one bit per literal is needed. */ 50 | retval = (double)sum; 51 | } 52 | return retval; 53 | } 54 | 55 | BROTLI_INTERNAL double BrotliPopulationCostLiteral(const HistogramLiteral*); 56 | BROTLI_INTERNAL double BrotliPopulationCostCommand(const HistogramCommand*); 57 | BROTLI_INTERNAL double BrotliPopulationCostDistance(const HistogramDistance*); 58 | 59 | #if defined(__cplusplus) || defined(c_plusplus) 60 | } /* extern "C" */ 61 | #endif 62 | 63 | #endif /* BROTLI_ENC_BIT_COST_H_ */ 64 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/block_encoder_inc.h: -------------------------------------------------------------------------------- 1 | /* NOLINT(build/header_guard) */ 2 | /* Copyright 2014 Google Inc. All Rights Reserved. 3 | 4 | Distributed under MIT license. 5 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 6 | */ 7 | 8 | /* template parameters: FN */ 9 | 10 | #define HistogramType FN(Histogram) 11 | 12 | /* Creates entropy codes for all block types and stores them to the bit 13 | stream. */ 14 | static void FN(BuildAndStoreEntropyCodes)(MemoryManager* m, BlockEncoder* self, 15 | const HistogramType* histograms, const size_t histograms_size, 16 | const size_t alphabet_size, HuffmanTree* tree, 17 | size_t* storage_ix, uint8_t* storage) { 18 | const size_t table_size = histograms_size * self->histogram_length_; 19 | self->depths_ = BROTLI_ALLOC(m, uint8_t, table_size); 20 | self->bits_ = BROTLI_ALLOC(m, uint16_t, table_size); 21 | if (BROTLI_IS_OOM(m)) return; 22 | 23 | { 24 | size_t i; 25 | for (i = 0; i < histograms_size; ++i) { 26 | size_t ix = i * self->histogram_length_; 27 | BuildAndStoreHuffmanTree(&histograms[i].data_[0], self->histogram_length_, 28 | alphabet_size, tree, &self->depths_[ix], &self->bits_[ix], 29 | storage_ix, storage); 30 | } 31 | } 32 | } 33 | 34 | #undef HistogramType 35 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/block_splitter.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Block split point selection utilities. */ 8 | 9 | #ifndef BROTLI_ENC_BLOCK_SPLITTER_H_ 10 | #define BROTLI_ENC_BLOCK_SPLITTER_H_ 11 | 12 | #include "../common/platform.h" 13 | #include 14 | #include "./command.h" 15 | #include "./memory.h" 16 | #include "./quality.h" 17 | 18 | #if defined(__cplusplus) || defined(c_plusplus) 19 | extern "C" { 20 | #endif 21 | 22 | typedef struct BlockSplit { 23 | size_t num_types; /* Amount of distinct types */ 24 | size_t num_blocks; /* Amount of values in types and length */ 25 | uint8_t* types; 26 | uint32_t* lengths; 27 | 28 | size_t types_alloc_size; 29 | size_t lengths_alloc_size; 30 | } BlockSplit; 31 | 32 | BROTLI_INTERNAL void BrotliInitBlockSplit(BlockSplit* self); 33 | BROTLI_INTERNAL void BrotliDestroyBlockSplit(MemoryManager* m, 34 | BlockSplit* self); 35 | 36 | BROTLI_INTERNAL void BrotliSplitBlock(MemoryManager* m, 37 | const Command* cmds, 38 | const size_t num_commands, 39 | const uint8_t* data, 40 | const size_t offset, 41 | const size_t mask, 42 | const BrotliEncoderParams* params, 43 | BlockSplit* literal_split, 44 | BlockSplit* insert_and_copy_split, 45 | BlockSplit* dist_split); 46 | 47 | #if defined(__cplusplus) || defined(c_plusplus) 48 | } /* extern "C" */ 49 | #endif 50 | 51 | #endif /* BROTLI_ENC_BLOCK_SPLITTER_H_ */ 52 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/cluster.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Functions for clustering similar histograms together. */ 8 | 9 | #include "./cluster.h" 10 | 11 | #include "../common/platform.h" 12 | #include 13 | #include "./bit_cost.h" /* BrotliPopulationCost */ 14 | #include "./fast_log.h" 15 | #include "./histogram.h" 16 | #include "./memory.h" 17 | 18 | #if defined(__cplusplus) || defined(c_plusplus) 19 | extern "C" { 20 | #endif 21 | 22 | static BROTLI_INLINE BROTLI_BOOL HistogramPairIsLess( 23 | const HistogramPair* p1, const HistogramPair* p2) { 24 | if (p1->cost_diff != p2->cost_diff) { 25 | return TO_BROTLI_BOOL(p1->cost_diff > p2->cost_diff); 26 | } 27 | return TO_BROTLI_BOOL((p1->idx2 - p1->idx1) > (p2->idx2 - p2->idx1)); 28 | } 29 | 30 | /* Returns entropy reduction of the context map when we combine two clusters. */ 31 | static BROTLI_INLINE double ClusterCostDiff(size_t size_a, size_t size_b) { 32 | size_t size_c = size_a + size_b; 33 | return (double)size_a * FastLog2(size_a) + 34 | (double)size_b * FastLog2(size_b) - 35 | (double)size_c * FastLog2(size_c); 36 | } 37 | 38 | #define CODE(X) X 39 | 40 | #define FN(X) X ## Literal 41 | #include "./cluster_inc.h" /* NOLINT(build/include) */ 42 | #undef FN 43 | 44 | #define FN(X) X ## Command 45 | #include "./cluster_inc.h" /* NOLINT(build/include) */ 46 | #undef FN 47 | 48 | #define FN(X) X ## Distance 49 | #include "./cluster_inc.h" /* NOLINT(build/include) */ 50 | #undef FN 51 | 52 | #undef CODE 53 | 54 | #if defined(__cplusplus) || defined(c_plusplus) 55 | } /* extern "C" */ 56 | #endif 57 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/cluster.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Functions for clustering similar histograms together. */ 8 | 9 | #ifndef BROTLI_ENC_CLUSTER_H_ 10 | #define BROTLI_ENC_CLUSTER_H_ 11 | 12 | #include "../common/platform.h" 13 | #include 14 | #include "./histogram.h" 15 | #include "./memory.h" 16 | 17 | #if defined(__cplusplus) || defined(c_plusplus) 18 | extern "C" { 19 | #endif 20 | 21 | typedef struct HistogramPair { 22 | uint32_t idx1; 23 | uint32_t idx2; 24 | double cost_combo; 25 | double cost_diff; 26 | } HistogramPair; 27 | 28 | #define CODE(X) /* Declaration */; 29 | 30 | #define FN(X) X ## Literal 31 | #include "./cluster_inc.h" /* NOLINT(build/include) */ 32 | #undef FN 33 | 34 | #define FN(X) X ## Command 35 | #include "./cluster_inc.h" /* NOLINT(build/include) */ 36 | #undef FN 37 | 38 | #define FN(X) X ## Distance 39 | #include "./cluster_inc.h" /* NOLINT(build/include) */ 40 | #undef FN 41 | 42 | #undef CODE 43 | 44 | #if defined(__cplusplus) || defined(c_plusplus) 45 | } /* extern "C" */ 46 | #endif 47 | 48 | #endif /* BROTLI_ENC_CLUSTER_H_ */ 49 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/command.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | #include "./command.h" 8 | 9 | #include 10 | 11 | #if defined(__cplusplus) || defined(c_plusplus) 12 | extern "C" { 13 | #endif 14 | 15 | const uint32_t kBrotliInsBase[BROTLI_NUM_INS_COPY_CODES] = { 16 | 0, 1, 2, 3, 4, 5, 6, 8, 10, 14, 18, 26, 17 | 34, 50, 66, 98, 130, 194, 322, 578, 1090, 2114, 6210, 22594}; 18 | const uint32_t kBrotliInsExtra[BROTLI_NUM_INS_COPY_CODES] = { 19 | 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 12, 14, 24}; 20 | const uint32_t kBrotliCopyBase[BROTLI_NUM_INS_COPY_CODES] = { 21 | 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 18, 22 | 22, 30, 38, 54, 70, 102, 134, 198, 326, 582, 1094, 2118}; 23 | const uint32_t kBrotliCopyExtra[BROTLI_NUM_INS_COPY_CODES] = { 24 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 24}; 25 | 26 | #if defined(__cplusplus) || defined(c_plusplus) 27 | } /* extern "C" */ 28 | #endif 29 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/compress_fragment_two_pass.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Function for fast encoding of an input fragment, independently from the input 8 | history. This function uses two-pass processing: in the first pass we save 9 | the found backward matches and literal bytes into a buffer, and in the 10 | second pass we emit them into the bit stream using prefix codes built based 11 | on the actual command and literal byte histograms. */ 12 | 13 | #ifndef BROTLI_ENC_COMPRESS_FRAGMENT_TWO_PASS_H_ 14 | #define BROTLI_ENC_COMPRESS_FRAGMENT_TWO_PASS_H_ 15 | 16 | #include "../common/platform.h" 17 | #include 18 | #include "./memory.h" 19 | 20 | #if defined(__cplusplus) || defined(c_plusplus) 21 | extern "C" { 22 | #endif 23 | 24 | static const size_t kCompressFragmentTwoPassBlockSize = 1 << 17; 25 | 26 | /* Compresses "input" string to the "*storage" buffer as one or more complete 27 | meta-blocks, and updates the "*storage_ix" bit position. 28 | 29 | If "is_last" is 1, emits an additional empty last meta-block. 30 | 31 | REQUIRES: "input_size" is greater than zero, or "is_last" is 1. 32 | REQUIRES: "input_size" is less or equal to maximal metablock size (1 << 24). 33 | REQUIRES: "command_buf" and "literal_buf" point to at least 34 | kCompressFragmentTwoPassBlockSize long arrays. 35 | REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero. 36 | REQUIRES: "table_size" is a power of two 37 | OUTPUT: maximal copy distance <= |input_size| 38 | OUTPUT: maximal copy distance <= BROTLI_MAX_BACKWARD_LIMIT(18) */ 39 | BROTLI_INTERNAL void BrotliCompressFragmentTwoPass(MemoryManager* m, 40 | const uint8_t* input, 41 | size_t input_size, 42 | BROTLI_BOOL is_last, 43 | uint32_t* command_buf, 44 | uint8_t* literal_buf, 45 | int* table, 46 | size_t table_size, 47 | size_t* storage_ix, 48 | uint8_t* storage); 49 | 50 | #if defined(__cplusplus) || defined(c_plusplus) 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /* BROTLI_ENC_COMPRESS_FRAGMENT_TWO_PASS_H_ */ 55 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/dictionary_hash.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Hash table on the 4-byte prefixes of static dictionary words. */ 8 | 9 | #ifndef BROTLI_ENC_DICTIONARY_HASH_H_ 10 | #define BROTLI_ENC_DICTIONARY_HASH_H_ 11 | 12 | #include 13 | 14 | #if defined(__cplusplus) || defined(c_plusplus) 15 | extern "C" { 16 | #endif 17 | 18 | extern const uint16_t kStaticDictionaryHashWords[32768]; 19 | extern const uint8_t kStaticDictionaryHashLengths[32768]; 20 | 21 | #if defined(__cplusplus) || defined(c_plusplus) 22 | } /* extern "C" */ 23 | #endif 24 | 25 | #endif /* BROTLI_ENC_DICTIONARY_HASH_H_ */ 26 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/encoder_dict.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | #include "./encoder_dict.h" 8 | 9 | #include "../common/dictionary.h" 10 | #include "../common/transform.h" 11 | #include "./dictionary_hash.h" 12 | #include "./hash.h" 13 | 14 | #if defined(__cplusplus) || defined(c_plusplus) 15 | extern "C" { 16 | #endif 17 | 18 | void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict) { 19 | dict->words = BrotliGetDictionary(); 20 | dict->num_transforms = (uint32_t)BrotliGetTransforms()->num_transforms; 21 | 22 | dict->hash_table_words = kStaticDictionaryHashWords; 23 | dict->hash_table_lengths = kStaticDictionaryHashLengths; 24 | dict->buckets = kStaticDictionaryBuckets; 25 | dict->dict_words = kStaticDictionaryWords; 26 | 27 | dict->cutoffTransformsCount = kCutoffTransformsCount; 28 | dict->cutoffTransforms = kCutoffTransforms; 29 | } 30 | 31 | #if defined(__cplusplus) || defined(c_plusplus) 32 | } /* extern "C" */ 33 | #endif 34 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/encoder_dict.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | #ifndef BROTLI_ENC_ENCODER_DICT_H_ 8 | #define BROTLI_ENC_ENCODER_DICT_H_ 9 | 10 | #include "../common/dictionary.h" 11 | #include "../common/platform.h" 12 | #include 13 | #include "./static_dict_lut.h" 14 | 15 | #if defined(__cplusplus) || defined(c_plusplus) 16 | extern "C" { 17 | #endif 18 | 19 | /* Dictionary data (words and transforms) for 1 possible context */ 20 | typedef struct BrotliEncoderDictionary { 21 | const BrotliDictionary* words; 22 | uint32_t num_transforms; 23 | 24 | /* cut off for fast encoder */ 25 | uint32_t cutoffTransformsCount; 26 | uint64_t cutoffTransforms; 27 | 28 | /* from dictionary_hash.h, for fast encoder */ 29 | const uint16_t* hash_table_words; 30 | const uint8_t* hash_table_lengths; 31 | 32 | /* from static_dict_lut.h, for slow encoder */ 33 | const uint16_t* buckets; 34 | const DictWord* dict_words; 35 | } BrotliEncoderDictionary; 36 | 37 | BROTLI_INTERNAL void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict); 38 | 39 | #if defined(__cplusplus) || defined(c_plusplus) 40 | } /* extern "C" */ 41 | #endif 42 | 43 | #endif /* BROTLI_ENC_ENCODER_DICT_H_ */ 44 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/fast_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Utilities for fast computation of logarithms. */ 8 | 9 | #ifndef BROTLI_ENC_FAST_LOG_H_ 10 | #define BROTLI_ENC_FAST_LOG_H_ 11 | 12 | #include 13 | 14 | #include "../common/platform.h" 15 | #include 16 | 17 | #if defined(__cplusplus) || defined(c_plusplus) 18 | extern "C" { 19 | #endif 20 | 21 | static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) { 22 | #if defined(BROTLI_BSR32) 23 | return BROTLI_BSR32((uint32_t)n); 24 | #else 25 | uint32_t result = 0; 26 | while (n >>= 1) result++; 27 | return result; 28 | #endif 29 | } 30 | 31 | #define BROTLI_LOG2_TABLE_SIZE 256 32 | 33 | /* A lookup table for small values of log2(int) to be used in entropy 34 | computation. */ 35 | BROTLI_INTERNAL extern const double kBrotliLog2Table[BROTLI_LOG2_TABLE_SIZE]; 36 | 37 | /* Visual Studio 2012 and Android API levels < 18 do not have the log2() 38 | * function defined, so we use log() and a multiplication instead. */ 39 | #if !defined(BROTLI_HAVE_LOG2) 40 | #if ((defined(_MSC_VER) && _MSC_VER <= 1700) || \ 41 | (defined(__ANDROID_API__) && __ANDROID_API__ < 18)) 42 | #define BROTLI_HAVE_LOG2 0 43 | #else 44 | #define BROTLI_HAVE_LOG2 1 45 | #endif 46 | #endif 47 | 48 | #define LOG_2_INV 1.4426950408889634 49 | 50 | /* Faster logarithm for small integers, with the property of log2(0) == 0. */ 51 | static BROTLI_INLINE double FastLog2(size_t v) { 52 | if (v < BROTLI_LOG2_TABLE_SIZE) { 53 | return kBrotliLog2Table[v]; 54 | } 55 | #if !(BROTLI_HAVE_LOG2) 56 | return log((double)v) * LOG_2_INV; 57 | #else 58 | return log2((double)v); 59 | #endif 60 | } 61 | 62 | #if defined(__cplusplus) || defined(c_plusplus) 63 | } /* extern "C" */ 64 | #endif 65 | 66 | #endif /* BROTLI_ENC_FAST_LOG_H_ */ 67 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/histogram.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Models the histograms of literals, commands and distance codes. */ 8 | 9 | #ifndef BROTLI_ENC_HISTOGRAM_H_ 10 | #define BROTLI_ENC_HISTOGRAM_H_ 11 | 12 | #include /* memset */ 13 | 14 | #include "../common/constants.h" 15 | #include "../common/context.h" 16 | #include "../common/platform.h" 17 | #include 18 | #include "./block_splitter.h" 19 | #include "./command.h" 20 | 21 | #if defined(__cplusplus) || defined(c_plusplus) 22 | extern "C" { 23 | #endif 24 | 25 | /* The distance symbols effectively used by "Large Window Brotli" (32-bit). */ 26 | #define BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS 544 27 | 28 | #define FN(X) X ## Literal 29 | #define DATA_SIZE BROTLI_NUM_LITERAL_SYMBOLS 30 | #define DataType uint8_t 31 | #include "./histogram_inc.h" /* NOLINT(build/include) */ 32 | #undef DataType 33 | #undef DATA_SIZE 34 | #undef FN 35 | 36 | #define FN(X) X ## Command 37 | #define DataType uint16_t 38 | #define DATA_SIZE BROTLI_NUM_COMMAND_SYMBOLS 39 | #include "./histogram_inc.h" /* NOLINT(build/include) */ 40 | #undef DATA_SIZE 41 | #undef FN 42 | 43 | #define FN(X) X ## Distance 44 | #define DATA_SIZE BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS 45 | #include "./histogram_inc.h" /* NOLINT(build/include) */ 46 | #undef DataType 47 | #undef DATA_SIZE 48 | #undef FN 49 | 50 | BROTLI_INTERNAL void BrotliBuildHistogramsWithContext( 51 | const Command* cmds, const size_t num_commands, 52 | const BlockSplit* literal_split, const BlockSplit* insert_and_copy_split, 53 | const BlockSplit* dist_split, const uint8_t* ringbuffer, size_t pos, 54 | size_t mask, uint8_t prev_byte, uint8_t prev_byte2, 55 | const ContextType* context_modes, HistogramLiteral* literal_histograms, 56 | HistogramCommand* insert_and_copy_histograms, 57 | HistogramDistance* copy_dist_histograms); 58 | 59 | #if defined(__cplusplus) || defined(c_plusplus) 60 | } /* extern "C" */ 61 | #endif 62 | 63 | #endif /* BROTLI_ENC_HISTOGRAM_H_ */ 64 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/histogram_inc.h: -------------------------------------------------------------------------------- 1 | /* NOLINT(build/header_guard) */ 2 | /* Copyright 2013 Google Inc. All Rights Reserved. 3 | 4 | Distributed under MIT license. 5 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 6 | */ 7 | 8 | /* template parameters: Histogram, DATA_SIZE, DataType */ 9 | 10 | /* A simple container for histograms of data in blocks. */ 11 | 12 | typedef struct FN(Histogram) { 13 | uint32_t data_[DATA_SIZE]; 14 | size_t total_count_; 15 | double bit_cost_; 16 | } FN(Histogram); 17 | 18 | static BROTLI_INLINE void FN(HistogramClear)(FN(Histogram)* self) { 19 | memset(self->data_, 0, sizeof(self->data_)); 20 | self->total_count_ = 0; 21 | self->bit_cost_ = HUGE_VAL; 22 | } 23 | 24 | static BROTLI_INLINE void FN(ClearHistograms)( 25 | FN(Histogram)* array, size_t length) { 26 | size_t i; 27 | for (i = 0; i < length; ++i) FN(HistogramClear)(array + i); 28 | } 29 | 30 | static BROTLI_INLINE void FN(HistogramAdd)(FN(Histogram)* self, size_t val) { 31 | ++self->data_[val]; 32 | ++self->total_count_; 33 | } 34 | 35 | static BROTLI_INLINE void FN(HistogramAddVector)(FN(Histogram)* self, 36 | const DataType* p, size_t n) { 37 | self->total_count_ += n; 38 | n += 1; 39 | while (--n) ++self->data_[*p++]; 40 | } 41 | 42 | static BROTLI_INLINE void FN(HistogramAddHistogram)(FN(Histogram)* self, 43 | const FN(Histogram)* v) { 44 | size_t i; 45 | self->total_count_ += v->total_count_; 46 | for (i = 0; i < DATA_SIZE; ++i) { 47 | self->data_[i] += v->data_[i]; 48 | } 49 | } 50 | 51 | static BROTLI_INLINE size_t FN(HistogramDataSize)(void) { return DATA_SIZE; } 52 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/literal_cost.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Literal cost model to allow backward reference replacement to be efficient. 8 | */ 9 | 10 | #ifndef BROTLI_ENC_LITERAL_COST_H_ 11 | #define BROTLI_ENC_LITERAL_COST_H_ 12 | 13 | #include "../common/platform.h" 14 | #include 15 | 16 | #if defined(__cplusplus) || defined(c_plusplus) 17 | extern "C" { 18 | #endif 19 | 20 | /* Estimates how many bits the literals in the interval [pos, pos + len) in the 21 | ring-buffer (data, mask) will take entropy coded and writes these estimates 22 | to the cost[0..len) array. */ 23 | BROTLI_INTERNAL void BrotliEstimateBitCostsForLiterals( 24 | size_t pos, size_t len, size_t mask, const uint8_t* data, float* cost); 25 | 26 | #if defined(__cplusplus) || defined(c_plusplus) 27 | } /* extern "C" */ 28 | #endif 29 | 30 | #endif /* BROTLI_ENC_LITERAL_COST_H_ */ 31 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/params.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Parameters for the Brotli encoder with chosen quality levels. */ 8 | 9 | #ifndef BROTLI_ENC_PARAMS_H_ 10 | #define BROTLI_ENC_PARAMS_H_ 11 | 12 | #include 13 | #include "./encoder_dict.h" 14 | 15 | typedef struct BrotliHasherParams { 16 | int type; 17 | int bucket_bits; 18 | int block_bits; 19 | int hash_len; 20 | int num_last_distances_to_check; 21 | } BrotliHasherParams; 22 | 23 | typedef struct BrotliDistanceParams { 24 | uint32_t distance_postfix_bits; 25 | uint32_t num_direct_distance_codes; 26 | uint32_t alphabet_size_max; 27 | uint32_t alphabet_size_limit; 28 | size_t max_distance; 29 | } BrotliDistanceParams; 30 | 31 | /* Encoding parameters */ 32 | typedef struct BrotliEncoderParams { 33 | BrotliEncoderMode mode; 34 | int quality; 35 | int lgwin; 36 | int lgblock; 37 | size_t stream_offset; 38 | size_t size_hint; 39 | BROTLI_BOOL disable_literal_context_modeling; 40 | BROTLI_BOOL large_window; 41 | BrotliHasherParams hasher; 42 | BrotliDistanceParams dist; 43 | BrotliEncoderDictionary dictionary; 44 | } BrotliEncoderParams; 45 | 46 | #endif /* BROTLI_ENC_PARAMS_H_ */ 47 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/prefix.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Functions for encoding of integers into prefix codes the amount of extra 8 | bits, and the actual values of the extra bits. */ 9 | 10 | #ifndef BROTLI_ENC_PREFIX_H_ 11 | #define BROTLI_ENC_PREFIX_H_ 12 | 13 | #include "../common/constants.h" 14 | #include "../common/platform.h" 15 | #include 16 | #include "./fast_log.h" 17 | 18 | #if defined(__cplusplus) || defined(c_plusplus) 19 | extern "C" { 20 | #endif 21 | 22 | /* Here distance_code is an intermediate code, i.e. one of the special codes or 23 | the actual distance increased by BROTLI_NUM_DISTANCE_SHORT_CODES - 1. */ 24 | static BROTLI_INLINE void PrefixEncodeCopyDistance(size_t distance_code, 25 | size_t num_direct_codes, 26 | size_t postfix_bits, 27 | uint16_t* code, 28 | uint32_t* extra_bits) { 29 | if (distance_code < BROTLI_NUM_DISTANCE_SHORT_CODES + num_direct_codes) { 30 | *code = (uint16_t)distance_code; 31 | *extra_bits = 0; 32 | return; 33 | } else { 34 | size_t dist = ((size_t)1 << (postfix_bits + 2u)) + 35 | (distance_code - BROTLI_NUM_DISTANCE_SHORT_CODES - num_direct_codes); 36 | size_t bucket = Log2FloorNonZero(dist) - 1; 37 | size_t postfix_mask = (1u << postfix_bits) - 1; 38 | size_t postfix = dist & postfix_mask; 39 | size_t prefix = (dist >> bucket) & 1; 40 | size_t offset = (2 + prefix) << bucket; 41 | size_t nbits = bucket - postfix_bits; 42 | *code = (uint16_t)((nbits << 10) | 43 | (BROTLI_NUM_DISTANCE_SHORT_CODES + num_direct_codes + 44 | ((2 * (nbits - 1) + prefix) << postfix_bits) + postfix)); 45 | *extra_bits = (uint32_t)((dist - offset) >> postfix_bits); 46 | } 47 | } 48 | 49 | #if defined(__cplusplus) || defined(c_plusplus) 50 | } /* extern "C" */ 51 | #endif 52 | 53 | #endif /* BROTLI_ENC_PREFIX_H_ */ 54 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/static_dict.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Class to model the static dictionary. */ 8 | 9 | #ifndef BROTLI_ENC_STATIC_DICT_H_ 10 | #define BROTLI_ENC_STATIC_DICT_H_ 11 | 12 | #include "../common/dictionary.h" 13 | #include "../common/platform.h" 14 | #include 15 | #include "./encoder_dict.h" 16 | 17 | #if defined(__cplusplus) || defined(c_plusplus) 18 | extern "C" { 19 | #endif 20 | 21 | #define BROTLI_MAX_STATIC_DICTIONARY_MATCH_LEN 37 22 | static const uint32_t kInvalidMatch = 0xFFFFFFF; 23 | 24 | /* Matches data against static dictionary words, and for each length l, 25 | for which a match is found, updates matches[l] to be the minimum possible 26 | (distance << 5) + len_code. 27 | Returns 1 if matches have been found, otherwise 0. 28 | Prerequisites: 29 | matches array is at least BROTLI_MAX_STATIC_DICTIONARY_MATCH_LEN + 1 long 30 | all elements are initialized to kInvalidMatch */ 31 | BROTLI_INTERNAL BROTLI_BOOL BrotliFindAllStaticDictionaryMatches( 32 | const BrotliEncoderDictionary* dictionary, 33 | const uint8_t* data, size_t min_length, size_t max_length, 34 | uint32_t* matches); 35 | 36 | #if defined(__cplusplus) || defined(c_plusplus) 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /* BROTLI_ENC_STATIC_DICT_H_ */ 41 | -------------------------------------------------------------------------------- /libs/brotli/c/enc/utf8_util.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Heuristics for deciding about the UTF8-ness of strings. */ 8 | 9 | #ifndef BROTLI_ENC_UTF8_UTIL_H_ 10 | #define BROTLI_ENC_UTF8_UTIL_H_ 11 | 12 | #include "../common/platform.h" 13 | #include 14 | 15 | #if defined(__cplusplus) || defined(c_plusplus) 16 | extern "C" { 17 | #endif 18 | 19 | static const double kMinUTF8Ratio = 0.75; 20 | 21 | /* Returns 1 if at least min_fraction of the bytes between pos and 22 | pos + length in the (data, mask) ring-buffer is UTF8-encoded, otherwise 23 | returns 0. */ 24 | BROTLI_INTERNAL BROTLI_BOOL BrotliIsMostlyUTF8( 25 | const uint8_t* data, const size_t pos, const size_t mask, 26 | const size_t length, const double min_fraction); 27 | 28 | #if defined(__cplusplus) || defined(c_plusplus) 29 | } /* extern "C" */ 30 | #endif 31 | 32 | #endif /* BROTLI_ENC_UTF8_UTIL_H_ */ 33 | -------------------------------------------------------------------------------- /libs/brotli/compiler_config_setting.bzl: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Google Inc. All Rights Reserved. 2 | # 3 | # Distributed under MIT license. 4 | # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | 6 | """Creates config_setting that allows selecting based on 'compiler' value.""" 7 | 8 | def create_msvc_config(): 9 | # The "do_not_use_tools_cpp_compiler_present" attribute exists to 10 | # distinguish between older versions of Bazel that do not support 11 | # "@bazel_tools//tools/cpp:compiler" flag_value, and newer ones that do. 12 | # In the future, the only way to select on the compiler will be through 13 | # flag_values{"@bazel_tools//tools/cpp:compiler"} and the else branch can 14 | # be removed. 15 | if hasattr(cc_common, "do_not_use_tools_cpp_compiler_present"): 16 | native.config_setting( 17 | name = "msvc", 18 | flag_values = { 19 | "@bazel_tools//tools/cpp:compiler": "msvc-cl", 20 | }, 21 | visibility = ["//visibility:public"], 22 | ) 23 | else: 24 | native.config_setting( 25 | name = "msvc", 26 | values = {"compiler": "msvc-cl"}, 27 | visibility = ["//visibility:public"], 28 | ) 29 | -------------------------------------------------------------------------------- /libs/brotli/configure: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "Use Autotools, Bazel, CMake or Premake5 to generate projects / build files." 3 | echo " Bazel: http://www.bazel.build/" 4 | echo " CMake: https://cmake.org/" 5 | echo " Premake5: https://premake.github.io/" 6 | echo "To generate Autotools 'configure' file run './bootstrap'." 7 | echo "Run './configure-cmake' for Autotools-like CMake configuration." 8 | echo "Or simply run 'make' to build and test command line tool." 9 | -------------------------------------------------------------------------------- /libs/brotli/configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ(2.57) 2 | 3 | dnl Actual version is substituted by bootstrap 4 | AC_INIT([brotli], [0.0.0], [https://groups.google.com/forum/#!forum/brotli]) 5 | 6 | AM_INIT_AUTOMAKE() 7 | AC_CONFIG_MACRO_DIR([m4]) 8 | 9 | AC_PROG_CC 10 | LT_INIT 11 | 12 | AC_CONFIG_FILES([Makefile scripts/libbrotlicommon.pc scripts/libbrotlidec.pc scripts/libbrotlienc.pc]) 13 | 14 | AC_OUTPUT -------------------------------------------------------------------------------- /libs/brotli/premake5.lua: -------------------------------------------------------------------------------- 1 | -- A solution contains projects, and defines the available configurations 2 | solution "brotli" 3 | configurations { "Release", "Debug" } 4 | platforms { "x64", "x86" } 5 | targetdir "bin" 6 | location "buildfiles" 7 | flags "RelativeLinks" 8 | includedirs { "c/include" } 9 | 10 | filter "configurations:Release" 11 | optimize "Speed" 12 | flags { "StaticRuntime" } 13 | 14 | filter "configurations:Debug" 15 | flags { "Symbols" } 16 | 17 | filter { "platforms:x64" } 18 | architecture "x86_64" 19 | 20 | filter { "platforms:x86" } 21 | architecture "x86" 22 | 23 | configuration { "gmake" } 24 | buildoptions { "-Wall -fno-omit-frame-pointer" } 25 | location "buildfiles/gmake" 26 | 27 | configuration { "xcode4" } 28 | location "buildfiles/xcode4" 29 | 30 | configuration "linux" 31 | links "m" 32 | 33 | configuration { "macosx" } 34 | defines { "OS_MACOSX" } 35 | 36 | project "brotlicommon" 37 | kind "SharedLib" 38 | language "C" 39 | files { "c/common/**.h", "c/common/**.c" } 40 | 41 | project "brotlicommon_static" 42 | kind "StaticLib" 43 | targetname "brotlicommon" 44 | language "C" 45 | files { "c/common/**.h", "c/common/**.c" } 46 | 47 | project "brotlidec" 48 | kind "SharedLib" 49 | language "C" 50 | files { "c/dec/**.h", "c/dec/**.c" } 51 | links "brotlicommon" 52 | 53 | project "brotlidec_static" 54 | kind "StaticLib" 55 | targetname "brotlidec" 56 | language "C" 57 | files { "c/dec/**.h", "c/dec/**.c" } 58 | links "brotlicommon_static" 59 | 60 | project "brotlienc" 61 | kind "SharedLib" 62 | language "C" 63 | files { "c/enc/**.h", "c/enc/**.c" } 64 | links "brotlicommon" 65 | 66 | project "brotlienc_static" 67 | kind "StaticLib" 68 | targetname "brotlienc" 69 | language "C" 70 | files { "c/enc/**.h", "c/enc/**.c" } 71 | links "brotlicommon_static" 72 | 73 | project "brotli" 74 | kind "ConsoleApp" 75 | language "C" 76 | linkoptions "-static" 77 | files { "c/tools/brotli.c" } 78 | links { "brotlicommon_static", "brotlidec_static", "brotlienc_static" } 79 | -------------------------------------------------------------------------------- /libs/brotli/scripts/libbrotlicommon.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libbrotlicommon 7 | URL: https://github.com/google/brotli 8 | Description: Brotli common dictionary library 9 | Version: @PACKAGE_VERSION@ 10 | Libs: -L${libdir} -R${libdir} -lbrotlicommon 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /libs/brotli/scripts/libbrotlidec.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libbrotlidec 7 | URL: https://github.com/google/brotli 8 | Description: Brotli decoder library 9 | Version: @PACKAGE_VERSION@ 10 | Libs: -L${libdir} -R${libdir} -lbrotlidec 11 | Requires.private: libbrotlicommon >= 1.0.2 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /libs/brotli/scripts/libbrotlienc.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libbrotlienc 7 | URL: https://github.com/google/brotli 8 | Description: Brotli encoder library 9 | Version: @PACKAGE_VERSION@ 10 | Libs: -L${libdir} -R${libdir} -lbrotlienc 11 | Requires.private: libbrotlicommon >= 1.0.2 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /libs/brotli/setup.cfg: -------------------------------------------------------------------------------- 1 | [build] 2 | build-base=bin 3 | 4 | [yapf] 5 | based_on_style=google 6 | -------------------------------------------------------------------------------- /libs/glm/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | 30 | # CMake 31 | CMakeCache.txt 32 | CMakeFiles 33 | cmake_install.cmake 34 | install_manifest.txt 35 | *.cmake 36 | # ^ May need to add future .cmake files as exceptions 37 | 38 | # Test logs 39 | Testing/* 40 | 41 | # Test input 42 | test/gtc/*.dds 43 | 44 | # Project Files 45 | Makefile 46 | *.cbp 47 | *.user 48 | 49 | # Misc. 50 | *.log 51 | 52 | # local build(s) 53 | build* 54 | 55 | -------------------------------------------------------------------------------- /libs/glm/glm/common.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/common.hpp 3 | 4 | #pragma once 5 | 6 | #include "detail/func_common.hpp" 7 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/_fixes.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/_fixes.hpp 3 | 4 | #include 5 | 6 | //! Workaround for compatibility with other libraries 7 | #ifdef max 8 | #undef max 9 | #endif 10 | 11 | //! Workaround for compatibility with other libraries 12 | #ifdef min 13 | #undef min 14 | #endif 15 | 16 | //! Workaround for Android 17 | #ifdef isnan 18 | #undef isnan 19 | #endif 20 | 21 | //! Workaround for Android 22 | #ifdef isinf 23 | #undef isinf 24 | #endif 25 | 26 | //! Workaround for Chrone Native Client 27 | #ifdef log2 28 | #undef log2 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/func_exponential_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/func_exponential_simd.inl 3 | 4 | #include "../simd/exponential.h" 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | namespace glm{ 9 | namespace detail 10 | { 11 | template 12 | struct compute_sqrt 13 | { 14 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & v) 15 | { 16 | tvec4 result(uninitialize); 17 | result.data = _mm_sqrt_ps(v.data); 18 | return result; 19 | } 20 | }; 21 | 22 | template <> 23 | struct compute_sqrt 24 | { 25 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & v) 26 | { 27 | tvec4 result(uninitialize); 28 | result.data = glm_vec4_sqrt_lowp(v.data); 29 | return result; 30 | } 31 | }; 32 | }//namespace detail 33 | }//namespace glm 34 | 35 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 36 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/func_integer_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/func_integer_simd.inl 3 | 4 | #include "../simd/integer.h" 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | namespace glm{ 9 | namespace detail 10 | { 11 | template 12 | struct compute_bitfieldReverseStep 13 | { 14 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & v, uint32 Mask, uint32 Shift) 15 | { 16 | __m128i const set0 = v.data; 17 | 18 | __m128i const set1 = _mm_set1_epi32(Mask); 19 | __m128i const and1 = _mm_and_si128(set0, set1); 20 | __m128i const sft1 = _mm_slli_epi32(and1, Shift); 21 | 22 | __m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1)); 23 | __m128i const and2 = _mm_and_si128(set0, set2); 24 | __m128i const sft2 = _mm_srai_epi32(and2, Shift); 25 | 26 | __m128i const or0 = _mm_or_si128(sft1, sft2); 27 | 28 | return or0; 29 | } 30 | }; 31 | 32 | template 33 | struct compute_bitfieldBitCountStep 34 | { 35 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & v, uint32 Mask, uint32 Shift) 36 | { 37 | __m128i const set0 = v.data; 38 | 39 | __m128i const set1 = _mm_set1_epi32(Mask); 40 | __m128i const and0 = _mm_and_si128(set0, set1); 41 | __m128i const sft0 = _mm_slli_epi32(set0, Shift); 42 | __m128i const and1 = _mm_and_si128(sft0, set1); 43 | __m128i const add0 = _mm_add_epi32(and0, and1); 44 | 45 | return add0; 46 | } 47 | }; 48 | }//namespace detail 49 | 50 | # if GLM_ARCH & GLM_ARCH_AVX_BIT 51 | template <> 52 | GLM_FUNC_QUALIFIER int bitCount(uint32 x) 53 | { 54 | return _mm_popcnt_u32(x); 55 | } 56 | 57 | template <> 58 | GLM_FUNC_QUALIFIER int bitCount(uint64 x) 59 | { 60 | return static_cast(_mm_popcnt_u64(x)); 61 | } 62 | # endif 63 | 64 | }//namespace glm 65 | 66 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 67 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/func_packing_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/func_packing_simd.inl 3 | 4 | namespace glm{ 5 | namespace detail 6 | { 7 | 8 | }//namespace detail 9 | }//namespace glm 10 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/func_trigonometric_simd.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/potree/CPotree/dc13ad12cdf9cb791f59204398d427b5e3801ad4/libs/glm/glm/detail/func_trigonometric_simd.inl -------------------------------------------------------------------------------- /libs/glm/glm/detail/func_vector_relational_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/func_vector_relational_simd.inl 3 | 4 | namespace glm{ 5 | namespace detail 6 | { 7 | 8 | }//namespace detail 9 | }//namespace glm 10 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/precision.hpp 3 | 4 | #pragma once 5 | 6 | #include "setup.hpp" 7 | 8 | namespace glm 9 | { 10 | enum precision 11 | { 12 | packed_highp, 13 | packed_mediump, 14 | packed_lowp, 15 | 16 | # if GLM_HAS_ALIGNED_TYPE 17 | aligned_highp, 18 | aligned_mediump, 19 | aligned_lowp, 20 | aligned = aligned_highp, 21 | # endif 22 | 23 | highp = packed_highp, 24 | mediump = packed_mediump, 25 | lowp = packed_lowp, 26 | packed = packed_highp, 27 | 28 | # if GLM_HAS_ALIGNED_TYPE && defined(GLM_FORCE_ALIGNED) 29 | defaultp = aligned_highp 30 | # else 31 | defaultp = highp 32 | # endif 33 | }; 34 | 35 | namespace detail 36 | { 37 | template 38 | struct is_aligned 39 | { 40 | static const bool value = false; 41 | }; 42 | 43 | # if GLM_HAS_ALIGNED_TYPE 44 | template<> 45 | struct is_aligned 46 | { 47 | static const bool value = true; 48 | }; 49 | 50 | template<> 51 | struct is_aligned 52 | { 53 | static const bool value = true; 54 | }; 55 | 56 | template<> 57 | struct is_aligned 58 | { 59 | static const bool value = true; 60 | }; 61 | # endif 62 | }//namespace detail 63 | }//namespace glm 64 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/type_half.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/type_half.hpp 3 | 4 | #pragma once 5 | 6 | #include "setup.hpp" 7 | 8 | namespace glm{ 9 | namespace detail 10 | { 11 | typedef short hdata; 12 | 13 | GLM_FUNC_DECL float toFloat32(hdata value); 14 | GLM_FUNC_DECL hdata toFloat16(float const & value); 15 | 16 | }//namespace detail 17 | }//namespace glm 18 | 19 | #include "type_half.inl" 20 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/type_mat.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/type_mat.inl 3 | 4 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/type_mat4x4_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/type_mat4x4_sse2.inl 3 | 4 | namespace glm 5 | { 6 | 7 | }//namespace glm 8 | -------------------------------------------------------------------------------- /libs/glm/glm/detail/type_vec.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/type_vec.inl 3 | -------------------------------------------------------------------------------- /libs/glm/glm/exponential.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/exponential.hpp 3 | 4 | #pragma once 5 | 6 | #include "detail/func_exponential.hpp" 7 | -------------------------------------------------------------------------------- /libs/glm/glm/geometric.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/geometric.hpp 3 | 4 | #pragma once 5 | 6 | #include "detail/func_geometric.hpp" 7 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/color_encoding.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_color_encoding 2 | /// @file glm/gtc/color_encoding.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_color_encoding (dependence) 6 | /// 7 | /// @defgroup gtc_color_encoding GLM_GTC_color_encoding 8 | /// @ingroup gtc 9 | /// 10 | /// @brief Allow to perform bit operations on integer values 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependencies 17 | #include "../detail/setup.hpp" 18 | #include "../detail/precision.hpp" 19 | #include "../vec3.hpp" 20 | #include 21 | 22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 23 | # pragma message("GLM: GLM_GTC_color_encoding extension included") 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtc_color_encoding 29 | /// @{ 30 | 31 | /// Convert a linear sRGB color to D65 YUV. 32 | template 33 | GLM_FUNC_DECL tvec3 convertLinearSRGBToD65XYZ(tvec3 const& ColorLinearSRGB); 34 | 35 | /// Convert a D65 YUV color to linear sRGB. 36 | template 37 | GLM_FUNC_DECL tvec3 convertD65XYZToLinearSRGB(tvec3 const& ColorD65XYZ); 38 | 39 | /// Convert a D50 YUV color to D65 YUV. 40 | template 41 | GLM_FUNC_DECL tvec3 convertD50XYZToD65XYZ(tvec3 const& ColorD50XYZ); 42 | 43 | /// Convert a D65 YUV color to D50 YUV. 44 | template 45 | GLM_FUNC_DECL tvec3 convertD65XYZToD50XYZ(tvec3 const& ColorD65XYZ); 46 | 47 | /// @} 48 | } //namespace glm 49 | 50 | #include "color_encoding.inl" 51 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/color_encoding.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_color_encoding 2 | /// @file glm/gtc/color_encoding.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tvec3 convertLinearSRGBToD65XYZ(tvec3 const& ColorLinearSRGB) 8 | { 9 | tvec3 const M(0.490f, 0.17697f, 0.2f); 10 | tvec3 const N(0.31f, 0.8124f, 0.01063f); 11 | tvec3 const O(0.490f, 0.01f, 0.99f); 12 | 13 | return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast(5.650675255693055f); 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER tvec3 convertD65XYZToLinearSRGB(tvec3 const& ColorD65XYZ) 18 | { 19 | tvec3 const M(0.41847f, -0.091169f, 0.0009209f); 20 | tvec3 const N(-0.15866f, 0.25243f, 0.015708f); 21 | tvec3 const O(0.0009209f, -0.0025498f, 0.1786f); 22 | 23 | return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER tvec3 convertLinearSRGBToD50XYZ(tvec3 const& ColorLinearSRGB) 28 | { 29 | tvec3 const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f); 30 | tvec3 const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f); 31 | tvec3 const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f); 32 | 33 | return M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB; 34 | } 35 | 36 | template 37 | GLM_FUNC_QUALIFIER tvec3 convertD50XYZToLinearSRGB(tvec3 const& ColorD50XYZ) 38 | { 39 | tvec3 const M(); 40 | tvec3 const N(); 41 | tvec3 const O(); 42 | 43 | return M * ColorD50XYZ + N * ColorD50XYZ + O * ColorD50XYZ; 44 | } 45 | 46 | template 47 | GLM_FUNC_QUALIFIER tvec3 convertD65XYZToD50XYZ(tvec3 const& ColorD65XYZ) 48 | { 49 | tvec3 const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f); 50 | tvec3 const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f); 51 | tvec3 const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f); 52 | 53 | return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; 54 | } 55 | 56 | template 57 | GLM_FUNC_QUALIFIER tvec3 convertD50XYZToD65XYZ(tvec3 const& ColorD50XYZ) 58 | { 59 | tvec3 const M(); 60 | tvec3 const N(); 61 | tvec3 const O(); 62 | 63 | return M * ColorD50XYZ + N * ColorD50XYZ + O * ColorD50XYZ; 64 | } 65 | }//namespace glm 66 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/color_space.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_color_space 2 | /// @file glm/gtc/color_space.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_color_space (dependence) 6 | /// 7 | /// @defgroup gtc_color_space GLM_GTC_color_space 8 | /// @ingroup gtc 9 | /// 10 | /// @brief Allow to perform bit operations on integer values 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependencies 17 | #include "../detail/setup.hpp" 18 | #include "../detail/precision.hpp" 19 | #include "../exponential.hpp" 20 | #include "../vec3.hpp" 21 | #include "../vec4.hpp" 22 | #include 23 | 24 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 25 | # pragma message("GLM: GLM_GTC_color_space extension included") 26 | #endif 27 | 28 | namespace glm 29 | { 30 | /// @addtogroup gtc_color_space 31 | /// @{ 32 | 33 | /// Convert a linear color to sRGB color using a standard gamma correction. 34 | /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb 35 | template class vecType> 36 | GLM_FUNC_DECL vecType convertLinearToSRGB(vecType const & ColorLinear); 37 | 38 | /// Convert a linear color to sRGB color using a custom gamma correction. 39 | /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb 40 | template class vecType> 41 | GLM_FUNC_DECL vecType convertLinearToSRGB(vecType const & ColorLinear, T Gamma); 42 | 43 | /// Convert a sRGB color to linear color using a standard gamma correction. 44 | /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb 45 | template class vecType> 46 | GLM_FUNC_DECL vecType convertSRGBToLinear(vecType const & ColorSRGB); 47 | 48 | /// Convert a sRGB color to linear color using a custom gamma correction. 49 | // IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb 50 | template class vecType> 51 | GLM_FUNC_DECL vecType convertSRGBToLinear(vecType const & ColorSRGB, T Gamma); 52 | 53 | /// @} 54 | } //namespace glm 55 | 56 | #include "color_space.inl" 57 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/epsilon.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_epsilon 2 | /// @file glm/gtc/epsilon.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_half_float (dependence) 6 | /// @see gtc_quaternion (dependence) 7 | /// 8 | /// @defgroup gtc_epsilon GLM_GTC_epsilon 9 | /// @ingroup gtc 10 | /// 11 | /// @brief Comparison functions for a user defined epsilon values. 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependencies 18 | #include "../detail/setup.hpp" 19 | #include "../detail/precision.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTC_epsilon extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtc_epsilon 28 | /// @{ 29 | 30 | /// Returns the component-wise comparison of |x - y| < epsilon. 31 | /// True if this expression is satisfied. 32 | /// 33 | /// @see gtc_epsilon 34 | template class vecType> 35 | GLM_FUNC_DECL vecType epsilonEqual( 36 | vecType const & x, 37 | vecType const & y, 38 | T const & epsilon); 39 | 40 | /// Returns the component-wise comparison of |x - y| < epsilon. 41 | /// True if this expression is satisfied. 42 | /// 43 | /// @see gtc_epsilon 44 | template 45 | GLM_FUNC_DECL bool epsilonEqual( 46 | genType const & x, 47 | genType const & y, 48 | genType const & epsilon); 49 | 50 | /// Returns the component-wise comparison of |x - y| < epsilon. 51 | /// True if this expression is not satisfied. 52 | /// 53 | /// @see gtc_epsilon 54 | template 55 | GLM_FUNC_DECL typename genType::boolType epsilonNotEqual( 56 | genType const & x, 57 | genType const & y, 58 | typename genType::value_type const & epsilon); 59 | 60 | /// Returns the component-wise comparison of |x - y| >= epsilon. 61 | /// True if this expression is not satisfied. 62 | /// 63 | /// @see gtc_epsilon 64 | template 65 | GLM_FUNC_DECL bool epsilonNotEqual( 66 | genType const & x, 67 | genType const & y, 68 | genType const & epsilon); 69 | 70 | /// @} 71 | }//namespace glm 72 | 73 | #include "epsilon.inl" 74 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/functions.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_functions 2 | /// @file glm/gtc/functions.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_half_float (dependence) 6 | /// @see gtc_quaternion (dependence) 7 | /// 8 | /// @defgroup gtc_functions GLM_GTC_functions 9 | /// @ingroup gtc 10 | /// 11 | /// @brief List of useful common functions. 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependencies 18 | #include "../detail/setup.hpp" 19 | #include "../detail/precision.hpp" 20 | #include "../detail/type_vec2.hpp" 21 | 22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 23 | # pragma message("GLM: GLM_GTC_functions extension included") 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtc_functions 29 | /// @{ 30 | 31 | /// 1D gauss function 32 | /// 33 | /// @see gtc_epsilon 34 | template 35 | GLM_FUNC_DECL T gauss( 36 | T x, 37 | T ExpectedValue, 38 | T StandardDeviation); 39 | 40 | /// 2D gauss function 41 | /// 42 | /// @see gtc_epsilon 43 | template 44 | GLM_FUNC_DECL T gauss( 45 | tvec2 const& Coord, 46 | tvec2 const& ExpectedValue, 47 | tvec2 const& StandardDeviation); 48 | 49 | /// @} 50 | }//namespace glm 51 | 52 | #include "functions.inl" 53 | 54 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/functions.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_functions 2 | /// @file glm/gtc/functions.inl 3 | 4 | #include "../detail/func_exponential.hpp" 5 | 6 | namespace glm 7 | { 8 | template 9 | GLM_FUNC_QUALIFIER T gauss 10 | ( 11 | T x, 12 | T ExpectedValue, 13 | T StandardDeviation 14 | ) 15 | { 16 | return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast(6.28318530717958647692528676655900576))); 17 | } 18 | 19 | template 20 | GLM_FUNC_QUALIFIER T gauss 21 | ( 22 | tvec2 const& Coord, 23 | tvec2 const& ExpectedValue, 24 | tvec2 const& StandardDeviation 25 | ) 26 | { 27 | tvec2 const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation); 28 | return exp(-(Squared.x + Squared.y)); 29 | } 30 | }//namespace glm 31 | 32 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/matrix_access.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_matrix_access 2 | /// @file glm/gtc/matrix_access.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_matrix_access GLM_GTC_matrix_access 7 | /// @ingroup gtc 8 | /// 9 | /// Defines functions to access rows or columns of a matrix easily. 10 | /// need to be included to use these functionalities. 11 | 12 | #pragma once 13 | 14 | // Dependency: 15 | #include "../detail/setup.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_GTC_matrix_access extension included") 19 | #endif 20 | 21 | namespace glm 22 | { 23 | /// @addtogroup gtc_matrix_access 24 | /// @{ 25 | 26 | /// Get a specific row of a matrix. 27 | /// @see gtc_matrix_access 28 | template 29 | GLM_FUNC_DECL typename genType::row_type row( 30 | genType const & m, 31 | length_t index); 32 | 33 | /// Set a specific row to a matrix. 34 | /// @see gtc_matrix_access 35 | template 36 | GLM_FUNC_DECL genType row( 37 | genType const & m, 38 | length_t index, 39 | typename genType::row_type const & x); 40 | 41 | /// Get a specific column of a matrix. 42 | /// @see gtc_matrix_access 43 | template 44 | GLM_FUNC_DECL typename genType::col_type column( 45 | genType const & m, 46 | length_t index); 47 | 48 | /// Set a specific column to a matrix. 49 | /// @see gtc_matrix_access 50 | template 51 | GLM_FUNC_DECL genType column( 52 | genType const & m, 53 | length_t index, 54 | typename genType::col_type const & x); 55 | 56 | /// @} 57 | }//namespace glm 58 | 59 | #include "matrix_access.inl" 60 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/matrix_access.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_matrix_access 2 | /// @file glm/gtc/matrix_access.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType row 8 | ( 9 | genType const & m, 10 | length_t index, 11 | typename genType::row_type const & x 12 | ) 13 | { 14 | assert(index >= 0 && index < m[0].length()); 15 | 16 | genType Result = m; 17 | for(length_t i = 0; i < m.length(); ++i) 18 | Result[i][index] = x[i]; 19 | return Result; 20 | } 21 | 22 | template 23 | GLM_FUNC_QUALIFIER typename genType::row_type row 24 | ( 25 | genType const & m, 26 | length_t index 27 | ) 28 | { 29 | assert(index >= 0 && index < m[0].length()); 30 | 31 | typename genType::row_type Result; 32 | for(length_t i = 0; i < m.length(); ++i) 33 | Result[i] = m[i][index]; 34 | return Result; 35 | } 36 | 37 | template 38 | GLM_FUNC_QUALIFIER genType column 39 | ( 40 | genType const & m, 41 | length_t index, 42 | typename genType::col_type const & x 43 | ) 44 | { 45 | assert(index >= 0 && index < m.length()); 46 | 47 | genType Result = m; 48 | Result[index] = x; 49 | return Result; 50 | } 51 | 52 | template 53 | GLM_FUNC_QUALIFIER typename genType::col_type column 54 | ( 55 | genType const & m, 56 | length_t index 57 | ) 58 | { 59 | assert(index >= 0 && index < m.length()); 60 | 61 | return m[index]; 62 | } 63 | }//namespace glm 64 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/matrix_inverse.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_matrix_inverse 2 | /// @file glm/gtc/matrix_inverse.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse 7 | /// @ingroup gtc 8 | /// 9 | /// Defines additional matrix inverting functions. 10 | /// need to be included to use these functionalities. 11 | 12 | #pragma once 13 | 14 | // Dependencies 15 | #include "../detail/setup.hpp" 16 | #include "../matrix.hpp" 17 | #include "../mat2x2.hpp" 18 | #include "../mat3x3.hpp" 19 | #include "../mat4x4.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTC_matrix_inverse extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtc_matrix_inverse 28 | /// @{ 29 | 30 | /// Fast matrix inverse for affine matrix. 31 | /// 32 | /// @param m Input matrix to invert. 33 | /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. 34 | /// @see gtc_matrix_inverse 35 | template 36 | GLM_FUNC_DECL genType affineInverse(genType const & m); 37 | 38 | /// Compute the inverse transpose of a matrix. 39 | /// 40 | /// @param m Input matrix to invert transpose. 41 | /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. 42 | /// @see gtc_matrix_inverse 43 | template 44 | GLM_FUNC_DECL genType inverseTranspose(genType const & m); 45 | 46 | /// @} 47 | }//namespace glm 48 | 49 | #include "matrix_inverse.inl" 50 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/noise.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_noise 2 | /// @file glm/gtc/noise.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_noise GLM_GTC_noise 7 | /// @ingroup gtc 8 | /// 9 | /// Defines 2D, 3D and 4D procedural noise functions 10 | /// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": 11 | /// https://github.com/ashima/webgl-noise 12 | /// Following Stefan Gustavson's paper "Simplex noise demystified": 13 | /// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf 14 | /// need to be included to use these functionalities. 15 | 16 | #pragma once 17 | 18 | // Dependencies 19 | #include "../detail/setup.hpp" 20 | #include "../detail/precision.hpp" 21 | #include "../detail/_noise.hpp" 22 | #include "../geometric.hpp" 23 | #include "../common.hpp" 24 | #include "../vector_relational.hpp" 25 | #include "../vec2.hpp" 26 | #include "../vec3.hpp" 27 | #include "../vec4.hpp" 28 | 29 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 30 | # pragma message("GLM: GLM_GTC_noise extension included") 31 | #endif 32 | 33 | namespace glm 34 | { 35 | /// @addtogroup gtc_noise 36 | /// @{ 37 | 38 | /// Classic perlin noise. 39 | /// @see gtc_noise 40 | template class vecType> 41 | GLM_FUNC_DECL T perlin( 42 | vecType const & p); 43 | 44 | /// Periodic perlin noise. 45 | /// @see gtc_noise 46 | template class vecType> 47 | GLM_FUNC_DECL T perlin( 48 | vecType const & p, 49 | vecType const & rep); 50 | 51 | /// Simplex noise. 52 | /// @see gtc_noise 53 | template class vecType> 54 | GLM_FUNC_DECL T simplex( 55 | vecType const & p); 56 | 57 | /// @} 58 | }//namespace glm 59 | 60 | #include "noise.inl" 61 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_swizzle 2 | /// @file glm/gtc/swizzle.inl 3 | 4 | namespace glm 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/ulp.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_ulp 2 | /// @file glm/gtc/ulp.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_ulp GLM_GTC_ulp 7 | /// @ingroup gtc 8 | /// 9 | /// @brief Allow the measurement of the accuracy of a function against a reference 10 | /// implementation. This extension works on floating-point data and provide results 11 | /// in ULP. 12 | /// need to be included to use these features. 13 | 14 | #pragma once 15 | 16 | // Dependencies 17 | #include "../detail/setup.hpp" 18 | #include "../detail/precision.hpp" 19 | #include "../detail/type_int.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTC_ulp extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtc_ulp 28 | /// @{ 29 | 30 | /// Return the next ULP value(s) after the input value(s). 31 | /// @see gtc_ulp 32 | template 33 | GLM_FUNC_DECL genType next_float(genType const & x); 34 | 35 | /// Return the previous ULP value(s) before the input value(s). 36 | /// @see gtc_ulp 37 | template 38 | GLM_FUNC_DECL genType prev_float(genType const & x); 39 | 40 | /// Return the value(s) ULP distance after the input value(s). 41 | /// @see gtc_ulp 42 | template 43 | GLM_FUNC_DECL genType next_float(genType const & x, uint const & Distance); 44 | 45 | /// Return the value(s) ULP distance before the input value(s). 46 | /// @see gtc_ulp 47 | template 48 | GLM_FUNC_DECL genType prev_float(genType const & x, uint const & Distance); 49 | 50 | /// Return the distance in the number of ULP between 2 scalars. 51 | /// @see gtc_ulp 52 | template 53 | GLM_FUNC_DECL uint float_distance(T const & x, T const & y); 54 | 55 | /// Return the distance in the number of ULP between 2 vectors. 56 | /// @see gtc_ulp 57 | template class vecType> 58 | GLM_FUNC_DECL vecType float_distance(vecType const & x, vecType const & y); 59 | 60 | /// @} 61 | }// namespace glm 62 | 63 | #include "ulp.inl" 64 | -------------------------------------------------------------------------------- /libs/glm/glm/gtc/vec1.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_vec1 2 | /// @file glm/gtc/vec1.inl 3 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/closest_point.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_closest_point 2 | /// @file glm/gtx/closest_point.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_closest_point GLM_GTX_closest_point 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Find the point on a straight line which is the closet of a point. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_closest_point extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_closest_point 25 | /// @{ 26 | 27 | /// Find the point on a straight line which is the closet of a point. 28 | /// @see gtx_closest_point 29 | template 30 | GLM_FUNC_DECL tvec3 closestPointOnLine( 31 | tvec3 const & point, 32 | tvec3 const & a, 33 | tvec3 const & b); 34 | 35 | /// 2d lines work as well 36 | template 37 | GLM_FUNC_DECL tvec2 closestPointOnLine( 38 | tvec2 const & point, 39 | tvec2 const & a, 40 | tvec2 const & b); 41 | 42 | /// @} 43 | }// namespace glm 44 | 45 | #include "closest_point.inl" 46 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/closest_point.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_closest_point 2 | /// @file glm/gtx/closest_point.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tvec3 closestPointOnLine 8 | ( 9 | tvec3 const & point, 10 | tvec3 const & a, 11 | tvec3 const & b 12 | ) 13 | { 14 | T LineLength = distance(a, b); 15 | tvec3 Vector = point - a; 16 | tvec3 LineDirection = (b - a) / LineLength; 17 | 18 | // Project Vector to LineDirection to get the distance of point from a 19 | T Distance = dot(Vector, LineDirection); 20 | 21 | if(Distance <= T(0)) return a; 22 | if(Distance >= LineLength) return b; 23 | return a + LineDirection * Distance; 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER tvec2 closestPointOnLine 28 | ( 29 | tvec2 const & point, 30 | tvec2 const & a, 31 | tvec2 const & b 32 | ) 33 | { 34 | T LineLength = distance(a, b); 35 | tvec2 Vector = point - a; 36 | tvec2 LineDirection = (b - a) / LineLength; 37 | 38 | // Project Vector to LineDirection to get the distance of point from a 39 | T Distance = dot(Vector, LineDirection); 40 | 41 | if(Distance <= T(0)) return a; 42 | if(Distance >= LineLength) return b; 43 | return a + LineDirection * Distance; 44 | } 45 | 46 | }//namespace glm 47 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/color_space.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_color_space 2 | /// @file glm/gtx/color_space.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_color_space GLM_GTX_color_space 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Related to RGB to HSV conversions and operations. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_color_space extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_color_space 25 | /// @{ 26 | 27 | /// Converts a color from HSV color space to its color in RGB color space. 28 | /// @see gtx_color_space 29 | template 30 | GLM_FUNC_DECL tvec3 rgbColor( 31 | tvec3 const & hsvValue); 32 | 33 | /// Converts a color from RGB color space to its color in HSV color space. 34 | /// @see gtx_color_space 35 | template 36 | GLM_FUNC_DECL tvec3 hsvColor( 37 | tvec3 const & rgbValue); 38 | 39 | /// Build a saturation matrix. 40 | /// @see gtx_color_space 41 | template 42 | GLM_FUNC_DECL tmat4x4 saturation( 43 | T const s); 44 | 45 | /// Modify the saturation of a color. 46 | /// @see gtx_color_space 47 | template 48 | GLM_FUNC_DECL tvec3 saturation( 49 | T const s, 50 | tvec3 const & color); 51 | 52 | /// Modify the saturation of a color. 53 | /// @see gtx_color_space 54 | template 55 | GLM_FUNC_DECL tvec4 saturation( 56 | T const s, 57 | tvec4 const & color); 58 | 59 | /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals. 60 | /// @see gtx_color_space 61 | template 62 | GLM_FUNC_DECL T luminosity( 63 | tvec3 const & color); 64 | 65 | /// @} 66 | }//namespace glm 67 | 68 | #include "color_space.inl" 69 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/color_space_YCoCg.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_color_space_YCoCg 2 | /// @file glm/gtx/color_space_YCoCg.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_color_space_YCoCg GLM_GTX_color_space_YCoCg 7 | /// @ingroup gtx 8 | /// 9 | /// @brief RGB to YCoCg conversions and operations 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_color_space_YCoCg extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_color_space_YCoCg 25 | /// @{ 26 | 27 | /// Convert a color from RGB color space to YCoCg color space. 28 | /// @see gtx_color_space_YCoCg 29 | template 30 | GLM_FUNC_DECL tvec3 rgb2YCoCg( 31 | tvec3 const & rgbColor); 32 | 33 | /// Convert a color from YCoCg color space to RGB color space. 34 | /// @see gtx_color_space_YCoCg 35 | template 36 | GLM_FUNC_DECL tvec3 YCoCg2rgb( 37 | tvec3 const & YCoCgColor); 38 | 39 | /// Convert a color from RGB color space to YCoCgR color space. 40 | /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" 41 | /// @see gtx_color_space_YCoCg 42 | template 43 | GLM_FUNC_DECL tvec3 rgb2YCoCgR( 44 | tvec3 const & rgbColor); 45 | 46 | /// Convert a color from YCoCgR color space to RGB color space. 47 | /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" 48 | /// @see gtx_color_space_YCoCg 49 | template 50 | GLM_FUNC_DECL tvec3 YCoCgR2rgb( 51 | tvec3 const & YCoCgColor); 52 | 53 | /// @} 54 | }//namespace glm 55 | 56 | #include "color_space_YCoCg.inl" 57 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/common.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_common 2 | /// @file glm/gtx/common.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_half_float (dependence) 6 | /// 7 | /// @defgroup gtx_common GLM_GTX_common 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Provide functions to increase the compatibility with Cg and HLSL languages 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependencies: 17 | #include "../vec2.hpp" 18 | #include "../vec3.hpp" 19 | #include "../vec4.hpp" 20 | #include "../gtc/vec1.hpp" 21 | 22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 23 | # pragma message("GLM: GLM_GTX_common extension included") 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_common 29 | /// @{ 30 | 31 | /// Returns true if x is a denormalized number 32 | /// Numbers whose absolute value is too small to be represented in the normal format are represented in an alternate, denormalized format. 33 | /// This format is less precise but can represent values closer to zero. 34 | /// 35 | /// @tparam genType Floating-point scalar or vector types. 36 | /// 37 | /// @see GLSL isnan man page 38 | /// @see GLSL 4.20.8 specification, section 8.3 Common Functions 39 | template 40 | GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x); 41 | 42 | /// Similar to 'mod' but with a different rounding and integer support. 43 | /// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)' 44 | /// 45 | /// @see GLSL mod vs HLSL fmod 46 | /// @see GLSL mod man page 47 | template class vecType> 48 | GLM_FUNC_DECL vecType fmod(vecType const & v); 49 | 50 | /// @} 51 | }//namespace glm 52 | 53 | #include "common.inl" 54 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/compatibility.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_compatibility 2 | /// @file glm/gtx/compatibility.inl 3 | 4 | #include 5 | 6 | namespace glm 7 | { 8 | // isfinite 9 | template 10 | GLM_FUNC_QUALIFIER bool isfinite( 11 | genType const & x) 12 | { 13 | # if GLM_HAS_CXX11_STL 14 | return std::isfinite(x) != 0; 15 | # elif GLM_COMPILER & GLM_COMPILER_VC 16 | return _finite(x); 17 | # elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID 18 | return _isfinite(x) != 0; 19 | # else 20 | if (std::numeric_limits::is_integer || std::denorm_absent == std::numeric_limits::has_denorm) 21 | return std::numeric_limits::min() <= x && std::numeric_limits::max() >= x; 22 | else 23 | return -std::numeric_limits::max() <= x && std::numeric_limits::max() >= x; 24 | # endif 25 | } 26 | 27 | template 28 | GLM_FUNC_QUALIFIER tvec1 isfinite( 29 | tvec1 const & x) 30 | { 31 | return tvec1( 32 | isfinite(x.x)); 33 | } 34 | 35 | template 36 | GLM_FUNC_QUALIFIER tvec2 isfinite( 37 | tvec2 const & x) 38 | { 39 | return tvec2( 40 | isfinite(x.x), 41 | isfinite(x.y)); 42 | } 43 | 44 | template 45 | GLM_FUNC_QUALIFIER tvec3 isfinite( 46 | tvec3 const & x) 47 | { 48 | return tvec3( 49 | isfinite(x.x), 50 | isfinite(x.y), 51 | isfinite(x.z)); 52 | } 53 | 54 | template 55 | GLM_FUNC_QUALIFIER tvec4 isfinite( 56 | tvec4 const & x) 57 | { 58 | return tvec4( 59 | isfinite(x.x), 60 | isfinite(x.y), 61 | isfinite(x.z), 62 | isfinite(x.w)); 63 | } 64 | 65 | }//namespace glm 66 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/component_wise.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_component_wise 2 | /// @file glm/gtx/component_wise.hpp 3 | /// @date 2007-05-21 / 2011-06-07 4 | /// @author Christophe Riccio 5 | /// 6 | /// @see core (dependence) 7 | /// 8 | /// @defgroup gtx_component_wise GLM_GTX_component_wise 9 | /// @ingroup gtx 10 | /// 11 | /// @brief Operations between components of a type 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependencies 18 | #include "../detail/setup.hpp" 19 | #include "../detail/precision.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTX_component_wise extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtx_component_wise 28 | /// @{ 29 | 30 | /// Convert an integer vector to a normalized float vector. 31 | /// If the parameter value type is already a floating precision type, the value is passed through. 32 | /// @see gtx_component_wise 33 | template class vecType> 34 | GLM_FUNC_DECL vecType compNormalize(vecType const & v); 35 | 36 | /// Convert a normalized float vector to an integer vector. 37 | /// If the parameter value type is already a floating precision type, the value is passed through. 38 | /// @see gtx_component_wise 39 | template class vecType> 40 | GLM_FUNC_DECL vecType compScale(vecType const & v); 41 | 42 | /// Add all vector components together. 43 | /// @see gtx_component_wise 44 | template 45 | GLM_FUNC_DECL typename genType::value_type compAdd(genType const & v); 46 | 47 | /// Multiply all vector components together. 48 | /// @see gtx_component_wise 49 | template 50 | GLM_FUNC_DECL typename genType::value_type compMul(genType const & v); 51 | 52 | /// Find the minimum value between single vector components. 53 | /// @see gtx_component_wise 54 | template 55 | GLM_FUNC_DECL typename genType::value_type compMin(genType const & v); 56 | 57 | /// Find the maximum value between single vector components. 58 | /// @see gtx_component_wise 59 | template 60 | GLM_FUNC_DECL typename genType::value_type compMax(genType const & v); 61 | 62 | /// @} 63 | }//namespace glm 64 | 65 | #include "component_wise.inl" 66 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/extend.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_extend 2 | /// @file glm/gtx/extend.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_extend GLM_GTX_extend 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Extend a position from a source to a position at a defined length. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_extend extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_extend 25 | /// @{ 26 | 27 | /// Extends of Length the Origin position using the (Source - Origin) direction. 28 | /// @see gtx_extend 29 | template 30 | GLM_FUNC_DECL genType extend( 31 | genType const & Origin, 32 | genType const & Source, 33 | typename genType::value_type const Length); 34 | 35 | /// @} 36 | }//namespace glm 37 | 38 | #include "extend.inl" 39 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_extend 2 | /// @file glm/gtx/extend.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType extend 8 | ( 9 | genType const & Origin, 10 | genType const & Source, 11 | genType const & Distance 12 | ) 13 | { 14 | return Origin + (Source - Origin) * Distance; 15 | } 16 | 17 | template 18 | GLM_FUNC_QUALIFIER tvec2 extend 19 | ( 20 | tvec2 const & Origin, 21 | tvec2 const & Source, 22 | T const & Distance 23 | ) 24 | { 25 | return Origin + (Source - Origin) * Distance; 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER tvec3 extend 30 | ( 31 | tvec3 const & Origin, 32 | tvec3 const & Source, 33 | T const & Distance 34 | ) 35 | { 36 | return Origin + (Source - Origin) * Distance; 37 | } 38 | 39 | template 40 | GLM_FUNC_QUALIFIER tvec4 extend 41 | ( 42 | tvec4 const & Origin, 43 | tvec4 const & Source, 44 | T const & Distance 45 | ) 46 | { 47 | return Origin + (Source - Origin) * Distance; 48 | } 49 | }//namespace glm 50 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/fast_trigonometry.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_fast_trigonometry 2 | /// @file glm/gtx/fast_trigonometry.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_fast_trigonometry GLM_GTX_fast_trigonometry 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Fast but less accurate implementations of trigonometric functions. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../gtc/constants.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_fast_trigonometry extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_fast_trigonometry 25 | /// @{ 26 | 27 | /// Wrap an angle to [0 2pi[ 28 | /// From GLM_GTX_fast_trigonometry extension. 29 | template 30 | GLM_FUNC_DECL T wrapAngle(T angle); 31 | 32 | /// Faster than the common sin function but less accurate. 33 | /// From GLM_GTX_fast_trigonometry extension. 34 | template 35 | GLM_FUNC_DECL T fastSin(T angle); 36 | 37 | /// Faster than the common cos function but less accurate. 38 | /// From GLM_GTX_fast_trigonometry extension. 39 | template 40 | GLM_FUNC_DECL T fastCos(T angle); 41 | 42 | /// Faster than the common tan function but less accurate. 43 | /// Defined between -2pi and 2pi. 44 | /// From GLM_GTX_fast_trigonometry extension. 45 | template 46 | GLM_FUNC_DECL T fastTan(T angle); 47 | 48 | /// Faster than the common asin function but less accurate. 49 | /// Defined between -2pi and 2pi. 50 | /// From GLM_GTX_fast_trigonometry extension. 51 | template 52 | GLM_FUNC_DECL T fastAsin(T angle); 53 | 54 | /// Faster than the common acos function but less accurate. 55 | /// Defined between -2pi and 2pi. 56 | /// From GLM_GTX_fast_trigonometry extension. 57 | template 58 | GLM_FUNC_DECL T fastAcos(T angle); 59 | 60 | /// Faster than the common atan function but less accurate. 61 | /// Defined between -2pi and 2pi. 62 | /// From GLM_GTX_fast_trigonometry extension. 63 | template 64 | GLM_FUNC_DECL T fastAtan(T y, T x); 65 | 66 | /// Faster than the common atan function but less accurate. 67 | /// Defined between -2pi and 2pi. 68 | /// From GLM_GTX_fast_trigonometry extension. 69 | template 70 | GLM_FUNC_DECL T fastAtan(T angle); 71 | 72 | /// @} 73 | }//namespace glm 74 | 75 | #include "fast_trigonometry.inl" 76 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/float_notmalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_float_normalize 2 | /// @file glm/gtx/float_normalize.inl 3 | 4 | #include 5 | 6 | namespace glm 7 | { 8 | template class vecType> 9 | GLM_FUNC_QUALIFIER vecType floatNormalize(vecType const & v) 10 | { 11 | return vecType(v) / static_cast(std::numeric_limits::max()); 12 | } 13 | 14 | }//namespace glm 15 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/gradient_paint.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_gradient_paint 2 | /// @file glm/gtx/gradient_paint.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_optimum_pow (dependence) 6 | /// 7 | /// @defgroup gtx_gradient_paint GLM_GTX_gradient_paint 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Functions that return the color of procedural gradient for specific coordinates. 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include "../gtx/optimum_pow.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_gradient_paint extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_gradient_paint 26 | /// @{ 27 | 28 | /// Return a color from a radial gradient. 29 | /// @see - gtx_gradient_paint 30 | template 31 | GLM_FUNC_DECL T radialGradient( 32 | tvec2 const & Center, 33 | T const & Radius, 34 | tvec2 const & Focal, 35 | tvec2 const & Position); 36 | 37 | /// Return a color from a linear gradient. 38 | /// @see - gtx_gradient_paint 39 | template 40 | GLM_FUNC_DECL T linearGradient( 41 | tvec2 const & Point0, 42 | tvec2 const & Point1, 43 | tvec2 const & Position); 44 | 45 | /// @} 46 | }// namespace glm 47 | 48 | #include "gradient_paint.inl" 49 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_gradient_paint 2 | /// @file glm/gtx/gradient_paint.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER T radialGradient 8 | ( 9 | tvec2 const & Center, 10 | T const & Radius, 11 | tvec2 const & Focal, 12 | tvec2 const & Position 13 | ) 14 | { 15 | tvec2 F = Focal - Center; 16 | tvec2 D = Position - Focal; 17 | T Radius2 = pow2(Radius); 18 | T Fx2 = pow2(F.x); 19 | T Fy2 = pow2(F.y); 20 | 21 | T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); 22 | T Denominator = Radius2 - (Fx2 + Fy2); 23 | return Numerator / Denominator; 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER T linearGradient 28 | ( 29 | tvec2 const & Point0, 30 | tvec2 const & Point1, 31 | tvec2 const & Position 32 | ) 33 | { 34 | tvec2 Dist = Point1 - Point0; 35 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 36 | } 37 | }//namespace glm 38 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/handed_coordinate_space.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_handed_coordinate_space 2 | /// @file glm/gtx/handed_coordinate_space.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space 7 | /// @ingroup gtx 8 | /// 9 | /// @brief To know if a set of three basis vectors defines a right or left-handed coordinate system. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_handed_coordinate_space 25 | /// @{ 26 | 27 | //! Return if a trihedron right handed or not. 28 | //! From GLM_GTX_handed_coordinate_space extension. 29 | template 30 | GLM_FUNC_DECL bool rightHanded( 31 | tvec3 const & tangent, 32 | tvec3 const & binormal, 33 | tvec3 const & normal); 34 | 35 | //! Return if a trihedron left handed or not. 36 | //! From GLM_GTX_handed_coordinate_space extension. 37 | template 38 | GLM_FUNC_DECL bool leftHanded( 39 | tvec3 const & tangent, 40 | tvec3 const & binormal, 41 | tvec3 const & normal); 42 | 43 | /// @} 44 | }// namespace glm 45 | 46 | #include "handed_coordinate_space.inl" 47 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_handed_coordinate_space 2 | /// @file glm/gtx/handed_coordinate_space.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER bool rightHanded 8 | ( 9 | tvec3 const & tangent, 10 | tvec3 const & binormal, 11 | tvec3 const & normal 12 | ) 13 | { 14 | return dot(cross(normal, tangent), binormal) > T(0); 15 | } 16 | 17 | template 18 | GLM_FUNC_QUALIFIER bool leftHanded 19 | ( 20 | tvec3 const & tangent, 21 | tvec3 const & binormal, 22 | tvec3 const & normal 23 | ) 24 | { 25 | return dot(cross(normal, tangent), binormal) < T(0); 26 | } 27 | }//namespace glm 28 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/integer.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_integer 2 | /// @file glm/gtx/integer.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_integer GLM_GTX_integer 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Add support for integer for core functions 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include "../gtc/integer.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_integer extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_integer 26 | /// @{ 27 | 28 | //! Returns x raised to the y power. 29 | //! From GLM_GTX_integer extension. 30 | GLM_FUNC_DECL int pow(int x, int y); 31 | 32 | //! Returns the positive square root of x. 33 | //! From GLM_GTX_integer extension. 34 | GLM_FUNC_DECL int sqrt(int x); 35 | 36 | //! Returns the floor log2 of x. 37 | //! From GLM_GTX_integer extension. 38 | GLM_FUNC_DECL unsigned int floor_log2(unsigned int x); 39 | 40 | //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. 41 | //! From GLM_GTX_integer extension. 42 | GLM_FUNC_DECL int mod(int x, int y); 43 | 44 | //! Return the factorial value of a number (!12 max, integer only) 45 | //! From GLM_GTX_integer extension. 46 | template 47 | GLM_FUNC_DECL genType factorial(genType const & x); 48 | 49 | //! 32bit signed integer. 50 | //! From GLM_GTX_integer extension. 51 | typedef signed int sint; 52 | 53 | //! Returns x raised to the y power. 54 | //! From GLM_GTX_integer extension. 55 | GLM_FUNC_DECL uint pow(uint x, uint y); 56 | 57 | //! Returns the positive square root of x. 58 | //! From GLM_GTX_integer extension. 59 | GLM_FUNC_DECL uint sqrt(uint x); 60 | 61 | //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. 62 | //! From GLM_GTX_integer extension. 63 | GLM_FUNC_DECL uint mod(uint x, uint y); 64 | 65 | //! Returns the number of leading zeros. 66 | //! From GLM_GTX_integer extension. 67 | GLM_FUNC_DECL uint nlz(uint x); 68 | 69 | /// @} 70 | }//namespace glm 71 | 72 | #include "integer.inl" 73 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/log_base.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_log_base 2 | /// @file glm/gtx/log_base.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_log_base GLM_GTX_log_base 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Logarithm for any base. base can be a vector or a scalar. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_log_base extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_log_base 25 | /// @{ 26 | 27 | /// Logarithm for any base. 28 | /// From GLM_GTX_log_base. 29 | template 30 | GLM_FUNC_DECL genType log( 31 | genType const & x, 32 | genType const & base); 33 | 34 | /// Logarithm for any base. 35 | /// From GLM_GTX_log_base. 36 | template class vecType> 37 | GLM_FUNC_DECL vecType sign( 38 | vecType const & x, 39 | vecType const & base); 40 | 41 | /// @} 42 | }//namespace glm 43 | 44 | #include "log_base.inl" 45 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_log_base 2 | /// @file glm/gtx/log_base.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType log(genType const & x, genType const & base) 8 | { 9 | assert(x != genType(0)); 10 | return glm::log(x) / glm::log(base); 11 | } 12 | 13 | template class vecType> 14 | GLM_FUNC_QUALIFIER vecType log(vecType const & x, vecType const & base) 15 | { 16 | return glm::log(x) / glm::log(base); 17 | } 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/matrix_cross_product.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_cross_product 2 | /// @file glm/gtx/matrix_cross_product.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Build cross product matrices 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_matrix_cross_product extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_matrix_cross_product 26 | /// @{ 27 | 28 | //! Build a cross product matrix. 29 | //! From GLM_GTX_matrix_cross_product extension. 30 | template 31 | GLM_FUNC_DECL tmat3x3 matrixCross3( 32 | tvec3 const & x); 33 | 34 | //! Build a cross product matrix. 35 | //! From GLM_GTX_matrix_cross_product extension. 36 | template 37 | GLM_FUNC_DECL tmat4x4 matrixCross4( 38 | tvec3 const & x); 39 | 40 | /// @} 41 | }//namespace glm 42 | 43 | #include "matrix_cross_product.inl" 44 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_cross_product 2 | /// @file glm/gtx/matrix_cross_product.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tmat3x3 matrixCross3 8 | ( 9 | tvec3 const & x 10 | ) 11 | { 12 | tmat3x3 Result(T(0)); 13 | Result[0][1] = x.z; 14 | Result[1][0] = -x.z; 15 | Result[0][2] = -x.y; 16 | Result[2][0] = x.y; 17 | Result[1][2] = x.x; 18 | Result[2][1] = -x.x; 19 | return Result; 20 | } 21 | 22 | template 23 | GLM_FUNC_QUALIFIER tmat4x4 matrixCross4 24 | ( 25 | tvec3 const & x 26 | ) 27 | { 28 | tmat4x4 Result(T(0)); 29 | Result[0][1] = x.z; 30 | Result[1][0] = -x.z; 31 | Result[0][2] = -x.y; 32 | Result[2][0] = x.y; 33 | Result[1][2] = x.x; 34 | Result[2][1] = -x.x; 35 | return Result; 36 | } 37 | 38 | }//namespace glm 39 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/matrix_decompose.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_decompose 2 | /// @file glm/gtx/matrix_decompose.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_matrix_decompose GLM_GTX_matrix_decompose 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Decomposes a model matrix to translations, rotation and scale components 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependencies 16 | #include "../mat4x4.hpp" 17 | #include "../vec3.hpp" 18 | #include "../vec4.hpp" 19 | #include "../geometric.hpp" 20 | #include "../gtc/quaternion.hpp" 21 | #include "../gtc/matrix_transform.hpp" 22 | 23 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 24 | # pragma message("GLM: GLM_GTX_matrix_decompose extension included") 25 | #endif 26 | 27 | namespace glm 28 | { 29 | /// @addtogroup gtx_matrix_decompose 30 | /// @{ 31 | 32 | /// Decomposes a model matrix to translations, rotation and scale components 33 | /// @see gtx_matrix_decompose 34 | template 35 | GLM_FUNC_DECL bool decompose( 36 | tmat4x4 const & modelMatrix, 37 | tvec3 & scale, tquat & orientation, tvec3 & translation, tvec3 & skew, tvec4 & perspective); 38 | 39 | /// @} 40 | }//namespace glm 41 | 42 | #include "matrix_decompose.inl" 43 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/matrix_interpolation.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_interpolation 2 | /// @file glm/gtx/matrix_interpolation.hpp 3 | /// @author Ghenadii Ursachi (the.asteroth@gmail.com) 4 | /// 5 | /// @see core (dependence) 6 | /// 7 | /// @defgroup gtx_matrix_interpolation GLM_GTX_matrix_interpolation 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Allows to directly interpolate two exiciting matrices. 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_matrix_interpolation extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_matrix_interpolation 26 | /// @{ 27 | 28 | /// Get the axis and angle of the rotation from a matrix. 29 | /// From GLM_GTX_matrix_interpolation extension. 30 | template 31 | GLM_FUNC_DECL void axisAngle( 32 | tmat4x4 const & mat, 33 | tvec3 & axis, 34 | T & angle); 35 | 36 | /// Build a matrix from axis and angle. 37 | /// From GLM_GTX_matrix_interpolation extension. 38 | template 39 | GLM_FUNC_DECL tmat4x4 axisAngleMatrix( 40 | tvec3 const & axis, 41 | T const angle); 42 | 43 | /// Extracts the rotation part of a matrix. 44 | /// From GLM_GTX_matrix_interpolation extension. 45 | template 46 | GLM_FUNC_DECL tmat4x4 extractMatrixRotation( 47 | tmat4x4 const & mat); 48 | 49 | /// Build a interpolation of 4 * 4 matrixes. 50 | /// From GLM_GTX_matrix_interpolation extension. 51 | /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results. 52 | template 53 | GLM_FUNC_DECL tmat4x4 interpolate( 54 | tmat4x4 const & m1, 55 | tmat4x4 const & m2, 56 | T const delta); 57 | 58 | /// @} 59 | }//namespace glm 60 | 61 | #include "matrix_interpolation.inl" 62 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/matrix_transform_2d.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_transform_2d 2 | /// @file glm/gtc/matrix_transform_2d.inl 3 | /// @author Miguel Ángel Pérez Martínez 4 | 5 | #include "../trigonometric.hpp" 6 | 7 | namespace glm 8 | { 9 | 10 | template 11 | GLM_FUNC_QUALIFIER tmat3x3 translate( 12 | tmat3x3 const & m, 13 | tvec2 const & v) 14 | { 15 | tmat3x3 Result(m); 16 | Result[2] = m[0] * v[0] + m[1] * v[1] + m[2]; 17 | return Result; 18 | } 19 | 20 | 21 | template 22 | GLM_FUNC_QUALIFIER tmat3x3 rotate( 23 | tmat3x3 const & m, 24 | T angle) 25 | { 26 | T const a = angle; 27 | T const c = cos(a); 28 | T const s = sin(a); 29 | 30 | tmat3x3 Result(uninitialize); 31 | Result[0] = m[0] * c + m[1] * s; 32 | Result[1] = m[0] * -s + m[1] * c; 33 | Result[2] = m[2]; 34 | return Result; 35 | } 36 | 37 | template 38 | GLM_FUNC_QUALIFIER tmat3x3 scale( 39 | tmat3x3 const & m, 40 | tvec2 const & v) 41 | { 42 | tmat3x3 Result(uninitialize); 43 | Result[0] = m[0] * v[0]; 44 | Result[1] = m[1] * v[1]; 45 | Result[2] = m[2]; 46 | return Result; 47 | } 48 | 49 | template 50 | GLM_FUNC_QUALIFIER tmat3x3 shearX( 51 | tmat3x3 const & m, 52 | T y) 53 | { 54 | tmat3x3 Result(1); 55 | Result[0][1] = y; 56 | return m * Result; 57 | } 58 | 59 | template 60 | GLM_FUNC_QUALIFIER tmat3x3 shearY( 61 | tmat3x3 const & m, 62 | T x) 63 | { 64 | tmat3x3 Result(1); 65 | Result[1][0] = x; 66 | return m * Result; 67 | } 68 | 69 | }//namespace glm 70 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/mixed_product.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_mixed_product 2 | /// @file glm/gtx/mixed_product.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_mixed_product GLM_GTX_mixed_producte 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Mixed product of 3 vectors. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_mixed_product extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_mixed_product 25 | /// @{ 26 | 27 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) 28 | template 29 | GLM_FUNC_DECL T mixedProduct( 30 | tvec3 const & v1, 31 | tvec3 const & v2, 32 | tvec3 const & v3); 33 | 34 | /// @} 35 | }// namespace glm 36 | 37 | #include "mixed_product.inl" 38 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_mixed_product 2 | /// @file glm/gtx/mixed_product.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER T mixedProduct 8 | ( 9 | tvec3 const & v1, 10 | tvec3 const & v2, 11 | tvec3 const & v3 12 | ) 13 | { 14 | return dot(cross(v1, v2), v3); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/norm.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_norm 2 | /// @file glm/gtx/norm.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_quaternion (dependence) 6 | /// 7 | /// @defgroup gtx_norm GLM_GTX_norm 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Various ways to compute vector norms. 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../detail/func_geometric.hpp" 18 | #include "../gtx/quaternion.hpp" 19 | 20 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 21 | # pragma message("GLM: GLM_GTX_norm extension included") 22 | #endif 23 | 24 | namespace glm 25 | { 26 | /// @addtogroup gtx_norm 27 | /// @{ 28 | 29 | /// Returns the squared length of x. 30 | /// From GLM_GTX_norm extension. 31 | template class vecType> 32 | GLM_FUNC_DECL T length2( 33 | vecType const & x); 34 | 35 | /// Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). 36 | /// From GLM_GTX_norm extension. 37 | template class vecType> 38 | GLM_FUNC_DECL T distance2( 39 | vecType const & p0, 40 | vecType const & p1); 41 | 42 | //! Returns the L1 norm between x and y. 43 | //! From GLM_GTX_norm extension. 44 | template 45 | GLM_FUNC_DECL T l1Norm( 46 | tvec3 const & x, 47 | tvec3 const & y); 48 | 49 | //! Returns the L1 norm of v. 50 | //! From GLM_GTX_norm extension. 51 | template 52 | GLM_FUNC_DECL T l1Norm( 53 | tvec3 const & v); 54 | 55 | //! Returns the L2 norm between x and y. 56 | //! From GLM_GTX_norm extension. 57 | template 58 | GLM_FUNC_DECL T l2Norm( 59 | tvec3 const & x, 60 | tvec3 const & y); 61 | 62 | //! Returns the L2 norm of v. 63 | //! From GLM_GTX_norm extension. 64 | template 65 | GLM_FUNC_DECL T l2Norm( 66 | tvec3 const & x); 67 | 68 | //! Returns the L norm between x and y. 69 | //! From GLM_GTX_norm extension. 70 | template 71 | GLM_FUNC_DECL T lxNorm( 72 | tvec3 const & x, 73 | tvec3 const & y, 74 | unsigned int Depth); 75 | 76 | //! Returns the L norm of v. 77 | //! From GLM_GTX_norm extension. 78 | template 79 | GLM_FUNC_DECL T lxNorm( 80 | tvec3 const & x, 81 | unsigned int Depth); 82 | 83 | /// @} 84 | }//namespace glm 85 | 86 | #include "norm.inl" 87 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/normal.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normal 2 | /// @file glm/gtx/normal.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_normal GLM_GTX_normal 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Compute the normal of a triangle. 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_normal extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_normal 26 | /// @{ 27 | 28 | //! Computes triangle normal from triangle points. 29 | //! From GLM_GTX_normal extension. 30 | template 31 | GLM_FUNC_DECL tvec3 triangleNormal( 32 | tvec3 const & p1, 33 | tvec3 const & p2, 34 | tvec3 const & p3); 35 | 36 | /// @} 37 | }//namespace glm 38 | 39 | #include "normal.inl" 40 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normal 2 | /// @file glm/gtx/normal.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tvec3 triangleNormal 8 | ( 9 | tvec3 const & p1, 10 | tvec3 const & p2, 11 | tvec3 const & p3 12 | ) 13 | { 14 | return normalize(cross(p1 - p2, p1 - p3)); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/normalize_dot.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normalize_dot 2 | /// @file glm/gtx/normalize_dot.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_fast_square_root (dependence) 6 | /// 7 | /// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Dot product of vectors that need to be normalize with a single square root. 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../gtx/fast_square_root.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_normalize_dot extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_normalize_dot 26 | /// @{ 27 | 28 | /// Normalize parameters and returns the dot product of x and y. 29 | /// It's faster that dot(normalize(x), normalize(y)). 30 | /// 31 | /// @see gtx_normalize_dot extension. 32 | template class vecType> 33 | GLM_FUNC_DECL T normalizeDot(vecType const & x, vecType const & y); 34 | 35 | /// Normalize parameters and returns the dot product of x and y. 36 | /// Faster that dot(fastNormalize(x), fastNormalize(y)). 37 | /// 38 | /// @see gtx_normalize_dot extension. 39 | template class vecType> 40 | GLM_FUNC_DECL T fastNormalizeDot(vecType const & x, vecType const & y); 41 | 42 | /// @} 43 | }//namespace glm 44 | 45 | #include "normalize_dot.inl" 46 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/normalize_dot.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normalize_dot 2 | /// @file glm/gtx/normalize_dot.inl 3 | 4 | namespace glm 5 | { 6 | template class vecType> 7 | GLM_FUNC_QUALIFIER T normalizeDot(vecType const & x, vecType const & y) 8 | { 9 | return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); 10 | } 11 | 12 | template class vecType> 13 | GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType const & x, vecType const & y) 14 | { 15 | return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); 16 | } 17 | }//namespace glm 18 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/number_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_number_precision 2 | /// @file glm/gtx/number_precision.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_type_precision (dependence) 6 | /// @see gtc_quaternion (dependence) 7 | /// 8 | /// @defgroup gtx_number_precision GLM_GTX_number_precision 9 | /// @ingroup gtx 10 | /// 11 | /// @brief Defined size types. 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependency: 18 | #include "../glm.hpp" 19 | #include "../gtc/type_precision.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTX_number_precision extension included") 23 | #endif 24 | 25 | namespace glm{ 26 | namespace gtx 27 | { 28 | ///////////////////////////// 29 | // Unsigned int vector types 30 | 31 | /// @addtogroup gtx_number_precision 32 | /// @{ 33 | 34 | typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension) 35 | typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension) 36 | typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension) 37 | typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension) 38 | 39 | ////////////////////// 40 | // Float vector types 41 | 42 | typedef f32 f32vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) 43 | typedef f64 f64vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) 44 | 45 | ////////////////////// 46 | // Float matrix types 47 | 48 | typedef f32 f32mat1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) 49 | typedef f32 f32mat1x1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) 50 | typedef f64 f64mat1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension) 51 | typedef f64 f64mat1x1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension) 52 | 53 | /// @} 54 | }//namespace gtx 55 | }//namespace glm 56 | 57 | #include "number_precision.inl" 58 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_number_precision 2 | /// @file glm/gtx/number_precision.inl 3 | 4 | namespace glm 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/optimum_pow.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_optimum_pow 2 | /// @file glm/gtx/optimum_pow.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_optimum_pow GLM_GTX_optimum_pow 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Integer exponentiation of power functions. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_optimum_pow extension included") 20 | #endif 21 | 22 | namespace glm{ 23 | namespace gtx 24 | { 25 | /// @addtogroup gtx_optimum_pow 26 | /// @{ 27 | 28 | /// Returns x raised to the power of 2. 29 | /// 30 | /// @see gtx_optimum_pow 31 | template 32 | GLM_FUNC_DECL genType pow2(genType const & x); 33 | 34 | /// Returns x raised to the power of 3. 35 | /// 36 | /// @see gtx_optimum_pow 37 | template 38 | GLM_FUNC_DECL genType pow3(genType const & x); 39 | 40 | /// Returns x raised to the power of 4. 41 | /// 42 | /// @see gtx_optimum_pow 43 | template 44 | GLM_FUNC_DECL genType pow4(genType const & x); 45 | 46 | /// @} 47 | }//namespace gtx 48 | }//namespace glm 49 | 50 | #include "optimum_pow.inl" 51 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_optimum_pow 2 | /// @file glm/gtx/optimum_pow.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType pow2(genType const & x) 8 | { 9 | return x * x; 10 | } 11 | 12 | template 13 | GLM_FUNC_QUALIFIER genType pow3(genType const & x) 14 | { 15 | return x * x * x; 16 | } 17 | 18 | template 19 | GLM_FUNC_QUALIFIER genType pow4(genType const & x) 20 | { 21 | return (x * x) * (x * x); 22 | } 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/orthonormalize.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_orthonormalize 2 | /// @file glm/gtx/orthonormalize.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Orthonormalize matrices. 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../vec3.hpp" 18 | #include "../mat3x3.hpp" 19 | #include "../geometric.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTX_orthonormalize extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtx_orthonormalize 28 | /// @{ 29 | 30 | /// Returns the orthonormalized matrix of m. 31 | /// 32 | /// @see gtx_orthonormalize 33 | template 34 | GLM_FUNC_DECL tmat3x3 orthonormalize(tmat3x3 const & m); 35 | 36 | /// Orthonormalizes x according y. 37 | /// 38 | /// @see gtx_orthonormalize 39 | template 40 | GLM_FUNC_DECL tvec3 orthonormalize(tvec3 const & x, tvec3 const & y); 41 | 42 | /// @} 43 | }//namespace glm 44 | 45 | #include "orthonormalize.inl" 46 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_orthonormalize 2 | /// @file glm/gtx/orthonormalize.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tmat3x3 orthonormalize(tmat3x3 const & m) 8 | { 9 | tmat3x3 r = m; 10 | 11 | r[0] = normalize(r[0]); 12 | 13 | T d0 = dot(r[0], r[1]); 14 | r[1] -= r[0] * d0; 15 | r[1] = normalize(r[1]); 16 | 17 | T d1 = dot(r[1], r[2]); 18 | d0 = dot(r[0], r[2]); 19 | r[2] -= r[0] * d0 + r[1] * d1; 20 | r[2] = normalize(r[2]); 21 | 22 | return r; 23 | } 24 | 25 | template 26 | GLM_FUNC_QUALIFIER tvec3 orthonormalize(tvec3 const & x, tvec3 const & y) 27 | { 28 | return normalize(x - y * dot(y, x)); 29 | } 30 | }//namespace glm 31 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/perpendicular.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_perpendicular 2 | /// @file glm/gtx/perpendicular.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_projection (dependence) 6 | /// 7 | /// @defgroup gtx_perpendicular GLM_GTX_perpendicular 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Perpendicular of a vector from other one 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | #include "../gtx/projection.hpp" 19 | 20 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 21 | # pragma message("GLM: GLM_GTX_perpendicular extension included") 22 | #endif 23 | 24 | namespace glm 25 | { 26 | /// @addtogroup gtx_perpendicular 27 | /// @{ 28 | 29 | //! Projects x a perpendicular axis of Normal. 30 | //! From GLM_GTX_perpendicular extension. 31 | template 32 | GLM_FUNC_DECL vecType perp( 33 | vecType const & x, 34 | vecType const & Normal); 35 | 36 | /// @} 37 | }//namespace glm 38 | 39 | #include "perpendicular.inl" 40 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_perpendicular 2 | /// @file glm/gtx/perpendicular.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER vecType perp 8 | ( 9 | vecType const & x, 10 | vecType const & Normal 11 | ) 12 | { 13 | return x - proj(x, Normal); 14 | } 15 | }//namespace glm 16 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/polar_coordinates.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_polar_coordinates 2 | /// @file glm/gtx/polar_coordinates.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Conversion from Euclidean space to polar space and revert. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_polar_coordinates extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_polar_coordinates 25 | /// @{ 26 | 27 | /// Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude. 28 | /// 29 | /// @see gtx_polar_coordinates 30 | template 31 | GLM_FUNC_DECL tvec3 polar( 32 | tvec3 const & euclidean); 33 | 34 | /// Convert Polar to Euclidean coordinates. 35 | /// 36 | /// @see gtx_polar_coordinates 37 | template 38 | GLM_FUNC_DECL tvec3 euclidean( 39 | tvec2 const & polar); 40 | 41 | /// @} 42 | }//namespace glm 43 | 44 | #include "polar_coordinates.inl" 45 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_polar_coordinates 2 | /// @file glm/gtx/polar_coordinates.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tvec3 polar 8 | ( 9 | tvec3 const & euclidean 10 | ) 11 | { 12 | T const Length(length(euclidean)); 13 | tvec3 const tmp(euclidean / Length); 14 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 15 | 16 | return tvec3( 17 | asin(tmp.y), // latitude 18 | atan(tmp.x, tmp.z), // longitude 19 | xz_dist); // xz distance 20 | } 21 | 22 | template 23 | GLM_FUNC_QUALIFIER tvec3 euclidean 24 | ( 25 | tvec2 const & polar 26 | ) 27 | { 28 | T const latitude(polar.x); 29 | T const longitude(polar.y); 30 | 31 | return tvec3( 32 | cos(latitude) * sin(longitude), 33 | sin(latitude), 34 | cos(latitude) * cos(longitude)); 35 | } 36 | 37 | }//namespace glm 38 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/projection.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_projection 2 | /// @file glm/gtx/projection.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_projection GLM_GTX_projection 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Projection of a vector to other one 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../geometric.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_projection extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_projection 25 | /// @{ 26 | 27 | /// Projects x on Normal. 28 | /// 29 | /// @see gtx_projection 30 | template 31 | GLM_FUNC_DECL vecType proj(vecType const & x, vecType const & Normal); 32 | 33 | /// @} 34 | }//namespace glm 35 | 36 | #include "projection.inl" 37 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_projection 2 | /// @file glm/gtx/projection.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER vecType proj(vecType const & x, vecType const & Normal) 8 | { 9 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 10 | } 11 | }//namespace glm 12 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/range.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_range 2 | /// @file glm/gtx/range.hpp 3 | /// @author Joshua Moerman 4 | /// 5 | /// @defgroup gtx_range GLM_GTX_range 6 | /// @ingroup gtx 7 | /// 8 | /// @brief Defines begin and end for vectors and matrices. Useful for range-based for loop. 9 | /// The range is defined over the elements, not over columns or rows (e.g. mat4 has 16 elements). 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependencies 16 | #include "../detail/setup.hpp" 17 | 18 | #if !GLM_HAS_RANGE_FOR 19 | # error "GLM_GTX_range requires C++11 suppport or 'range for'" 20 | #endif 21 | 22 | #include "../gtc/type_ptr.hpp" 23 | #include "../gtc/vec1.hpp" 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtx_range 28 | /// @{ 29 | 30 | template 31 | inline length_t components(tvec1 const & v) 32 | { 33 | return v.length(); 34 | } 35 | 36 | template 37 | inline length_t components(tvec2 const & v) 38 | { 39 | return v.length(); 40 | } 41 | 42 | template 43 | inline length_t components(tvec3 const & v) 44 | { 45 | return v.length(); 46 | } 47 | 48 | template 49 | inline length_t components(tvec4 const & v) 50 | { 51 | return v.length(); 52 | } 53 | 54 | template 55 | inline length_t components(genType const & m) 56 | { 57 | return m.length() * m[0].length(); 58 | } 59 | 60 | template 61 | inline typename genType::value_type const * begin(genType const & v) 62 | { 63 | return value_ptr(v); 64 | } 65 | 66 | template 67 | inline typename genType::value_type const * end(genType const & v) 68 | { 69 | return begin(v) + components(v); 70 | } 71 | 72 | template 73 | inline typename genType::value_type * begin(genType& v) 74 | { 75 | return value_ptr(v); 76 | } 77 | 78 | template 79 | inline typename genType::value_type * end(genType& v) 80 | { 81 | return begin(v) + components(v); 82 | } 83 | 84 | /// @} 85 | }//namespace glm 86 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/raw_data.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_raw_data 2 | /// @file glm/gtx/raw_data.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_raw_data GLM_GTX_raw_data 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Projection of a vector to other one 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependencies 16 | #include "../detail/setup.hpp" 17 | #include "../detail/type_int.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_raw_data extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_raw_data 26 | /// @{ 27 | 28 | //! Type for byte numbers. 29 | //! From GLM_GTX_raw_data extension. 30 | typedef detail::uint8 byte; 31 | 32 | //! Type for word numbers. 33 | //! From GLM_GTX_raw_data extension. 34 | typedef detail::uint16 word; 35 | 36 | //! Type for dword numbers. 37 | //! From GLM_GTX_raw_data extension. 38 | typedef detail::uint32 dword; 39 | 40 | //! Type for qword numbers. 41 | //! From GLM_GTX_raw_data extension. 42 | typedef detail::uint64 qword; 43 | 44 | /// @} 45 | }// namespace glm 46 | 47 | #include "raw_data.inl" 48 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_raw_data 2 | /// @file glm/gtx/raw_data.inl 3 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/rotate_normalized_axis.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_rotate_normalized_axis 2 | /// @file glm/gtx/rotate_normalized_axis.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_matrix_transform 6 | /// @see gtc_quaternion 7 | /// 8 | /// @defgroup gtx_rotate_normalized_axis GLM_GTX_rotate_normalized_axis 9 | /// @ingroup gtx 10 | /// 11 | /// @brief Quaternions and matrices rotations around normalized axis. 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependency: 18 | #include "../glm.hpp" 19 | #include "../gtc/epsilon.hpp" 20 | #include "../gtc/quaternion.hpp" 21 | 22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 23 | # pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included") 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_rotate_normalized_axis 29 | /// @{ 30 | 31 | /// Builds a rotation 4 * 4 matrix created from a normalized axis and an angle. 32 | /// 33 | /// @param m Input matrix multiplied by this rotation matrix. 34 | /// @param angle Rotation angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. 35 | /// @param axis Rotation axis, must be normalized. 36 | /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 37 | /// 38 | /// @see gtx_rotate_normalized_axis 39 | /// @see - rotate(T angle, T x, T y, T z) 40 | /// @see - rotate(tmat4x4 const & m, T angle, T x, T y, T z) 41 | /// @see - rotate(T angle, tvec3 const & v) 42 | template 43 | GLM_FUNC_DECL tmat4x4 rotateNormalizedAxis( 44 | tmat4x4 const & m, 45 | T const & angle, 46 | tvec3 const & axis); 47 | 48 | /// Rotates a quaternion from a vector of 3 components normalized axis and an angle. 49 | /// 50 | /// @param q Source orientation 51 | /// @param angle Angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. 52 | /// @param axis Normalized axis of the rotation, must be normalized. 53 | /// 54 | /// @see gtx_rotate_normalized_axis 55 | template 56 | GLM_FUNC_DECL tquat rotateNormalizedAxis( 57 | tquat const & q, 58 | T const & angle, 59 | tvec3 const & axis); 60 | 61 | /// @} 62 | }//namespace glm 63 | 64 | #include "rotate_normalized_axis.inl" 65 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/rotate_normalized_axis.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_rotate_normalized_axis 2 | /// @file glm/gtx/rotate_normalized_axis.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tmat4x4 rotateNormalizedAxis 8 | ( 9 | tmat4x4 const & m, 10 | T const & angle, 11 | tvec3 const & v 12 | ) 13 | { 14 | T const a = angle; 15 | T const c = cos(a); 16 | T const s = sin(a); 17 | 18 | tvec3 const axis(v); 19 | 20 | tvec3 const temp((static_cast(1) - c) * axis); 21 | 22 | tmat4x4 Rotate(uninitialize); 23 | Rotate[0][0] = c + temp[0] * axis[0]; 24 | Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; 25 | Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; 26 | 27 | Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; 28 | Rotate[1][1] = c + temp[1] * axis[1]; 29 | Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; 30 | 31 | Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; 32 | Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; 33 | Rotate[2][2] = c + temp[2] * axis[2]; 34 | 35 | tmat4x4 Result(uninitialize); 36 | Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; 37 | Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; 38 | Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; 39 | Result[3] = m[3]; 40 | return Result; 41 | } 42 | 43 | template 44 | GLM_FUNC_QUALIFIER tquat rotateNormalizedAxis 45 | ( 46 | tquat const & q, 47 | T const & angle, 48 | tvec3 const & v 49 | ) 50 | { 51 | tvec3 const Tmp(v); 52 | 53 | T const AngleRad(angle); 54 | T const Sin = sin(AngleRad * T(0.5)); 55 | 56 | return q * tquat(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); 57 | //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); 58 | } 59 | }//namespace glm 60 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/scalar_multiplication.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx 2 | /// @file glm/gtx/scalar_multiplication.hpp 3 | /// @author Joshua Moerman 4 | /// 5 | /// @brief Enables scalar multiplication for all types 6 | /// 7 | /// Since GLSL is very strict about types, the following (often used) combinations do not work: 8 | /// double * vec4 9 | /// int * vec4 10 | /// vec4 / int 11 | /// So we'll fix that! Of course "float * vec4" should remain the same (hence the enable_if magic) 12 | 13 | #pragma once 14 | 15 | #include "../detail/setup.hpp" 16 | 17 | #if !GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC) 18 | # error "GLM_GTX_scalar_multiplication requires C++11 support or alias templates and if not support for GCC" 19 | #endif 20 | 21 | #include "../vec2.hpp" 22 | #include "../vec3.hpp" 23 | #include "../vec4.hpp" 24 | #include "../mat2x2.hpp" 25 | #include 26 | 27 | namespace glm 28 | { 29 | template 30 | using return_type_scalar_multiplication = typename std::enable_if< 31 | !std::is_same::value // T may not be a float 32 | && std::is_arithmetic::value, Vec // But it may be an int or double (no vec3 or mat3, ...) 33 | >::type; 34 | 35 | #define GLM_IMPLEMENT_SCAL_MULT(Vec) \ 36 | template \ 37 | return_type_scalar_multiplication \ 38 | operator*(T const & s, Vec rh){ \ 39 | return rh *= static_cast(s); \ 40 | } \ 41 | \ 42 | template \ 43 | return_type_scalar_multiplication \ 44 | operator*(Vec lh, T const & s){ \ 45 | return lh *= static_cast(s); \ 46 | } \ 47 | \ 48 | template \ 49 | return_type_scalar_multiplication \ 50 | operator/(Vec lh, T const & s){ \ 51 | return lh *= 1.0f / s; \ 52 | } 53 | 54 | GLM_IMPLEMENT_SCAL_MULT(vec2) 55 | GLM_IMPLEMENT_SCAL_MULT(vec3) 56 | GLM_IMPLEMENT_SCAL_MULT(vec4) 57 | 58 | GLM_IMPLEMENT_SCAL_MULT(mat2) 59 | GLM_IMPLEMENT_SCAL_MULT(mat2x3) 60 | GLM_IMPLEMENT_SCAL_MULT(mat2x4) 61 | GLM_IMPLEMENT_SCAL_MULT(mat3x2) 62 | GLM_IMPLEMENT_SCAL_MULT(mat3) 63 | GLM_IMPLEMENT_SCAL_MULT(mat3x4) 64 | GLM_IMPLEMENT_SCAL_MULT(mat4x2) 65 | GLM_IMPLEMENT_SCAL_MULT(mat4x3) 66 | GLM_IMPLEMENT_SCAL_MULT(mat4) 67 | 68 | #undef GLM_IMPLEMENT_SCAL_MULT 69 | } // namespace glm 70 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/scalar_relational.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_scalar_relational 2 | /// @file glm/gtx/scalar_relational.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Extend a position from a source to a position at a defined length. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_extend extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_scalar_relational 25 | /// @{ 26 | 27 | 28 | 29 | /// @} 30 | }//namespace glm 31 | 32 | #include "scalar_relational.inl" 33 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/scalar_relational.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_scalar_relational 2 | /// @file glm/gtx/scalar_relational.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER bool lessThan 8 | ( 9 | T const & x, 10 | T const & y 11 | ) 12 | { 13 | return x < y; 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER bool lessThanEqual 18 | ( 19 | T const & x, 20 | T const & y 21 | ) 22 | { 23 | return x <= y; 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER bool greaterThan 28 | ( 29 | T const & x, 30 | T const & y 31 | ) 32 | { 33 | return x > y; 34 | } 35 | 36 | template 37 | GLM_FUNC_QUALIFIER bool greaterThanEqual 38 | ( 39 | T const & x, 40 | T const & y 41 | ) 42 | { 43 | return x >= y; 44 | } 45 | 46 | template 47 | GLM_FUNC_QUALIFIER bool equal 48 | ( 49 | T const & x, 50 | T const & y 51 | ) 52 | { 53 | return x == y; 54 | } 55 | 56 | template 57 | GLM_FUNC_QUALIFIER bool notEqual 58 | ( 59 | T const & x, 60 | T const & y 61 | ) 62 | { 63 | return x != y; 64 | } 65 | 66 | GLM_FUNC_QUALIFIER bool any 67 | ( 68 | bool const & x 69 | ) 70 | { 71 | return x; 72 | } 73 | 74 | GLM_FUNC_QUALIFIER bool all 75 | ( 76 | bool const & x 77 | ) 78 | { 79 | return x; 80 | } 81 | 82 | GLM_FUNC_QUALIFIER bool not_ 83 | ( 84 | bool const & x 85 | ) 86 | { 87 | return !x; 88 | } 89 | }//namespace glm 90 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/spline.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_spline 2 | /// @file glm/gtx/spline.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_spline GLM_GTX_spline 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Spline functions 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include "../gtx/optimum_pow.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_spline extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_spline 26 | /// @{ 27 | 28 | /// Return a point from a catmull rom curve. 29 | /// @see gtx_spline extension. 30 | template 31 | GLM_FUNC_DECL genType catmullRom( 32 | genType const & v1, 33 | genType const & v2, 34 | genType const & v3, 35 | genType const & v4, 36 | typename genType::value_type const & s); 37 | 38 | /// Return a point from a hermite curve. 39 | /// @see gtx_spline extension. 40 | template 41 | GLM_FUNC_DECL genType hermite( 42 | genType const & v1, 43 | genType const & t1, 44 | genType const & v2, 45 | genType const & t2, 46 | typename genType::value_type const & s); 47 | 48 | /// Return a point from a cubic curve. 49 | /// @see gtx_spline extension. 50 | template 51 | GLM_FUNC_DECL genType cubic( 52 | genType const & v1, 53 | genType const & v2, 54 | genType const & v3, 55 | genType const & v4, 56 | typename genType::value_type const & s); 57 | 58 | /// @} 59 | }//namespace glm 60 | 61 | #include "spline.inl" 62 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/spline.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_spline 2 | /// @file glm/gtx/spline.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType catmullRom 8 | ( 9 | genType const & v1, 10 | genType const & v2, 11 | genType const & v3, 12 | genType const & v4, 13 | typename genType::value_type const & s 14 | ) 15 | { 16 | typename genType::value_type s1 = s; 17 | typename genType::value_type s2 = pow2(s); 18 | typename genType::value_type s3 = pow3(s); 19 | 20 | typename genType::value_type f1 = -s3 + typename genType::value_type(2) * s2 - s; 21 | typename genType::value_type f2 = typename genType::value_type(3) * s3 - typename genType::value_type(5) * s2 + typename genType::value_type(2); 22 | typename genType::value_type f3 = typename genType::value_type(-3) * s3 + typename genType::value_type(4) * s2 + s; 23 | typename genType::value_type f4 = s3 - s2; 24 | 25 | return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / typename genType::value_type(2); 26 | 27 | } 28 | 29 | template 30 | GLM_FUNC_QUALIFIER genType hermite 31 | ( 32 | genType const & v1, 33 | genType const & t1, 34 | genType const & v2, 35 | genType const & t2, 36 | typename genType::value_type const & s 37 | ) 38 | { 39 | typename genType::value_type s1 = s; 40 | typename genType::value_type s2 = pow2(s); 41 | typename genType::value_type s3 = pow3(s); 42 | 43 | typename genType::value_type f1 = typename genType::value_type(2) * s3 - typename genType::value_type(3) * s2 + typename genType::value_type(1); 44 | typename genType::value_type f2 = typename genType::value_type(-2) * s3 + typename genType::value_type(3) * s2; 45 | typename genType::value_type f3 = s3 - typename genType::value_type(2) * s2 + s; 46 | typename genType::value_type f4 = s3 - s2; 47 | 48 | return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2; 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER genType cubic 53 | ( 54 | genType const & v1, 55 | genType const & v2, 56 | genType const & v3, 57 | genType const & v4, 58 | typename genType::value_type const & s 59 | ) 60 | { 61 | return ((v1 * s + v2) * s + v3) * s + v4; 62 | } 63 | }//namespace glm 64 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/std_based_type.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_std_based_type 2 | /// @file glm/gtx/std_based_type.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_std_based_type GLM_GTX_std_based_type 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Adds vector types based on STL value types. 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_std_based_type extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_std_based_type 26 | /// @{ 27 | 28 | /// Vector type based of one std::size_t component. 29 | /// @see GLM_GTX_std_based_type 30 | typedef tvec1 size1; 31 | 32 | /// Vector type based of two std::size_t components. 33 | /// @see GLM_GTX_std_based_type 34 | typedef tvec2 size2; 35 | 36 | /// Vector type based of three std::size_t components. 37 | /// @see GLM_GTX_std_based_type 38 | typedef tvec3 size3; 39 | 40 | /// Vector type based of four std::size_t components. 41 | /// @see GLM_GTX_std_based_type 42 | typedef tvec4 size4; 43 | 44 | /// Vector type based of one std::size_t component. 45 | /// @see GLM_GTX_std_based_type 46 | typedef tvec1 size1_t; 47 | 48 | /// Vector type based of two std::size_t components. 49 | /// @see GLM_GTX_std_based_type 50 | typedef tvec2 size2_t; 51 | 52 | /// Vector type based of three std::size_t components. 53 | /// @see GLM_GTX_std_based_type 54 | typedef tvec3 size3_t; 55 | 56 | /// Vector type based of four std::size_t components. 57 | /// @see GLM_GTX_std_based_type 58 | typedef tvec4 size4_t; 59 | 60 | /// @} 61 | }//namespace glm 62 | 63 | #include "std_based_type.inl" 64 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_std_based_type 2 | /// @file glm/gtx/std_based_type.inl 3 | 4 | namespace glm 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /libs/glm/glm/gtx/string_cast.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_string_cast 2 | /// @file glm/gtx/string_cast.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_half_float (dependence) 6 | /// @see gtx_integer (dependence) 7 | /// @see gtx_quaternion (dependence) 8 | /// 9 | /// @defgroup gtx_string_cast GLM_GTX_string_cast 10 | /// @ingroup gtx 11 | /// 12 | /// @brief Setup strings for GLM type values 13 | /// 14 | /// need to be included to use these functionalities. 15 | /// This extension is not supported with CUDA 16 | 17 | #pragma once 18 | 19 | // Dependency: 20 | #include "../glm.hpp" 21 | #include "../gtc/type_precision.hpp" 22 | #include "../gtc/quaternion.hpp" 23 | #include "../gtx/dual_quaternion.hpp" 24 | #include 25 | 26 | #if(GLM_COMPILER & GLM_COMPILER_CUDA) 27 | # error "GLM_GTX_string_cast is not supported on CUDA compiler" 28 | #endif 29 | 30 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 31 | # pragma message("GLM: GLM_GTX_string_cast extension included") 32 | #endif 33 | 34 | namespace glm 35 | { 36 | /// @addtogroup gtx_string_cast 37 | /// @{ 38 | 39 | /// Create a string from a GLM vector or matrix typed variable. 40 | /// @see gtx_string_cast extension. 41 | template